2026-02-12 13:54:32 +09:00
|
|
|
import { fetchWithAuth } from './fetchWithAuth';
|
|
|
|
|
|
2026-02-15 10:28:27 +09:00
|
|
|
/** 관심선박 API 응답 아이템 */
|
|
|
|
|
export interface FavoriteShipItem {
|
|
|
|
|
signalSourceCode?: string;
|
|
|
|
|
targetId?: string;
|
|
|
|
|
[key: string]: unknown;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 관심구역 API 응답 아이템 */
|
|
|
|
|
export interface RealmItem {
|
|
|
|
|
[key: string]: unknown;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-12 13:54:32 +09:00
|
|
|
/**
|
|
|
|
|
* 관심선박 목록 조회
|
2026-02-15 10:28:27 +09:00
|
|
|
* @returns {Promise<FavoriteShipItem[]>} 관심선박 목록
|
2026-02-12 13:54:32 +09:00
|
|
|
*/
|
2026-02-15 10:28:27 +09:00
|
|
|
export async function fetchFavoriteShips(): Promise<FavoriteShipItem[]> {
|
2026-02-12 13:54:32 +09:00
|
|
|
const response = await fetchWithAuth('/api/gis/my/dashboard/ship/attention/static/search');
|
|
|
|
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
|
|
|
const result = await response.json();
|
|
|
|
|
return result?.data || [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 관심구역 목록 조회
|
2026-02-15 10:28:27 +09:00
|
|
|
* @returns {Promise<RealmItem[]>} 관심구역 목록
|
2026-02-12 13:54:32 +09:00
|
|
|
*/
|
2026-02-15 10:28:27 +09:00
|
|
|
export async function fetchRealms(): Promise<RealmItem[]> {
|
2026-02-12 13:54:32 +09:00
|
|
|
const response = await fetchWithAuth('/api/gis/sea-relm/manage/show', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
|
|
body: JSON.stringify({}),
|
|
|
|
|
});
|
|
|
|
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
|
|
|
const result = await response.json();
|
|
|
|
|
return result?.seaRelmManageShowDtoList || [];
|
|
|
|
|
}
|