From 02f18587bd8860b305e2c688e20465be166bb48c Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期四, 22 七月 2021 15:14:03 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test --- springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java index 7599acd..1d0fe6e 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java @@ -6,7 +6,6 @@ import com.panzhihua.common.utlis.StringUtils; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -import org.checkerframework.checker.units.qual.A; import org.springframework.web.bind.annotation.*; import java.io.*; @@ -73,7 +72,7 @@ Map<String, Object> map = new HashMap<>(); map.put("type", "news"); // news表示图文类型的素材,具体看API文档 map.put("offset", 0); - map.put("count", 1); + map.put("count", 5); // 将map转换成json字符串 String paramBody = JSON.toJSONString(map); // 这里用了Alibaba的fastjson @@ -94,9 +93,8 @@ return sb.toString(); } - @ApiOperation(value = "拉取公众号列表") - @GetMapping("/list/noToken") + @GetMapping(value = "/list/noToken",produces="application/json;charset=UTF-8") public R pageDiscuss() throws Exception{ WxOfficialApi officialApi = new WxOfficialApi(); @@ -112,13 +110,13 @@ } } - List<String> resultList = new ArrayList<>(); + List<JSONObject> resultList = new ArrayList<>(); if(!tokenList.isEmpty()){ tokenList.forEach(token -> { try { String result = officialApi.getContentList(token); log.info("通过token获取文章列表成功,返回结果:" + result); - resultList.add(result); + resultList.add(JSON.parseObject(result)); }catch (Exception e){ log.error("通过token获取文章列表失败,错误原因:" + e.getMessage()); } -- Gitblit v1.7.1