from typing import Literal, Optional from pydantic import BaseModel, Field class UserProfileResponse(BaseModel): id: str phone: str email: Optional[str] = None nickname: str avatar_url: Optional[str] = None subscription_type: str created_at: str birth_year: Optional[int] = None birth_place: Optional[str] = None grew_up_place: Optional[str] = None occupation: Optional[str] = None class UpdateUserProfileRequest(BaseModel): birth_year: Optional[int] = None birth_place: Optional[str] = None grew_up_place: Optional[str] = None occupation: Optional[str] = None class TestSubscriptionRequest(BaseModel): action: Literal["activate", "deactivate"] plan_id: Optional[str] = "pro" class TestSubscriptionResponse(BaseModel): success: bool message: str subscription_type: str class SubmitFeedbackRequest(BaseModel): """提交反馈请求""" content: str = Field(..., min_length=1, max_length=2000, description="反馈内容") contact: Optional[str] = Field(None, max_length=100, description="联系方式(可选)") class FeedbackResponse(BaseModel): """反馈响应""" id: str message: str # 与前端约定:请求体必须携带该固定口令,防止误触清空。 PURGE_USER_DATA_CONFIRMATION = "我确认永久删除我的全部回忆与对话数据" class PurgeUserDataRequest(BaseModel): """清空账号下全部业务数据(保留登录账号与手机号等;并清空出生年/出生地等档案字段)。""" confirmation: str = Field( ..., min_length=1, description=f"必须为「{PURGE_USER_DATA_CONFIRMATION}」", ) class PurgeUserDataResponse(BaseModel): success: bool message: str