malgleam/mid_term

중기예보 조회서비스 (MidFcstInfoService). 중기전망, 중기육상예보, 중기기온, 중기해상예보 4개 엔드포인트를 제공한다.

Types

중기육상예보 일별 데이터. days 4~7은 AM/PM(rain_am/pm, weather_am/pm) 사용, days 8~10은 하루 단위(rain, weather) 사용. 18:00 발표 시 day 4 데이터는 기본값(0/빈문자열)이 될 수 있다.

pub type LandDayForecast {
  LandDayForecast(
    day: Int,
    rain_am: option.Option(Int),
    rain_pm: option.Option(Int),
    rain: option.Option(Int),
    weather_am: option.Option(weather.MidWeather),
    weather_pm: option.Option(weather.MidWeather),
    weather: option.Option(weather.MidWeather),
  )
}

Constructors

중기육상예보.

pub type MidLandForecast {
  MidLandForecast(reg_id: String, days: List(LandDayForecast))
}

Constructors

중기전망 (텍스트 예보).

pub type MidOutlook {
  MidOutlook(forecast_text: String)
}

Constructors

  • MidOutlook(forecast_text: String)

중기해상예보.

pub type MidSeaForecast {
  MidSeaForecast(reg_id: String, days: List(SeaDayForecast))
}

Constructors

중기기온예보.

pub type MidTempForecast {
  MidTempForecast(reg_id: String, days: List(TempDayForecast))
}

Constructors

중기해상예보 일별 데이터. days 4~7은 AM/PM, days 8~10은 하루 단위. 파고 단위: m.

pub type SeaDayForecast {
  SeaDayForecast(
    day: Int,
    weather_am: option.Option(weather.MidWeather),
    weather_pm: option.Option(weather.MidWeather),
    weather: option.Option(weather.MidWeather),
    wave_min_am: option.Option(Float),
    wave_max_am: option.Option(Float),
    wave_min_pm: option.Option(Float),
    wave_max_pm: option.Option(Float),
    wave_min: option.Option(Float),
    wave_max: option.Option(Float),
  )
}

Constructors

중기기온예보 일별 데이터. 최저/최고기온과 각각의 예측 범위(low~high)를 포함한다 (단위: ℃).

pub type TempDayForecast {
  TempDayForecast(
    day: Int,
    min_temp: Int,
    min_temp_low: Int,
    min_temp_high: Int,
    max_temp: Int,
    max_temp_low: Int,
    max_temp_high: Int,
  )
}

Constructors

  • TempDayForecast(
      day: Int,
      min_temp: Int,
      min_temp_low: Int,
      min_temp_high: Int,
      max_temp: Int,
      max_temp_low: Int,
      max_temp_high: Int,
    )

    Arguments

    min_temp

    최저기온 (℃)

    min_temp_low

    최저기온 하한 (℃)

    min_temp_high

    최저기온 상한 (℃)

    max_temp

    최고기온 (℃)

    max_temp_low

    최고기온 하한 (℃)

    max_temp_high

    최고기온 상한 (℃)

Values

pub fn decode_mid_fcst(
  response: response.Response(String),
) -> Result(MidOutlook, error.ApiError)

중기전망 응답을 디코딩한다.

pub fn decode_mid_land_fcst(
  response: response.Response(String),
) -> Result(MidLandForecast, error.ApiError)

중기육상예보 응답을 디코딩한다.

pub fn decode_mid_sea_fcst(
  response: response.Response(String),
) -> Result(MidSeaForecast, error.ApiError)

중기해상예보 응답을 디코딩한다.

pub fn decode_mid_ta(
  response: response.Response(String),
) -> Result(MidTempForecast, error.ApiError)

중기기온 응답을 디코딩한다.

pub fn mid_fcst(
  service_key key: String,
  station station: region.StationId,
  forecast_time tm_fc: String,
) -> request.Request(String)

중기전망조회 요청을 생성한다. forecast_time 형식: “YYYYMMDDhhmm” (예: “202401010600”). 06:00 또는 18:00만 유효.

pub fn mid_land_fcst(
  service_key key: String,
  region reg: region.LandRegionId,
  forecast_time tm_fc: String,
) -> request.Request(String)

중기육상예보조회 요청을 생성한다. forecast_time 형식: “YYYYMMDDhhmm”. 06:00 발표는 4일차 포함, 18:00은 5일차부터.

pub fn mid_sea_fcst(
  service_key key: String,
  region reg: region.SeaRegionId,
  forecast_time tm_fc: String,
) -> request.Request(String)

중기해상예보조회 요청을 생성한다.

pub fn mid_ta(
  service_key key: String,
  region reg: region.TempRegionId,
  forecast_time tm_fc: String,
) -> request.Request(String)

중기기온조회 요청을 생성한다.

pub fn with_page(
  req: request.Request(String),
  page: Int,
) -> request.Request(String)

페이지 번호를 설정한다 (기본값: 1).

pub fn with_rows(
  req: request.Request(String),
  rows: Int,
) -> request.Request(String)

한 페이지 결과 수를 설정한다 (기본값: 10).

Search Document