This commit is contained in:
1 parent
42008079db
commit
c86ec6a84f
10 files changed
+660
-47
No files matched your search
@@ -21,6 +21,7 @@ from .files import (
|
||||
create_folder_zip,
|
||||
create_batch_zip
|
||||
)
|
||||
from .weather import get_weather_forecast
|
||||
|
||||
app = FastAPI(title="Transmission Magnet Manager API", version="1.0.0")
|
||||
|
||||
@@ -62,6 +63,26 @@ async def check_status():
|
||||
}
|
||||
)
|
||||
|
||||
@app.get("/api/weather", response_model=ApiResponse)
|
||||
async def get_weather(
|
||||
lat: float = Query(default=37.5665, description="위도"),
|
||||
lon: float = Query(default=126.9780, description="경도")
|
||||
):
|
||||
"""현재 날씨 및 7일간 주간 날씨 예보 조회"""
|
||||
try:
|
||||
data = await get_weather_forecast(lat=lat, lon=lon)
|
||||
return ApiResponse(
|
||||
success=True,
|
||||
message="날씨 정보를 성공적으로 가져왔습니다.",
|
||||
data=data
|
||||
)
|
||||
except Exception as e:
|
||||
return ApiResponse(
|
||||
success=False,
|
||||
message=f"날씨 정보를 가져오는 데 실패했습니다: {str(e)}",
|
||||
data=None
|
||||
)
|
||||
|
||||
@app.post("/api/torrents/add", response_model=ApiResponse)
|
||||
async def add_magnet(req: AddMagnetRequest):
|
||||
"""마그넷 또는 토렌트 URL 추가"""
|
||||
|
||||
Reference in new issue
Block a user