You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
516 B
31 lines
516 B
"""
|
|
认证相关Schema
|
|
"""
|
|
from datetime import datetime
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class UserLogin(BaseModel):
|
|
"""用户登录请求"""
|
|
username: str
|
|
password: str
|
|
|
|
|
|
class UserInfo(BaseModel):
|
|
"""用户信息"""
|
|
id: int
|
|
username: str
|
|
is_active: bool
|
|
is_superuser: bool
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class TokenResponse(BaseModel):
|
|
"""Token响应"""
|
|
access_token: str
|
|
token_type: str = "bearer"
|
|
expires_in: int
|