Merge branch 'main' into feature/screen-management
This commit is contained in:
@@ -15,6 +15,8 @@ import { apiClient } from './client';
|
||||
export interface WeatherData {
|
||||
city: string;
|
||||
country: string;
|
||||
lat?: number;
|
||||
lng?: number;
|
||||
temperature: number;
|
||||
feelsLike: number;
|
||||
humidity: number;
|
||||
@@ -79,6 +81,33 @@ export async function getWeather(
|
||||
return response.data.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 도시의 날씨 정보 일괄 조회
|
||||
* @param cities 도시명 배열
|
||||
*/
|
||||
export async function getMultipleWeather(cities: string[]): Promise<WeatherData[]> {
|
||||
const promises = cities.map(city => getWeather(city));
|
||||
return Promise.all(promises);
|
||||
}
|
||||
|
||||
/**
|
||||
* 기상특보 정보 조회
|
||||
*/
|
||||
export interface WeatherAlert {
|
||||
id: string;
|
||||
type: string;
|
||||
severity: "high" | "medium" | "low";
|
||||
title: string;
|
||||
location: string;
|
||||
description: string;
|
||||
timestamp: string;
|
||||
}
|
||||
|
||||
export async function getWeatherAlerts(): Promise<WeatherAlert[]> {
|
||||
const response = await apiClient.get<WeatherAlert[]>("/risk-alerts/weather");
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 환율 정보 조회
|
||||
* @param base 기준 통화 (기본값: KRW)
|
||||
|
||||
Reference in New Issue
Block a user