wing-ops/frontend/src/tabs/hns/services/hnsApi.ts
htlee ff085252b0 feat(phase4): Board/HNS/Prediction/Aerial/Rescue Mock → API 전환
- Board: 매뉴얼 CRUD + 첨부파일 API (012_board_ext.sql)
- HNS: 분석 CRUD 5개 API (013_hns_analysis.sql)
- Prediction: 분석/역추적/오일펜스 7개 API (014_prediction.sql)
- Aerial: 미디어/CCTV/위성 6개 API + PostGIS (015_aerial.sql)
- Rescue: 구난 작전/시나리오 3개 API + JSONB (016_rescue.sql)
- backtrackMockData.ts 삭제

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 01:17:10 +09:00

71 lines
1.8 KiB
TypeScript

import { api } from '@common/services/api';
// ============================================================
// HNS 분석 API
// ============================================================
export interface HnsAnalysisItem {
hnsAnlysSn: number;
anlysNm: string;
acdntDtm: string | null;
locNm: string | null;
lon: number | null;
lat: number | null;
sbstNm: string | null;
spilQty: number | null;
spilUnitCd: string | null;
fcstHr: number | null;
algoCd: string | null;
critMdlCd: string | null;
windSpd: number | null;
windDir: string | null;
execSttsCd: string;
riskCd: string | null;
analystNm: string | null;
rsltData: Record<string, unknown> | null;
regDtm: string;
}
export interface CreateHnsAnalysisInput {
anlysNm: string;
acdntDtm?: string;
locNm?: string;
lon?: number;
lat?: number;
sbstNm?: string;
spilQty?: number;
spilUnitCd?: string;
fcstHr?: number;
algoCd?: string;
critMdlCd?: string;
windSpd?: number;
windDir?: string;
temp?: number;
humid?: number;
atmStblCd?: string;
analystNm?: string;
}
export async function fetchHnsAnalyses(params?: {
status?: string;
substance?: string;
search?: string;
}): Promise<HnsAnalysisItem[]> {
const response = await api.get<HnsAnalysisItem[]>('/hns/analyses', { params });
return response.data;
}
export async function fetchHnsAnalysis(sn: number): Promise<HnsAnalysisItem> {
const response = await api.get<HnsAnalysisItem>(`/hns/analyses/${sn}`);
return response.data;
}
export async function createHnsAnalysis(input: CreateHnsAnalysisInput): Promise<{ hnsAnlysSn: number }> {
const response = await api.post<{ hnsAnlysSn: number }>('/hns/analyses', input);
return response.data;
}
export async function deleteHnsAnalysis(sn: number): Promise<void> {
await api.delete(`/hns/analyses/${sn}`);
}