创建接口
package cn.flyrise.pai.demoone.feign;
import cn.flyrise.common.core.domain.Reply;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author : wwcong
* @date : 5:24 下午 2022/3/24
*/
@FeignClient(name = "pai-demo-article")
public interface ArticleFeignClient {
@ApiOperation("获取文章列表")
@GetMapping("${api.service.console.path:}/article/page")
Reply<?> pageArticlePage(@RequestParam("page") Integer page, @RequestParam("size") Integer size);
}
调用
@Resource
private ArticleFeignClient articleFeignClient;
@ApiOperation("分页查询")
@GetMapping(value = "pageArticle")
public Reply<?> pageArticle(Integer page, Integer size) {
return articleFeignClient.pageArticlePage(page, size);
}
文档更新时间: 2023-02-28 11:50 作者:欧阳少海