fire_point/src/main/java/com/xkrs/straw/utilsold/WDWxSendMsgUtil.java

38 lines
1.0 KiB
Java
Raw Normal View History

2023-03-08 11:21:59 +08:00
package com.xkrs.straw.utilsold;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.HashMap;
import java.util.Map;
2023-03-08 11:21:59 +08:00
import static com.xkrs.straw.utilsold.WDHttpClientUtils.sendHttpPost;
/**
* @author wudong
* @date 2022/6/2 9:25
* @description
*/
public class WDWxSendMsgUtil {
/**
* 通过udp通信调用发送微信消息服务发送微信消息
*
* @param wxid 微信id
* @param text 信息
* @param type 类型0文本1文档
* @throws Exception
*/
public static void sendMsg(String wxid, String text, Integer type) throws Exception {
String url = "http://118.24.27.47:10721/winxin_api/msg";
Map<String, Object> map = new HashMap<>();
map.put("wxid", wxid);
map.put("text", text);
map.put("type", type);
sendHttpPost(url, new ObjectMapper().writeValueAsString(map));
}
public static void main(String[] args) throws Exception {
sendMsg("18447024917@chatroom", "微信发消息测试", 0);
}
}