服务提供方
@RequestMapping("/test2")
@ResponseBody
public String getString2(String str) {
String s = "aaa" + str;
System.out.println("s:"+s);
return s;
}
服务调用方
@Scheduled(fixedRate = 1000*1*5)
@Async
public void getInAndOutParkingInfoByIsAddeda2() {
//Resp2 resp = parkingApiService.getInAndOutParkingInfoByIsAdded();
String str = "bbb";
//把resp推送给其它接口
RestTemplate restTemplate = new RestTemplate();
String url = "http://localhost:7008/openWork/user/test2?str=bbb";
ResponseEntity<String> resp2 = restTemplate.postForEntity(url, str, String.class);
System.out.println("resp2.getBody():"+resp2.getBody());
}