crawler_task_management/model/model.py

28 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
from pydantic import BaseModel, Field
# 定义数据模型
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")
status: int = Field(..., ge=1, le=2, description="状态1-空闲2-使用中")
class AccountDelete(BaseModel):
account_id: str = Field(..., min_length=1, max_length=128, description="账号ID")
app_name: str = Field(..., min_length=1, max_length=128, description="应用名称")
class CrawlerTask(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="账号所在国家")
store_id: str = Field(..., min_length=1, max_length=128, description="应用名称")