Add market detail depth caching for dashboard data

This commit is contained in:
2569718930@qq.com
2026-04-14 12:03:37 +08:00
parent baaccc6636
commit 2e2c55d77a
5 changed files with 126 additions and 10 deletions
+3 -2
View File
@@ -29,9 +29,10 @@ function normalizeCityName(cityName: string) {
return encodeURIComponent(String(cityName).replace(/\s/g, "-"));
}
function normalizeDetailDepth(depth?: "panel" | "nearby" | "full") {
function normalizeDetailDepth(depth?: "panel" | "market" | "nearby" | "full") {
if (depth === "full") return "full";
if (depth === "nearby") return "nearby";
if (depth === "market") return "market";
return "panel";
}
@@ -163,7 +164,7 @@ export const dashboardClient = {
async getCityDetail(
cityName: string,
options?: { force?: boolean; depth?: "panel" | "nearby" | "full" },
options?: { force?: boolean; depth?: "panel" | "market" | "nearby" | "full" },
) {
const force = options?.force ?? false;
const depth = normalizeDetailDepth(options?.depth);
+1 -1
View File
@@ -327,7 +327,7 @@ export interface AiAnalysisStructured {
export interface CityDetail {
name: string;
display_name: string;
detail_depth?: "panel" | "nearby" | "full";
detail_depth?: "panel" | "market" | "nearby" | "full";
lat: number;
lon: number;
temp_symbol: string;