feat: 添加用户资料中的邮箱和地址字段,并更新相关接口和页面

This commit is contained in:
2026-05-29 01:59:05 +08:00
parent 201f80811a
commit a8409ad76b
6 changed files with 111 additions and 42 deletions

View File

@@ -21,6 +21,8 @@ class User(Document):
name: str = ""
phone: Optional[str] = None
age: Optional[int] = None
email: str = ""
address: str = ""
height: Optional[float] = None # cm
pre_pregnancy_weight: Optional[float] = None # kg
current_weight: Optional[float] = None # kg

View File

@@ -18,6 +18,8 @@ def _user_to_response(user: User) -> UserProfileResponse:
id=str(user.id),
name=user.name,
phone=user.phone,
email=user.email,
address=user.address,
age=user.age,
height=user.height,
pre_pregnancy_weight=user.pre_pregnancy_weight,

View File

@@ -14,6 +14,8 @@ class UserProfileUpdate(BaseModel):
name: Optional[str] = None
age: Optional[int] = None
phone: Optional[str] = None
email: Optional[str] = None
address: Optional[str] = None
height: Optional[float] = None
pre_pregnancy_weight: Optional[float] = None
current_weight: Optional[float] = None
@@ -52,6 +54,8 @@ class UserProfileResponse(BaseModel):
id: str
name: str
phone: Optional[str]
email: str = ""
address: str = ""
age: Optional[int]
height: Optional[float]
pre_pregnancy_weight: Optional[float]