Spaces:
Sleeping
Sleeping
| from pydantic import BaseModel, Field | |
| from datetime import datetime | |
| from typing import Optional, List | |
| class ContactBase(BaseModel): | |
| contact_name: str = Field(..., description="联系人姓名") | |
| phone: str = Field(..., description="联系电话") | |
| email: str = Field(..., description="电子邮箱") | |
| position: Optional[str] = Field(None, description="职位") | |
| department: Optional[str] = Field(None, description="部门") | |
| facebook: Optional[str] = Field(None, description="Facebook账号") | |
| facebook_api_key: Optional[str] = Field(None, description="Facebook API Key") | |
| facebook_app_secret: Optional[str] = Field(None, description="Facebook App Secret") | |
| tiktok: Optional[str] = Field(None, description="TikTok账号") | |
| tiktok_api_key: Optional[str] = Field(None, description="TikTok API Key") | |
| tiktok_app_secret: Optional[str] = Field(None, description="TikTok App Secret") | |
| whatsapp: Optional[str] = Field(None, description="WhatsApp账号") | |
| whatsapp_api_key: Optional[str] = Field(None, description="WhatsApp API Key") | |
| whatsapp_app_secret: Optional[str] = Field(None, description="WhatsApp App Secret") | |
| wechat: Optional[str] = Field(None, description="微信账号") | |
| linkedin: Optional[str] = Field(None, description="LinkedIn账号") | |
| note: Optional[str] = Field(None, description="备注") | |
| class ContactCreate(ContactBase): | |
| pass | |
| class ContactUpdate(ContactBase): | |
| contact_name: Optional[str] = Field(None, description="联系人姓名") | |
| phone: Optional[str] = Field(None, description="联系电话") | |
| email: Optional[str] = Field(None, description="电子邮箱") | |
| facebook: Optional[str] = Field(None, description="Facebook账号") | |
| facebook_api_key: Optional[str] = Field(None, description="Facebook API Key") | |
| facebook_app_secret: Optional[str] = Field(None, description="Facebook App Secret") | |
| tiktok: Optional[str] = Field(None, description="TikTok账号") | |
| tiktok_api_key: Optional[str] = Field(None, description="TikTok API Key") | |
| tiktok_app_secret: Optional[str] = Field(None, description="TikTok App Secret") | |
| whatsapp: Optional[str] = Field(None, description="WhatsApp账号") | |
| whatsapp_api_key: Optional[str] = Field(None, description="WhatsApp API Key") | |
| whatsapp_app_secret: Optional[str] = Field(None, description="WhatsApp App Secret") | |
| class ContactResponse(ContactBase): | |
| id: int | |
| company_code: str | |
| created_at: datetime | |
| updated_at: Optional[datetime] | |
| class Config: | |
| from_attributes = True | |