feat: Implement PolyWeather web map API backend and integrate new frontend dashboard components for city weather details.

This commit is contained in:
2569718930@qq.com
2026-03-11 11:37:07 +08:00
parent 23e2959404
commit 025feaa96e
7 changed files with 142 additions and 42 deletions
+15 -2
View File
@@ -164,12 +164,19 @@ export const dashboardClient = {
async getCityMarketScan(
cityName: string,
options?: { force?: boolean; marketSlug?: string | null },
options?: {
force?: boolean;
marketSlug?: string | null;
targetDate?: string | null;
},
) {
const force = options?.force ?? false;
const marketSlug = options?.marketSlug || null;
const targetDate = options?.targetDate || null;
if (!force) {
const requestKey = `${cityName}::cached::${marketSlug || "-"}`;
const requestKey = `${cityName}::cached::${marketSlug || "-"}::${
targetDate || "-"
}`;
const existing = pendingMarketScanRequests.get(requestKey);
if (existing) {
return existing;
@@ -181,6 +188,9 @@ export const dashboardClient = {
if (marketSlug) {
params.set("market_slug", marketSlug);
}
if (targetDate) {
params.set("target_date", targetDate);
}
const request = fetchJson<{ market_scan?: MarketScan }>(
`/api/city/${normalizeCityName(cityName)}/detail?${params.toString()}`,
@@ -201,6 +211,9 @@ export const dashboardClient = {
if (marketSlug) {
params.set("market_slug", marketSlug);
}
if (targetDate) {
params.set("target_date", targetDate);
}
return fetchJson<{ market_scan?: MarketScan }>(
`/api/city/${normalizeCityName(cityName)}/detail?${params.toString()}`,