日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網(wǎng)站首頁 編程語言 正文

報錯:Error occurred when invoke the listener‘s interface!

作者:weixin_44654264 更新時間: 2022-01-18 編程語言

1、禁用Feign里面的Hystrix

feign:
  hystrix:
    enabled: false

2、將feign和controller加上對應的參數(shù)name

feign

@FeignClient(name="content")
@RequestMapping("/content")
public interface ContentFeign {

    @GetMapping(value = "/list/category/{id}")
    Result<List<Content>> findByCategory(@PathVariable(name = "id") Long id);
}

controller

@RestController
@RequestMapping("/content")
@CrossOrigin
public class ContentController {

   //根據(jù)分類id查詢廣告數(shù)據(jù)
    @GetMapping("/list/category/{id}")
    public Result<List<Content>> findByCategory(@PathVariable(name = "id") Long id){

        List<Content> contents = contentService.findByCategory(id);

        return new Result<List<Content>>(true,StatusCode.OK,"查詢成功",contents);
    }
}

最后成功解決!!

redis成功加載數(shù)據(jù)

原文鏈接:https://blog.csdn.net/weixin_44654264/article/details/118400568

欄目分類
最近更新