标签:this ring ctf inter interface server tco 通信 根据
------------------客户端controller层---------------------
@RestController
public class ClientFeignController {
@Autowired
private ProductFeignInterface productFeignInterface;
@GetMapping("/msg")
public String msg() {
String msg = productFeignInterface.getMsg();
return msg;
}
}
-----------------客户端feign调用的接口-----------------------
/**
* name:被调用的服务名称
*/
@FeignClient(name = "product")
public interface ProductFeignInterface {
/**
* 根据getMapping匹配接口,与方法名无关
* @return
*/
@GetMapping("/product/getMsg")
public String getMsg();
}
------------------服务端接口-----------------------------------
@RestController
public class ServerController {
@GetMapping("/product/getMsg")
public String msg() {
return "this is product‘ msg 1";
}
}
标签:this ring ctf inter interface server tco 通信 根据
原文地址:https://www.cnblogs.com/yuefeng123/p/9590813.html