我有一个工作的 Feign 接口定义为:
@FeignClient("content-link-service")
public interface ContentLinkServiceClient {
@RequestMapping(method = RequestMethod.GET, value = "/{trackid}/links")
List<Link> getLinksForTrack(@PathVariable("trackid") Long trackId);
}
如果我将其更改为使用 @RequestLine
@FeignClient("content-link-service")
public interface ContentLinkServiceClient {
@RequestLine("GET /{trackid}/links")
List<Link> getLinksForTrack(@Param("trackid") Long trackId);
}
我得到了例外
原因:java.lang.IllegalStateException:方法 getLinksForTrack 未使用 HTTP 方法类型注释(例如 GET、POST)
任何想法为什么?