package shop.alien.api.feign;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 调用气象局接口
 *
 * @author ssk
 * @version 1.0
 * @date 2024/10/25 10:56
 */
@FeignClient(url = "https://weather.cma.cn/api", name = "weatherBureau")
public interface WeatherBureauFeign {

    /**
     * 中国气象局-气象预警
     * https://weather.cma.cn/web/alarm/map.html
     *
     * @param adcode 区域code,省市code前两位
     * @return JSONObject
     */
    @GetMapping("/map/alarm")
    JSONObject weatherAlarm(@RequestParam(value = "adcode") String adcode);

}
