feat: implement AI city forecasting and market scan hooks with backend API integration for the scan terminal dashboard

This commit is contained in:
2569718930@qq.com
2026-04-26 11:28:36 +08:00
parent 9b77a3a0e2
commit f39f59f47a
5 changed files with 11 additions and 810 deletions
@@ -34,7 +34,7 @@ import type {
} from "@/lib/dashboard-types";
import {
buildBrowserBackendHeaders,
resolveBackendApiUrl,
fetchBackendApi,
} from "@/lib/backend-api";
import { getLocalizedCityName } from "@/lib/dashboard-home-copy";
import { AiPinnedForecastView } from "@/components/dashboard/scan-terminal/AiPinnedForecastView";
@@ -249,7 +249,7 @@ function ScanTerminalScreen() {
})
.then((headers) => {
if (cancelled) return null;
return fetch(resolveBackendApiUrl(`/api/scan/terminal?${params.toString()}`), {
return fetchBackendApi(`/api/scan/terminal?${params.toString()}`, {
cache: "no-store",
headers,
signal: controller.signal,
@@ -8,7 +8,7 @@ import type {
import { useDashboardStore } from "@/hooks/useDashboardStore";
import {
buildBrowserBackendHeaders,
resolveBackendApiUrl,
fetchBackendApi,
} from "@/lib/backend-api";
import type { CityDetail, MarketScan } from "@/lib/dashboard-types";
import { normalizeCityKey } from "./decision-utils";
@@ -192,7 +192,7 @@ export function useAiCityForecast({
})
.then((headers) => {
if (cancelled) return null;
return fetch(resolveBackendApiUrl("/api/scan/terminal/ai-city"), {
return fetchBackendApi("/api/scan/terminal/ai-city", {
method: "POST",
headers,
cache: "no-store",