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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 定义数据模型
|
|
|
|
|
|
class AccountCreate(BaseModel):
|
|
|
|
|
|
account_id: str = Field(..., min_length=1, max_length=128, description="账号ID")
|
|
|
|
|
|
password: str = Field(..., min_length=1, max_length=128, description="密码")
|
|
|
|
|
|
country: str = Field(..., min_length=1, max_length=128, description="账号所在国家")
|
|
|
|
|
|
app_name: str = Field(..., min_length=1, max_length=128, description="应用名称")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AccountUpdate(BaseModel):
|
|
|
|
|
|
account_id: str = Field(..., description="账号ID")
|
2025-11-26 18:06:19 +08:00
|
|
|
|
app_name: str = Field(..., min_length=1, max_length=128, description="应用名称")
|
2025-11-27 10:44:09 +08:00
|
|
|
|
status: int = Field(..., ge=1, le=3, description="状态:1-空闲,2-使用中,3-暂停使用")
|
2025-11-26 18:06:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-11-26 17:40:11 +08:00
|
|
|
|
class CrawlerTask(BaseModel):
|
|
|
|
|
|
country: str = Field(..., min_length=1, max_length=128, description="账号所在国家")
|
|
|
|
|
|
app_name: str = Field(..., min_length=1, max_length=128, description="应用名称")
|
2025-11-26 18:56:26 +08:00
|
|
|
|
goods_id: str = Field(..., min_length=1, max_length=128, description="商品ID")
|
|
|
|
|
|
store_id: str = Field(..., min_length=1, max_length=128, description="店铺ID")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DataReceive(BaseModel):
|
|
|
|
|
|
task_id: str = Field(..., description="任务ID")
|
|
|
|
|
|
app_name: str = Field(..., description="应用名称")
|
|
|
|
|
|
store_id: str = Field(..., description="店铺ID")
|
|
|
|
|
|
goods_id: str = Field(..., description="商品ID")
|
|
|
|
|
|
country: str = Field(..., description="国家")
|
|
|
|
|
|
goods_info: Dict[str, Any] = Field(..., description="商品信息")
|
2025-11-27 10:20:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DeviceResetData(BaseModel):
|
|
|
|
|
|
device_id: str = Field(..., description="设备ID")
|