Files
findreve/model/response.py

26 lines
501 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from pydantic import BaseModel
from model.base import SQLModelBase
"""
[TODO] 弃用,改成 ResponseBase
class ResponseBase(BaseModel):
code: int = 0
msg: str = ""
request_id: UUID
再根据需要继承
"""
class DefaultResponse(BaseModel):
code: int = 0
data: dict | list | bool | SQLModelBase | None = None
msg: str = ""
# FastAPI 鉴权返回模型
class TokenResponse(BaseModel):
access_token: str
class TokenData(BaseModel):
username: str | None = None