|
@@ -6,6 +6,7 @@ package com.ylx.massage.utils;
|
|
*/
|
|
*/
|
|
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
+import cn.hutool.json.JSONArray;
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.ylx.common.config.WechatAccountConfig;
|
|
import com.ylx.common.config.WechatAccountConfig;
|
|
@@ -129,6 +130,32 @@ public class WeChatUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取新增关注数量
|
|
|
|
+ *
|
|
|
|
+ * @return 返回包含增关注数量
|
|
|
|
+ */
|
|
|
|
+ public String getFollowers(String beginDate, String endDate) {
|
|
|
|
+ String token = this.getToken();
|
|
|
|
+
|
|
|
|
+ String urlStr = "https://api.weixin.qq.com/datacube/getusersummary?access_token="+token;
|
|
|
|
+ cn.hutool.json.JSONObject param1 = JSONUtil.createObj();
|
|
|
|
+ param1.set("begin_date", beginDate);
|
|
|
|
+ param1.set("end_date", endDate);
|
|
|
|
+ String result = HttpUtil.post(urlStr, param1.toString());
|
|
|
|
+
|
|
|
|
+ log.info("getFollowers-获取关注量请求参数:{}", param1);
|
|
|
|
+ Map<?, ?> map = JSONObject.parseObject(result, Map.class);
|
|
|
|
+ log.info("getFollowers-获取关注量返回:{}", map);
|
|
|
|
+
|
|
|
|
+ String list = (String) map.get("list");
|
|
|
|
+ JSONArray objects = JSONObject.parseObject(list, JSONArray.class);
|
|
|
|
+ JSONObject jsonObject = (JSONObject) objects.get(0);
|
|
|
|
+ return (String)jsonObject.get("new_user");
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取jsticke
|
|
* 获取jsticke
|
|
*/
|
|
*/
|
|
@@ -283,7 +310,7 @@ public class WeChatUtil {
|
|
param1.put("url", "https://test.baoxianzhanggui.com/fragrance/");
|
|
param1.put("url", "https://test.baoxianzhanggui.com/fragrance/");
|
|
param1.put("data", data);
|
|
param1.put("data", data);
|
|
String result = HttpUtil.post(url, param1.toString());
|
|
String result = HttpUtil.post(url, param1.toString());
|
|
- System.out.println(result);
|
|
|
|
|
|
+
|
|
log.info("notification-消息通知请求参数:{}", param1.toString());
|
|
log.info("notification-消息通知请求参数:{}", param1.toString());
|
|
Map<?, ?> map = JSONObject.parseObject(result, Map.class);
|
|
Map<?, ?> map = JSONObject.parseObject(result, Map.class);
|
|
log.info("notification-消息通知返回参数:{}", map);
|
|
log.info("notification-消息通知返回参数:{}", map);
|