| | |
| | | try { |
| | | String url = "https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=" + token; |
| | | String result = getActicle(url); |
| | | log.info("通过token获取文章列表成功,返回结果:" + result); |
| | | // log.info("通过token获取文章列表成功,返回结果:" + result); |
| | | |
| | | JSONObject resultJson = JSON.parseObject(result); |
| | | if(resultJson != null){ |
| | |
| | | log.info("对象信息设置前:" + newsItemList.get(0)); |
| | | newsItemList.get(0).put("thumb_media_id",mediaId); |
| | | log.info("对象信息设置后:" + newsItemList.get(0)); |
| | | log.info("对象集合数据:" + newsItemList); |
| | | |
| | | contentJson.put("news_item",newsItemList); |
| | | object.put("content",contentJson); |
| | | |
| | | |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | valueOperations.set(UserConstants.NEWS_ID + mediaId, newsUrl + "", 2, TimeUnit.DAYS); |
| | | } |
| | | } |
| | | resultJson.put("item",itemList); |
| | | } |
| | | resultList.add(resultJson); |
| | | }catch (Exception e){ |