diff --git a/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java b/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java index b5cb6394c..b9a100c30 100644 --- a/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java +++ b/mallinkAdmin/src/main/java/com/simple/controller/WxUserStructureController.java @@ -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(); - map.put("begin_date", "20180828"); - map.put("end_date", "20180828"); - RestTemplate restTemplate = new RestTemplate(); - HttpEntity entity = new HttpEntity(map, headers); - // ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.POST, entity, Student.class, aa); - ResponseEntity responseEntity = restTemplate.postForEntity(reqUrl, entity, String.class); - return JSON.toJSONString(responseEntity); - } - }