You've already forked DataMate
Develop py update schema (#37)
* feature: implement endpoints with multi-level response models * refactor: move `/health` and `/config` endpoints to system module, remove example from base schemas * refactor: remove unused get_standard_response_model()
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
from .config import ConfigResponse
|
||||
from .health import HealthResponse
|
||||
|
||||
__all__ = ["ConfigResponse", "HealthResponse"]
|
||||
11
runtime/datamate-python/app/module/system/schema/config.py
Normal file
11
runtime/datamate-python/app/module/system/schema/config.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from pydantic import Field
|
||||
|
||||
from app.module.shared.schema import BaseResponseModel
|
||||
from app.module.shared.schema import StandardResponse
|
||||
|
||||
class ConfigResponse(BaseResponseModel):
|
||||
"""配置信息响应模型"""
|
||||
app_name: str = Field(..., description="应用名称")
|
||||
version: str = Field(..., description="应用版本")
|
||||
label_studio_url: str = Field(..., description="Label Studio基础URL")
|
||||
debug: bool = Field(..., description="调试模式状态")
|
||||
10
runtime/datamate-python/app/module/system/schema/health.py
Normal file
10
runtime/datamate-python/app/module/system/schema/health.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from pydantic import Field
|
||||
|
||||
from app.module.shared.schema import BaseResponseModel
|
||||
from app.module.shared.schema import StandardResponse
|
||||
|
||||
class HealthResponse(BaseResponseModel):
|
||||
"""健康检查响应模型"""
|
||||
status: str = Field(..., description="服务状态")
|
||||
service: str = Field(..., description="服务名称")
|
||||
version: str = Field(..., description="应用版本")
|
||||
Reference in New Issue
Block a user