spring cloud - Feign的Request传值

67 阅读1分钟

世界上并没有完美的程序,但是我们并不因此而沮丧,因为写程序就是一个不断追求完美的过程。

Feign通过@RequestParam传送HttpServletRequest可以接收到的值。

@Component
@FeignClient("client")
public interface StatFeignService {

    @PostMapping("/test")
    Result organMap(@RequestParam("name") String name);


    @PostMapping("/test2")
    Result siteMap(@RequestParam("name1") String name1,
                   @RequestParam("name2") String name2);

}

在这里插入图片描述