|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
别的就不秀了,直接上核心
- package com.example.weather;
- import org.springframework.cloud.openfeign.FeignClient;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- @FeignClient(name = "weatherClient", url = "https://api.openweathermap.org/data/2.5")
- public interface WeatherClient {
- @GetMapping("/weather")
- WeatherResponse getWeather(@RequestParam("q") String city,
- @RequestParam("appid") String apiKey);
- }
复制代码
请各位大佬,斧正!
|
|