13 lines
318 B
Python
13 lines
318 B
Python
from fastapi import FastAPI
|
|
from pydantic import BaseModel
|
|
from typing import Generic, TypeVar, Optional, List
|
|
from pydantic import BaseModel
|
|
|
|
T = TypeVar("T")
|
|
|
|
# 定义通用响应结构
|
|
class BaseResponse(BaseModel, Generic[T]):
|
|
status: bool = True
|
|
message: str = "操作成功"
|
|
data: Optional[T] = None
|