33from datetime import datetime
44from typing import Any
55
6- from pydantic import ConfigDict , EmailStr , Field , HttpUrl , model_validator
6+ from pydantic import ConfigDict , Field , HttpUrl , model_validator
77from typing_extensions import Self
88
99from backend .app .admin .schema .dept import GetDeptDetail
@@ -16,7 +16,7 @@ class AuthSchemaBase(SchemaBase):
1616 """用户认证基础模型"""
1717
1818 username : str = Field (description = '用户名' )
19- password : str | None = Field (description = '密码' )
19+ password : str = Field (description = '密码' )
2020
2121
2222class AuthLoginParam (AuthSchemaBase ):
@@ -28,16 +28,19 @@ class AuthLoginParam(AuthSchemaBase):
2828class AddUserParam (AuthSchemaBase ):
2929 """添加用户参数"""
3030
31+ nickname : str | None = Field (None , description = '昵称' )
32+ email : CustomEmailStr | None = Field (None , description = '邮箱' )
33+ phone : CustomPhoneNumber | None = Field (None , description = '手机号码' )
3134 dept_id : int = Field (description = '部门 ID' )
3235 roles : list [int ] = Field (description = '角色 ID 列表' )
33- nickname : str | None = Field (None , description = '昵称' )
3436
3537
3638class AddOAuth2UserParam (AuthSchemaBase ):
3739 """添加 OAuth2 用户参数"""
3840
41+ password : str | None = Field (None , description = '密码' )
3942 nickname : str | None = Field (None , description = '昵称' )
40- email : EmailStr = Field (description = '邮箱' )
43+ email : CustomEmailStr | None = Field (None , description = '邮箱' )
4144 avatar : HttpUrl | None = Field (None , description = '头像地址' )
4245
4346
@@ -56,6 +59,8 @@ class UserInfoSchemaBase(SchemaBase):
5659 username : str = Field (description = '用户名' )
5760 nickname : str = Field (description = '昵称' )
5861 avatar : HttpUrl | None = Field (None , description = '头像地址' )
62+ email : CustomEmailStr | None = Field (None , description = '邮箱' )
63+ phone : CustomPhoneNumber | None = Field (None , description = '手机号' )
5964
6065
6166class UpdateUserParam (UserInfoSchemaBase ):
@@ -72,8 +77,6 @@ class GetUserInfoDetail(UserInfoSchemaBase):
7277 dept_id : int | None = Field (None , description = '部门 ID' )
7378 id : int = Field (description = '用户 ID' )
7479 uuid : str = Field (description = '用户 UUID' )
75- email : CustomEmailStr | None = Field (None , description = '邮箱' )
76- phone : CustomPhoneNumber | None = Field (None , description = '手机号' )
7780 status : StatusType = Field (description = '状态' )
7881 is_superuser : bool = Field (description = '是否超级管理员' )
7982 is_staff : bool = Field (description = '是否管理员' )
0 commit comments