Files
AILab/bbit_ai/app/models/BaseResponse.py
T
2025-09-18 17:18:18 +08:00

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