feat(phase4): SCAT~Rescue 6개 탭 Mock → API 전환 + 하드코딩 제거 #45
@ -54,13 +54,15 @@ interface PredictionDetail {
|
||||
insuranceData: unknown;
|
||||
}>;
|
||||
weather: Array<{
|
||||
weatherDtm: string;
|
||||
windSpd: number | null;
|
||||
windDir: string | null;
|
||||
waveHgt: number | null;
|
||||
currentSpd: number | null;
|
||||
currentDir: string | null;
|
||||
temp: number | null;
|
||||
obsDtm: string;
|
||||
locNm: string;
|
||||
temp: string;
|
||||
weatherDc: string;
|
||||
wind: string;
|
||||
wave: string;
|
||||
humid: string;
|
||||
vis: string;
|
||||
sst: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
@ -244,16 +246,18 @@ export async function getAnalysisDetail(acdntSn: number): Promise<PredictionDeta
|
||||
|
||||
const weatherSql = `
|
||||
SELECT
|
||||
WEATHER_DTM,
|
||||
WIND_SPD,
|
||||
WIND_DIR,
|
||||
WAVE_HGT,
|
||||
CURRENT_SPD,
|
||||
CURRENT_DIR,
|
||||
TEMP
|
||||
OBS_DTM,
|
||||
LOC_NM,
|
||||
TEMP,
|
||||
WEATHER_DC,
|
||||
WIND,
|
||||
WAVE,
|
||||
HUMID,
|
||||
VIS,
|
||||
SST
|
||||
FROM ACDNT_WEATHER
|
||||
WHERE ACDNT_SN = $1
|
||||
ORDER BY WEATHER_DTM ASC
|
||||
ORDER BY OBS_DTM ASC
|
||||
`;
|
||||
const { rows: weatherRows } = await wingPool.query(weatherSql, [acdntSn]);
|
||||
|
||||
@ -288,13 +292,15 @@ export async function getAnalysisDetail(acdntSn: number): Promise<PredictionDeta
|
||||
}));
|
||||
|
||||
const weather = weatherRows.map((w: Record<string, unknown>) => ({
|
||||
weatherDtm: String(w['weather_dtm'] ?? ''),
|
||||
windSpd: w['wind_spd'] != null ? parseFloat(String(w['wind_spd'])) : null,
|
||||
windDir: w['wind_dir'] != null ? String(w['wind_dir']) : null,
|
||||
waveHgt: w['wave_hgt'] != null ? parseFloat(String(w['wave_hgt'])) : null,
|
||||
currentSpd: w['current_spd'] != null ? parseFloat(String(w['current_spd'])) : null,
|
||||
currentDir: w['current_dir'] != null ? String(w['current_dir']) : null,
|
||||
temp: w['temp'] != null ? parseFloat(String(w['temp'])) : null,
|
||||
obsDtm: w['obs_dtm'] ? String(w['obs_dtm']) : '',
|
||||
locNm: String(w['loc_nm'] ?? ''),
|
||||
temp: String(w['temp'] ?? ''),
|
||||
weatherDc: String(w['weather_dc'] ?? ''),
|
||||
wind: String(w['wind'] ?? ''),
|
||||
wave: String(w['wave'] ?? ''),
|
||||
humid: String(w['humid'] ?? ''),
|
||||
vis: String(w['vis'] ?? ''),
|
||||
sst: String(w['sst'] ?? ''),
|
||||
}));
|
||||
|
||||
return {
|
||||
|
||||
@ -54,13 +54,15 @@ export interface PredictionDetail {
|
||||
insuranceData: unknown;
|
||||
}>;
|
||||
weather: Array<{
|
||||
weatherDtm: string;
|
||||
windSpd: number | null;
|
||||
windDir: string | null;
|
||||
waveHgt: number | null;
|
||||
currentSpd: number | null;
|
||||
currentDir: string | null;
|
||||
temp: number | null;
|
||||
obsDtm: string;
|
||||
locNm: string;
|
||||
temp: string;
|
||||
weatherDc: string;
|
||||
wind: string;
|
||||
wave: string;
|
||||
humid: string;
|
||||
vis: string;
|
||||
sst: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user