|
@@ -180,7 +180,7 @@ public class CmsUserController{
|
|
|
* 企业微信群发发送用户账号过期
|
|
* 企业微信群发发送用户账号过期
|
|
|
*/
|
|
*/
|
|
|
private final WxCorpOps wxCorpOps;
|
|
private final WxCorpOps wxCorpOps;
|
|
|
-
|
|
|
|
|
|
|
+ private final static String content = "还没有自己独立的ChatGPT账号?正式推出ChatGPT独立账号!还有付费API,Chat GPT同门师兄杀手级对手Claude,轻松打败95%人类画师的Midjourney,立即体验上车https://nf.video/yinhe/web/";
|
|
|
@GetMapping("/corp/send/msg")
|
|
@GetMapping("/corp/send/msg")
|
|
|
public Result<String> corpSendMsg() throws Exception {
|
|
public Result<String> corpSendMsg() throws Exception {
|
|
|
DateTime now = new DateTime();
|
|
DateTime now = new DateTime();
|
|
@@ -193,7 +193,7 @@ public class CmsUserController{
|
|
|
GoodsDonSku donSku = skuMapper.selectById(skuId);
|
|
GoodsDonSku donSku = skuMapper.selectById(skuId);
|
|
|
GoodsDon goodsDon = donMapper.selectById(donSku.getGoodsId());
|
|
GoodsDon goodsDon = donMapper.selectById(donSku.getGoodsId());
|
|
|
Set<String> exterUserIds = relations.stream().map(GroupsRelation::getExternalUserid).collect(Collectors.toSet());
|
|
Set<String> exterUserIds = relations.stream().map(GroupsRelation::getExternalUserid).collect(Collectors.toSet());
|
|
|
- String content = String.format("您的%s账号5天内即将到期,请尽快续费,以免影响使用,续费地址:https://nf.video/yinhe/web/ticket", goodsDon.getTitle());
|
|
|
|
|
|
|
+// String content = String.format("您的%s账号5天内即将到期,请尽快续费,以免影响使用,续费地址:https://nf.video/yinhe/web/ticket", goodsDon.getTitle());
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.putOpt("chat_type", "single");
|
|
jsonObject.putOpt("chat_type", "single");
|
|
|
jsonObject.putOpt("external_userid", new String[]{"wmvj2DPQAAzWQY3xIQOQMykTASbvb_pQ"});
|
|
jsonObject.putOpt("external_userid", new String[]{"wmvj2DPQAAzWQY3xIQOQMykTASbvb_pQ"});
|
|
@@ -275,4 +275,41 @@ public class CmsUserController{
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * GPT
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/get/gpt/notify")
|
|
|
|
|
+ public Result<String> gptNotify() throws Exception {
|
|
|
|
|
+ String url = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_msg_template?access_token=" + wxCorpOps.getAccessToken("ww9c0ccaad2e9d3822");
|
|
|
|
|
+ List<String> externalUserIds = userMapper.selectExterUserId();
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
|
+ jsonObject.putOpt("chat_type", "single");
|
|
|
|
|
+ jsonObject.putOpt("external_userid", externalUserIds);
|
|
|
|
|
+ JSONObject text = new JSONObject();
|
|
|
|
|
+ text.putOpt("content", content);
|
|
|
|
|
+ try {
|
|
|
|
|
+ jsonObject.putOpt("text", text);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ for (String cs : customer) {
|
|
|
|
|
+ jsonObject.putOpt("sender", cs);
|
|
|
|
|
+ HttpResponse<String> send = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ send = J11HttpC.custom()
|
|
|
|
|
+ .ofPost()
|
|
|
|
|
+ .url(url)
|
|
|
|
|
+ .body(HttpRequest.BodyPublishers.ofString(jsonObject.toString()))
|
|
|
|
|
+ .send(HttpResponse.BodyHandlers.ofString());
|
|
|
|
|
+ JSONObject response = Jsons.parseObject(send.body(), JSONObject.class);
|
|
|
|
|
+ log.info(response.toString());
|
|
|
|
|
+ if (response.getInt("errcode") == 0 && response.getStr("errmsg").equals("ok")) {
|
|
|
|
|
+ System.out.println("发送成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|