feat(douyu): 完善账号同步域与供给目标配置

This commit is contained in:
yml
2026-11-21 21:54:34 +08:00
parent 3baf15afda
commit e178a393e4
11 changed files with 586 additions and 9 deletions
+42
View File
@@ -1581,6 +1581,48 @@ class DouyuConfigUpdate(BaseModel):
skin_id: str | None = None
class DouyuSupplyTargetUpsert(BaseModel):
platform: str = Field("douyu", pattern="^douyu$")
scope: str = Field("elite", pattern="^[a-z_]{1,16}$")
commodity_id: str = Field("", max_length=64)
value_class: str = Field(..., pattern="^(high_value|ordinary)$")
target_covered: int = Field(0, ge=0, le=1_000_000)
target_available: int = Field(0, ge=0, le=1_000_000)
target_allocatable: int = Field(0, ge=0, le=1_000_000)
safety_buffer: int = Field(0, ge=0, le=100_000)
enabled: bool = True
class DouyuSupplyTargetUpdate(BaseModel):
target_covered: int = Field(0, ge=0, le=1_000_000)
target_available: int = Field(0, ge=0, le=1_000_000)
target_allocatable: int = Field(0, ge=0, le=1_000_000)
safety_buffer: int = Field(0, ge=0, le=100_000)
enabled: bool = True
class DouyuSupplyTargetOut(BaseModel):
id: int
platform: str
scope: str
commodity_id: str
value_class: str
target_covered: int
target_available: int
target_allocatable: int
safety_buffer: int
enabled: bool
covered: int
available: int
allocatable: int
covered_shortage: int
available_shortage: int
allocatable_shortage: int
needs_replenishment: bool
updated_by: int | None = None
updated_at: datetime | None = None
class PlatformFulfillmentMappingUpsert(BaseModel):
internal_sku_key: str = Field(..., min_length=1, max_length=255)
campaign_key: str = Field(default="douyu-current", min_length=1, max_length=128)