这里是项目product
ProductService.java
public class ServiceController {
//test
@GetMapping("/msg")
public String getMsg() {
return "这是product里面得接口";
}
}
-----------------------------------------------
这里是项目feign
ProductClient.java(interface)
@FeignClient(name = "product")
public interface ProductClient {
@Bean
@GetMapping("/msg")
public String getMsg();
}
------------------------
ClientController.java
@RestController
public class ClientController {
@Autowired
private ProductClient productClient;
@GetMapping("/getMessage")
public String getMag() {
return productClient.getMsg();
}
}
添加回答
举报
0/150
提交
取消