@FeignClient(value = "service-treasure-111" ,url = "192.168.2.2:10010",configuration =FeignConfig.class) public interface MgbApiClient { @RequestMapping(value = "/bank/jhOrder", method = RequestMethod.POST) String getByCustomer(Map<String,Object> map); }
value:可以随便输,用于区分注入的名称
@Test void contextLoads2() throws Exception { Map<String, Object> map=new HashMap<>(); map.put("name","123"); map.put("age","1"); map.put("sex","難"); String byCustomer = mgbApiClient.getByCustomer(map); System.out.println(byCustomer); }
直接调用方法就可以了