11from datetime import datetime
2- from typing import Any
2+ from typing import Annotated , Any
33
4- from pydantic import ConfigDict , Field , HttpUrl , model_validator
4+ from pydantic import ConfigDict , Field , HttpUrl , PlainSerializer , model_validator
55from typing_extensions import Self
66
77from backend .app .admin .schema .dept import GetDeptDetail
88from backend .app .admin .schema .role import GetRoleWithRelationDetail
99from backend .common .enums import StatusType
10- from backend .common .schema import CustomEmailStr , CustomPhoneNumber , SchemaBase
10+ from backend .common .schema import CustomEmailStr , CustomPhoneNumber , SchemaBase , ser_string
1111
1212
1313class AuthSchemaBase (SchemaBase ):
@@ -40,7 +40,7 @@ class AddOAuth2UserParam(AuthSchemaBase):
4040 password : str | None = Field (None , description = '密码' )
4141 nickname : str | None = Field (None , description = '昵称' )
4242 email : CustomEmailStr | None = Field (None , description = '邮箱' )
43- avatar : HttpUrl | None = Field (None , description = '头像地址' )
43+ avatar : Annotated [ HttpUrl , PlainSerializer ( ser_string )] | None = Field (None , description = '头像地址' )
4444
4545
4646class ResetPasswordParam (SchemaBase ):
@@ -57,7 +57,7 @@ class UserInfoSchemaBase(SchemaBase):
5757 dept_id : int | None = Field (None , description = '部门 ID' )
5858 username : str = Field (description = '用户名' )
5959 nickname : str = Field (description = '昵称' )
60- avatar : HttpUrl | None = Field (None , description = '头像地址' )
60+ avatar : Annotated [ HttpUrl , PlainSerializer ( ser_string )] | None = Field (None , description = '头像地址' )
6161 email : CustomEmailStr | None = Field (None , description = '邮箱' )
6262 phone : CustomPhoneNumber | None = Field (None , description = '手机号' )
6363
0 commit comments