import org.springframework.web.client.RestTemplate;
@RequestMapping("/rest/basis/competition/brand")
@Controller
public class CompetitonBrandRestController {
@Autowired
private RestTemplate restTemplate;
/**
*
* @param queryDto
* @return
*/
@JsonResponseBody(message = "分页查询")
@RequestMapping(path = "/daily/query", method = RequestMethod.POST, produces = {"application/json"})
public PageVo<CompetitionSalesVO> queryDaily(@RequestBody CompetitionSalesDTO queryDto) {
PageVo vo = (PageVo) map2Object((Map<String, Object>) queryCompetition(dailyUrl, queryDto).get("data"), PageVo.class);
return vo;
}
private Map<String, Object> queryCompetition(String url, Object queryDto) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.AP
Spring项目用restTemplate访问接口获取数据
最新推荐文章于 2022-11-24 18:02:21 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)