This version of Antigravity is no longer supported. Please upgrade to receive the latest features.

This commit is contained in:
2569718930@qq.com
2026-05-01 11:37:09 +08:00
parent 6c203bee60
commit 118d4e44df
4 changed files with 25 additions and 4 deletions
@@ -37,6 +37,15 @@ export function countDetailForecastDays(detail?: CityDetail | null) {
export function isFullEnoughForDeepAnalysis(detail?: CityDetail | null) {
if (!detail) return false;
if (detail.detail_depth && detail.detail_depth !== "full") return false;
const hourlyTimes = Array.isArray(detail.hourly?.times)
? detail.hourly?.times || []
: [];
const hourlyTemps = Array.isArray(detail.hourly?.temps)
? detail.hourly?.temps || []
: [];
if (!detail.local_time || hourlyTimes.length === 0 || hourlyTemps.length === 0) {
return false;
}
return (
countDetailModels(detail, detail.local_date) > 1 &&
countDetailForecastDays(detail) > 1
@@ -49,6 +49,7 @@ type TerminalQueryOptions = {
};
type CityDetailQueryOptions = {
depth?: "panel" | "market" | "nearby" | "full";
forceRefresh?: boolean;
marketSlug?: string | null;
signal?: AbortSignal;
@@ -273,6 +274,7 @@ async function getTerminal({
async function getCityDetail(city: string, options: CityDetailQueryOptions = {}) {
const params = new URLSearchParams({
depth: options.depth || "full",
force_refresh: String(options.forceRefresh ?? false),
});
if (options.marketSlug) params.set("market_slug", options.marketSlug);