|
|
|
@@ -253,33 +253,5 @@ public class WxUserStructureController { |
|
|
|
return vo;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String token="https://api.weixin.qq.com/cgi-bin/token?"+
|
|
|
|
"grant_type=client_credential&appid=APPID&secret=APPSECRET";
|
|
|
|
|
|
|
|
private static String visit = "https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend?access_token=";
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private RestTemplate r;
|
|
|
|
|
|
|
|
@GetMapping("test")
|
|
|
|
public String visit() {
|
|
|
|
String url = token.replace("APPID", "wx8eb8275b78db4ede").
|
|
|
|
replace("APPSECRET", "76c43df01296998d8ce12383f213ac10");
|
|
|
|
Map map = r.getForObject(url,Map.class);
|
|
|
|
System.out.println(map.get("access_token"));
|
|
|
|
String reqUrl= visit+map.get("access_token");
|
|
|
|
// Map map = r.getForObject(reqUrl,Map.class);
|
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
|
map = new HashMap<String, String>();
|
|
|
|
map.put("begin_date", "20180828");
|
|
|
|
map.put("end_date", "20180828");
|
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
|
HttpEntity<Map> entity = new HttpEntity<Map>(map, headers);
|
|
|
|
// ResponseEntity<Student> responseEntity = restTemplate.exchange(url, HttpMethod.POST, entity, Student.class, aa);
|
|
|
|
ResponseEntity<String> responseEntity = restTemplate.postForEntity(reqUrl, entity, String.class);
|
|
|
|
return JSON.toJSONString(responseEntity);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|