22 lines
466 B
Python
22 lines
466 B
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, EmailStr, Field
|
|
|
|
|
|
class CredentialsSchema(BaseModel):
|
|
username: str = Field(..., description="用户名称", example="admin")
|
|
password: str = Field(..., description="密码", example="123456")
|
|
|
|
|
|
class JWTOut(BaseModel):
|
|
access_token: str
|
|
username: str
|
|
|
|
|
|
class JWTPayload(BaseModel):
|
|
user_id: int
|
|
username: str
|
|
is_superuser: bool
|
|
exp: datetime
|