Browse Source

test wecom

boweniac 1 month ago
parent
commit
6f904d46d2
1 changed files with 12 additions and 2 deletions
  1. 12 2
      internal/pkg/wechat_ws/test/main.go

+ 12 - 2
internal/pkg/wechat_ws/test/main.go

@@ -12,7 +12,8 @@ func msgHandler(msg wechat_ws.MsgJsonObject) error {
 }
 
 func main() {
-	u := url.URL{Scheme: "ws", Host: "chat.gkscrm.com:13088"}
+	//u := url.URL{Scheme: "ws", Host: "chat.gkscrm.com:13088"}
+	u := url.URL{Scheme: "ws", Host: "wecom.gkscrm.com:15088"}
 
 	logx.Info(u.String())
 
@@ -23,7 +24,16 @@ func main() {
 
 	go client.WritePump()
 
-	//client.SendMsg([]byte(`{"msgType":"text","message":"你好"}`))
+	client.SendMsg([]byte(`{
+    "MsgType": "TalkToFriendTask",
+    "Content": {
+        "WxId": "1688856818598875",
+        "ConvId": "7881302495311662",
+        "ContentType": "Text",
+        "Content": "5L2g5aW9",
+        "TaskId": 17409293978671188
+    }
+}`))
 	//
 	//time.Sleep(5)
 	//