Files
AILab/bbit_ai/app/models/BaseResponse.py
T
2025-09-05 09:37:47 +08:00

12 lines
332 B
Python

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