|  |  | 
 |  |  |  | 
 |  |  | import com.alibaba.fastjson2.JSONArray; | 
 |  |  | import com.alibaba.fastjson2.JSONObject; | 
 |  |  | import com.ruoyi.web.controller.smartor.tools.WeChatController; | 
 |  |  | import com.smartor.domain.WeChatSendVo; | 
 |  |  | import me.chanjar.weixin.common.exception.WxErrorException; | 
 |  |  | import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage; | 
 |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static void main(String[] args) { | 
 |  |  | //        String appId = "wx1c5243d2337753f4"; | 
 |  |  | //        String appSecret = "84a2186a0d175e88345267c716516cd3"; | 
 |  |  | //        WeChatService weChatService = new WeChatService(appId, appSecret); | 
 |  |  | //        weChatService.sendMessageToFollowers("你在说啥呢????"); | 
 |  |  | //        // new com.smartor.controller.BaseSmsaccountController().sendMessageToFollowers("AIJSl-IF6M05NzaXofPYbT5wgSP3bWH7I9OBmvJqsaU","www.baidu.com"); | 
 |  |  |         WeChatController weChatController = new WeChatController(); | 
 |  |  |         JSONArray templateList = weChatController.getTemplateList(); | 
 |  |  |         for (int i = 0; i < templateList.size(); i++) { | 
 |  |  |             JSONObject template = templateList.getJSONObject(i); | 
 |  |  |             System.out.println("Template ID: " + template.getString("template_id")); | 
 |  |  |             System.out.println("Title: " + template.getString("title")); | 
 |  |  |             System.out.println("Content: " + template.getString("content")); | 
 |  |  |             System.out.println("==============================="); | 
 |  |  |             WeChatSendVo weChatSendVo = new WeChatSendVo(); | 
 |  |  |             weChatSendVo.setTemplateId(template.getString("template_id")); | 
 |  |  |             Map<String, Object> map = new HashMap<>(); | 
 |  |  |             map.put("first", "武器的卡"); | 
 |  |  |             map.put("keyword1", "看我付款看我付款未开放看我付款"); | 
 |  |  |             map.put("keyword2", "12657698798797"); | 
 |  |  |             map.put("remark", "啊啊撒啊啊啊"); | 
 |  |  |             weChatSendVo.setContent(map); | 
 |  |  | //            weChatController.sendMessageToFollowers(weChatSendVo); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     } | 
 |  |  | } |