Optimize terminal detail loading and Redis replay

This commit is contained in:
2569718930@qq.com
2026-05-31 04:32:48 +08:00
parent 2a6d8748f4
commit 46effcd45f
16 changed files with 948 additions and 80 deletions
+22
View File
@@ -5,6 +5,7 @@ from typing import Any, Dict, List, Optional
from fastapi import APIRouter, BackgroundTasks, Query, Request
from web.services.city_api import (
get_city_detail_batch_payload,
get_city_detail_aggregate_payload,
get_city_detail_payload,
get_city_summary_payload,
@@ -104,6 +105,27 @@ async def cities_model_range(
return {"cities": rows}
@router.get("/api/cities/detail-batch")
async def city_detail_batch(
request: Request,
cities: str = "",
force_refresh: bool = False,
market_slug: Optional[str] = None,
target_date: Optional[str] = None,
resolution: Optional[str] = "10m",
limit: int = 12,
):
return await get_city_detail_batch_payload(
request,
cities=cities,
force_refresh=force_refresh,
market_slug=market_slug,
target_date=target_date,
resolution=resolution,
limit=limit,
)
@router.get("/api/city/{name}")
async def city_detail(
request: Request,