项目初次搭建
This commit is contained in:
43
app/model/schemas/sys_user_schemas.py
Normal file
43
app/model/schemas/sys_user_schemas.py
Normal file
@ -0,0 +1,43 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
|
||||
|
||||
# 用户相关的原型
|
||||
class SysUserIN(BaseModel):
|
||||
username: Optional[str] = Field(..., description="用户名", max_length=50)
|
||||
password: Optional[str] = Field(..., description="密码", max_length=30, min_length=6)
|
||||
dept_id: Optional[str] = Field(None, description="部门id")
|
||||
login_name: Optional[str] = Field(None, description="昵称", max_length=20)
|
||||
|
||||
|
||||
class SysUserLogin(BaseModel):
|
||||
username: Optional[str] = Field(..., description="用户名", max_length=50)
|
||||
password: Optional[str] = Field(..., description="密码", max_length=30, min_length=6)
|
||||
|
||||
|
||||
class SysUserOut(BaseModel):
|
||||
id: Optional[int] = Field(..., description="id")
|
||||
username: Optional[str] = Field(..., description="用户名")
|
||||
dept_id: Optional[str] = Field(None, description="部门id")
|
||||
dept_name: Optional[str] = Field(None, description="部门名称")
|
||||
login_name: Optional[str] = Field(None, description="昵称")
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class SysUserUpdatePw(BaseModel):
|
||||
id: Optional[int] = Field(..., description="id")
|
||||
new_password: Optional[str] = Field(..., description="新密码", max_length=30, min_length=8)
|
||||
original_password: Optional[str] = Field(..., description="旧密码", max_length=30, min_length=8)
|
||||
|
||||
|
||||
class SysUserPager(BaseModel):
|
||||
username: Optional[str] = Field(None, description="用户名")
|
||||
dept_id: Optional[str] = Field(None, description="部门id")
|
||||
login_name: Optional[str] = Field(None, description="昵称")
|
||||
pagerNum: Optional[int] = Field(1, description="当前页码")
|
||||
pagerSize: Optional[int] = Field(10, description="每页数量")
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
Reference in New Issue
Block a user