-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathabout.py
More file actions
36 lines (31 loc) · 1008 Bytes
/
about.py
File metadata and controls
36 lines (31 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from fastapi import APIRouter
from typing import Dict, Any
from app.core.config import settings
from app.module.shared.schema import StandardResponse
from ..schema import ConfigResponse, HealthResponse
router = APIRouter()
@router.get("/health", response_model=StandardResponse[HealthResponse])
async def health_check():
"""健康检查端点"""
return StandardResponse(
code=200,
message="success",
data=HealthResponse(
status="healthy",
service="Label Studio Adapter",
version=settings.app_version
)
)
@router.get("/config", response_model=StandardResponse[ConfigResponse])
async def get_config():
"""获取配置信息"""
return StandardResponse(
code=200,
message="success",
data=ConfigResponse(
app_name=settings.app_name,
version=settings.app_version,
label_studio_url=settings.label_studio_base_url,
debug=settings.debug
)
)