feat: 斗鱼外部单协作台账与店铺实时同步
This commit is contained in:
@@ -1669,3 +1669,247 @@ class HuyaExternalOrderAuditOut(BaseModel):
|
||||
detail: str = ""
|
||||
success: bool | None = None
|
||||
created_at: datetime | None = None
|
||||
|
||||
|
||||
# ==================== 斗鱼外部单协作 ====================
|
||||
|
||||
|
||||
class DouyuCollabShopCreate(BaseModel):
|
||||
name: str = Field(..., min_length=1, max_length=64)
|
||||
remark: str = Field("", max_length=255)
|
||||
|
||||
|
||||
class DouyuCollabShopUpdate(BaseModel):
|
||||
name: str | None = Field(None, min_length=1, max_length=64)
|
||||
sort_order: int | None = None
|
||||
is_active: bool | None = None
|
||||
remark: str | None = Field(None, max_length=255)
|
||||
|
||||
|
||||
class DouyuCollabShopOut(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
sort_order: int = 0
|
||||
is_active: bool = True
|
||||
remark: str = ""
|
||||
created_by: int | None = None
|
||||
updated_by: int | None = None
|
||||
created_at: datetime | None = None
|
||||
updated_at: datetime | None = None
|
||||
|
||||
|
||||
class DouyuCollabGoodsOut(BaseModel):
|
||||
commodity_id: str = ""
|
||||
name: str = ""
|
||||
score: int | None = None
|
||||
status: str = ""
|
||||
open_status: int | None = None
|
||||
start_time: int | None = None
|
||||
end_time: int | None = None
|
||||
mark: str = ""
|
||||
count: int | None = None
|
||||
elite_limited: int | None = None
|
||||
is_limited: bool = False
|
||||
raw: dict[str, Any] | None = None
|
||||
|
||||
|
||||
class DouyuCollabAccountLookupRequest(BaseModel):
|
||||
username: str = Field(..., min_length=1, max_length=128)
|
||||
with_goods: bool = True
|
||||
|
||||
|
||||
class DouyuCollabAccountLookupOut(BaseModel):
|
||||
found: bool = False
|
||||
ok: bool = False
|
||||
message: str = ""
|
||||
errors: list[str] = Field(default_factory=list)
|
||||
account_id: int | None = None
|
||||
account_username: str = ""
|
||||
account_uid: str = ""
|
||||
account_nickname: str = ""
|
||||
ck_status: str = ""
|
||||
ck_status_label: str = ""
|
||||
manual_type: int | None = None
|
||||
manual_score: int | None = None
|
||||
expire_time: int | None = None
|
||||
manual_opened: bool = False
|
||||
bind_game_account: str = ""
|
||||
bind_game_role: str = ""
|
||||
bind_game_channel: str = ""
|
||||
fish_fin_balance: int | None = None
|
||||
goods: list[DouyuCollabGoodsOut] = Field(default_factory=list)
|
||||
goods_count: int = 0
|
||||
orders_using_account: list[dict[str, Any]] = Field(default_factory=list)
|
||||
|
||||
|
||||
class DouyuCollabOrderCreate(BaseModel):
|
||||
order_no: str = Field(..., min_length=1, max_length=64)
|
||||
shop: str = Field("", max_length=64)
|
||||
owner_id: int | None = None
|
||||
account_username: str = Field("", max_length=128)
|
||||
gift_name: str = Field("", max_length=128)
|
||||
commodity_id: str = Field("", max_length=64)
|
||||
required_points: int | None = Field(None, ge=0)
|
||||
home_images: list[str] = Field(default_factory=list)
|
||||
remark: str = Field("", max_length=512)
|
||||
draft: bool = False
|
||||
require_verified: bool = True
|
||||
|
||||
|
||||
class DouyuCollabOrderUpdate(BaseModel):
|
||||
order_no: str | None = Field(None, max_length=64)
|
||||
shop: str | None = Field(None, max_length=64)
|
||||
owner_id: int | None = None
|
||||
account_username: str | None = Field(None, max_length=128)
|
||||
gift_name: str | None = Field(None, max_length=128)
|
||||
commodity_id: str | None = Field(None, max_length=64)
|
||||
required_points: int | None = Field(None, ge=0)
|
||||
home_images: list[str] | None = None
|
||||
remark: str | None = Field(None, max_length=512)
|
||||
expected_version: int | None = None
|
||||
|
||||
|
||||
class DouyuCollabStatusRequest(BaseModel):
|
||||
status: str = Field(..., min_length=1, max_length=16)
|
||||
reason: str = Field("", max_length=256)
|
||||
rollback: bool = False
|
||||
expected_version: int | None = None
|
||||
|
||||
|
||||
class DouyuCollabStatusBatchRequest(BaseModel):
|
||||
ids: list[int] = Field(default_factory=list)
|
||||
status: str = Field(..., min_length=1, max_length=16)
|
||||
reason: str = Field("", max_length=256)
|
||||
rollback: bool = False
|
||||
|
||||
|
||||
class DouyuCollabAccountRequest(BaseModel):
|
||||
account_username: str = Field(..., min_length=1, max_length=128)
|
||||
expected_version: int | None = None
|
||||
|
||||
|
||||
class DouyuCollabImagesRequest(BaseModel):
|
||||
home_images: list[str] = Field(default_factory=list)
|
||||
expected_version: int | None = None
|
||||
|
||||
|
||||
class DouyuCollabArchiveRequest(BaseModel):
|
||||
ids: list[int] = Field(default_factory=list)
|
||||
reason: str = Field("", max_length=256)
|
||||
|
||||
|
||||
class DouyuCollabOrderOut(BaseModel):
|
||||
id: int
|
||||
order_no: str
|
||||
shop: str = ""
|
||||
owner_id: int | None = None
|
||||
owner_name: str = ""
|
||||
|
||||
account_id: int | None = None
|
||||
account_username: str = ""
|
||||
account_uid: str = ""
|
||||
account_nickname: str = ""
|
||||
account_exists: bool = False
|
||||
has_cookie: bool = False
|
||||
account_ck_status: str = ""
|
||||
account_status: str = ""
|
||||
|
||||
bind_game_account: str = ""
|
||||
bind_game_role: str = ""
|
||||
bind_game_channel: str = ""
|
||||
bind_snapshot_at: datetime | None = None
|
||||
|
||||
home_images: list[str] = Field(default_factory=list)
|
||||
home_image_urls: list[str] = Field(default_factory=list)
|
||||
home_image_thumb_urls: list[str] = Field(default_factory=list)
|
||||
gift_name: str = ""
|
||||
commodity_id: str = ""
|
||||
required_points: int | None = None
|
||||
remark: str = ""
|
||||
|
||||
status: str = "incomplete"
|
||||
status_label: str = ""
|
||||
next_status: str | None = None
|
||||
missing_fields: list[str] = Field(default_factory=list)
|
||||
fish_fin_balance: int | None = None
|
||||
points_balance: int | None = None
|
||||
points_required_total: int | None = None
|
||||
points_surplus: int | None = None
|
||||
points_threshold: int | None = None
|
||||
points_checked_at: datetime | None = None
|
||||
points_check_reason: str = ""
|
||||
points_check_message: str = ""
|
||||
points_check_detail: dict[str, Any] | None = None
|
||||
recharged_at: datetime | None = None
|
||||
scripted_at: datetime | None = None
|
||||
done_at: datetime | None = None
|
||||
void_reason: str = ""
|
||||
|
||||
is_archived: bool = False
|
||||
archived_at: datetime | None = None
|
||||
archived_by: int | None = None
|
||||
archived_by_name: str = ""
|
||||
archive_reason: str = ""
|
||||
|
||||
created_by: int | None = None
|
||||
created_by_name: str = ""
|
||||
updated_by: int | None = None
|
||||
updated_by_name: str = ""
|
||||
version: int = 0
|
||||
created_at: datetime | None = None
|
||||
updated_at: datetime | None = None
|
||||
account_cluster: dict[str, Any] | None = None
|
||||
|
||||
last_metric_at: datetime | None = None
|
||||
last_metric_message: str = ""
|
||||
last_verdict: str = ""
|
||||
last_verdict_label: str = ""
|
||||
last_records_total: int = 0
|
||||
last_records_matched: int = 0
|
||||
|
||||
|
||||
class DouyuCollabOrderListOut(BaseModel):
|
||||
items: list[DouyuCollabOrderOut]
|
||||
total: int
|
||||
page: int
|
||||
page_size: int
|
||||
|
||||
|
||||
class DouyuCollabSummaryOut(BaseModel):
|
||||
total: int
|
||||
by_status: dict[str, int]
|
||||
account_missing: int = 0
|
||||
ck_invalid: int = 0
|
||||
archived_total: int = 0
|
||||
|
||||
|
||||
class DouyuCollabOwnerOut(BaseModel):
|
||||
id: int
|
||||
username: str
|
||||
|
||||
|
||||
class DouyuCollabMetricOut(BaseModel):
|
||||
id: int
|
||||
order_id: int
|
||||
order_no: str = ""
|
||||
account_username: str = ""
|
||||
fish_fin_balance: int | None = None
|
||||
points_balance: int | None = None
|
||||
points_required_total: int | None = None
|
||||
points_surplus: int | None = None
|
||||
records_total: int = 0
|
||||
records_matched: int = 0
|
||||
verdict: str = ""
|
||||
verdict_label: str = ""
|
||||
message: str = ""
|
||||
source: str = ""
|
||||
created_at: datetime | None = None
|
||||
|
||||
|
||||
class DouyuCollabTimelineOut(BaseModel):
|
||||
id: int
|
||||
action: str
|
||||
username: str = ""
|
||||
detail: str = ""
|
||||
success: bool | None = None
|
||||
created_at: datetime | None = None
|
||||
|
||||
Reference in New Issue
Block a user