返回 Pixelle-Video
health.py
根目录 / api / routers / health.py
1 # Copyright (C) 2025 AIDC-AI
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 # See the License for the specific language governing permissions and
11 # limitations under the License.
12
13 """
14 Health check and system info endpoints
15 """
16
17 from fastapi import APIRouter
18 from pydantic import BaseModel
19
20 router = APIRouter(tags=["Health"])
21
22
23 class HealthResponse(BaseModel):
24 """Health check response"""
25 status: str = "healthy"
26 version: str = "0.1.0"
27 service: str = "Pixelle-Video API"
28
29
30 class CapabilitiesResponse(BaseModel):
31 """Capabilities response"""
32 success: bool = True
33 capabilities: dict
34
35
36 @router.get("/health", response_model=HealthResponse)
37 async def health_check():
38 """
39 Health check endpoint
40
41 Returns service status and version information.
42 """
43 return HealthResponse()
44
45
46 @router.get("/version", response_model=HealthResponse)
47 async def get_version():
48 """
49 Get API version
50
51 Returns version information.
52 """
53 return HealthResponse()
54
55
55 lines PYTHON