41 lines
1.9 KiB
Python
41 lines
1.9 KiB
Python
# -*- coding: utf-8 -*-
|
||
from pydantic import BaseModel, Field
|
||
from typing import Optional, Dict, Any
|
||
|
||
|
||
# 定义数据模型
|
||
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")
|
||
app_name: str = Field(..., min_length=1, max_length=128, description="应用名称")
|
||
status: int = Field(..., ge=1, le=10, description="状态:1-空闲,2-使用中,3-暂停使用(后续还能使用),4-账号已无法使用")
|
||
|
||
|
||
class GoodsInfo(BaseModel):
|
||
country: str = Field(..., min_length=1, max_length=128, description="账号所在国家")
|
||
app_name: str = Field(..., min_length=1, max_length=128, description="应用名称")
|
||
goods_id: str = Field(..., min_length=1, max_length=128, description="商品ID")
|
||
store_id: str = Field(..., min_length=1, max_length=128, description="店铺ID")
|
||
is_re_crawl: str = Field(..., min_length=0, max_length=128, description="是否重新抓取")
|
||
|
||
|
||
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="商品信息")
|
||
|
||
|
||
class DeviceResetData(BaseModel):
|
||
device_id: str = Field(..., description="设备ID")
|
||
country: str = Field(..., description="国家")
|
||
app_name: str = Field(..., description="应用名称")
|