① 在 project_name-feign-api定义远程接口
板块名+路径
package com....;
import ..
@FeignClient("板块名")
public interface IWemediaClient {
@GetMapping("路径")
public ResponseResult getChannels();
}
② 在 被调用的(板块名) 端提供接口
controller层
package ..
import ..
@RestController
public class WemediaClient implements IWemediaClient {
@Autowired
private WmChannelService wmChannelService;
@GetMapping("路径")
@Override
public ResponseResult getChannels() {
return wmChannelService.findAll();
}
}