支持fastapi服务
This commit is contained in:
21
api/schemas/base.py
Normal file
21
api/schemas/base.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Base schemas
|
||||
"""
|
||||
|
||||
from typing import Any, Optional
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class BaseResponse(BaseModel):
|
||||
"""Base API response"""
|
||||
success: bool = True
|
||||
message: str = "Success"
|
||||
data: Optional[Any] = None
|
||||
|
||||
|
||||
class ErrorResponse(BaseModel):
|
||||
"""Error response"""
|
||||
success: bool = False
|
||||
message: str
|
||||
error: Optional[str] = None
|
||||
|
||||
Reference in New Issue
Block a user