2025-11-26 17:40:11 +08:00
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
from pydantic import BaseModel, Field
|
2025-11-26 18:56:26 +08:00
|
|
|
|
from typing import Optional, Dict, Any
|
2025-11-26 17:40:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 定义数据模型
|
2025-12-03 10:28:14 +08:00
|
|
|
|
class AccountStatus(BaseModel):
|
2025-11-28 11:14:38 +08:00
|
|
|
|
account_id: str = Field(..., description="账号ID")
|
|
|
|
|
|
app_name: str = Field(..., description="应用名称")
|
2025-11-26 17:40:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-12-03 14:39:17 +08:00
|
|
|
|
class AccountObtain(BaseModel):
|
|
|
|
|
|
app_name: str = Field(..., description="应用名称")
|
|
|
|
|
|
region: str = Field(..., description="地区")
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-26 17:40:11 +08:00
|
|
|
|
class AccountUpdate(BaseModel):
|
|
|
|
|
|
account_id: str = Field(..., description="账号ID")
|
2025-11-28 11:14:38 +08:00
|
|
|
|
app_name: str = Field(..., description="应用名称")
|
2025-12-03 16:05:28 +08:00
|
|
|
|
status: int = Field(..., description="状态:1-空闲,2-使用中,3-暂停使用(后续还能使用),4-账号已无法使用")
|
2025-11-26 18:06:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-11-27 14:57:57 +08:00
|
|
|
|
class GoodsInfo(BaseModel):
|
2025-11-28 17:13:08 +08:00
|
|
|
|
host: str = Field(..., description="客户所在地区")
|
2025-11-28 11:40:58 +08:00
|
|
|
|
item_id: str = Field(..., description="商品ID")
|
|
|
|
|
|
shop_id: str = Field(..., description="店铺ID")
|
2025-11-26 18:56:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DataReceive(BaseModel):
|
|
|
|
|
|
task_id: str = Field(..., description="任务ID")
|
|
|
|
|
|
app_name: str = Field(..., description="应用名称")
|
2025-12-03 16:35:16 +08:00
|
|
|
|
account_id: str = Field(..., description="使用账号")
|
|
|
|
|
|
pad_code: str = Field(..., description="设备编号")
|
2025-11-28 11:40:58 +08:00
|
|
|
|
shop_id: str = Field(..., description="店铺ID")
|
|
|
|
|
|
item_id: str = Field(..., description="商品ID")
|
2025-11-28 17:13:08 +08:00
|
|
|
|
region: str = Field(..., description="地区")
|
2025-11-26 18:56:26 +08:00
|
|
|
|
goods_info: Dict[str, Any] = Field(..., description="商品信息")
|
2025-11-27 10:20:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-11-29 10:18:38 +08:00
|
|
|
|
class TokenItem(BaseModel):
|
|
|
|
|
|
token: str = Field(..., description="token")
|
2025-11-28 15:08:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CrawlerItem(BaseModel):
|
2025-11-28 17:13:08 +08:00
|
|
|
|
region: str = Field(..., description="账号所在地区")
|
2025-11-28 15:08:58 +08:00
|
|
|
|
app_name: str = Field(..., description="应用名称")
|
2025-11-29 17:42:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ResetTask(BaseModel):
|
|
|
|
|
|
task_id: str = Field(..., description="任务ID")
|
2026-01-08 14:11:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AlterStatus(BaseModel):
|
|
|
|
|
|
pad_code: str = Field(..., description="设备编号")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BackupItem(BaseModel):
|
|
|
|
|
|
pad_code: str = Field(..., description="设备编号")
|
|
|
|
|
|
account_id: str = Field(..., description="账号ID")
|
|
|
|
|
|
script_name: str = Field(..., description="脚本名称")
|
|
|
|
|
|
is_restore: bool = Field(..., description="是否还原")
|