claude_sms_test
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# schemas/advisor_schema.py
|
||||
# 顾问信息模块的 Pydantic 模式
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class AdvisorBase(BaseModel):
|
||||
"""顾问公共字段"""
|
||||
name: str = Field(..., max_length=20, description="姓名")
|
||||
phone: str = Field(..., max_length=20, description="电话")
|
||||
|
||||
|
||||
class AdvisorCreate(AdvisorBase):
|
||||
"""新增顾问时,id 必填"""
|
||||
id: str = Field(..., max_length=15, description="顾问编号(主键)")
|
||||
|
||||
|
||||
class AdvisorUpdate(BaseModel):
|
||||
"""更新顾问信息:仅更新传入的字段"""
|
||||
name: Optional[str] = Field(default=None, max_length=20, description="姓名")
|
||||
phone: Optional[str] = Field(default=None, max_length=20, description="电话")
|
||||
|
||||
|
||||
class AdvisorOut(AdvisorBase):
|
||||
"""顾问响应模型(含 id 与软删除标记)"""
|
||||
id: str
|
||||
is_deleted: int
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
Reference in New Issue
Block a user