发布网友 发布时间:2022-04-23 07:43
共1个回答
热心网友 时间:2022-06-10 10:44
比如有一个服务如下
@EnableEurekaClient这个服务名为:EurekaClient
----------------------------------------------------------------------------------------------
调用采用以下方式:
定义一个借口,注解@FeignClient(value = "EUREKACLIENT")
@RestController
public class HiController {
@Autowired
SchealServiceHi schealServiceHi;
@RequestMapping(value = "/hi",method = RequestMethod.GET)
public String sayHi(@RequestParam String name){
return schealServiceHi.sayHiFromClientOne(name);
}
}