瀏覽代碼

fix:修改企微刷新联系人

jimmyyem 1 月之前
父節點
當前提交
fe83c58509
共有 2 個文件被更改,包括 1 次插入35 次删除
  1. 1 34
      hook/contact.go
  2. 0 1
      internal/logic/Wxhook/get_friends_and_groups_logic.go

+ 1 - 34
hook/contact.go

@@ -139,7 +139,7 @@ func (h *Hook) TriggerChatroomPush(wxWxid string) error {
 	return nil
 }
 
-// TriggerCustomerPushTask 刷新企微联系人
+// TriggerCustomerPushTask 刷新企微联系人、群组
 func (h *Hook) TriggerCustomerPushTask(wxWxid string) error {
 	conn, err := h.connWorkPhone()
 	if err != nil {
@@ -172,39 +172,6 @@ func (h *Hook) TriggerCustomerPushTask(wxWxid string) error {
 	return nil
 }
 
-// TriggerConversationPushTask 刷新企微群组
-func (h *Hook) TriggerConversationPushTask(wxWxid string) error {
-	conn, err := h.connWorkPhone()
-	if err != nil {
-		err = fmt.Errorf("TriggerConversationPushTask failed")
-		return err
-	}
-	defer func(conn *websocket.Conn) {
-		err = conn.Close()
-		if err != nil {
-			err = fmt.Errorf("TriggerConversationPushTask failed")
-		}
-	}(conn)
-
-	message := map[string]interface{}{
-		"MsgType": "TriggerConversationPushTask",
-		"Content": map[string]interface{}{
-			"WxId": wxWxid,
-		},
-	}
-	transportMessageJSON, err := json.Marshal(message)
-	if err != nil {
-		return err
-	}
-	// 发送 JSON 消息
-	err = conn.WriteMessage(websocket.TextMessage, transportMessageJSON)
-	if err != nil {
-		return fmt.Errorf("failed to send message: %v", err)
-	}
-
-	return nil
-}
-
 func (h *Hook) AddFriendInChatRoom(ChatRoomId, wxWxid, friendId, desc string) error {
 	conn, err := h.connWorkPhone()
 	if err != nil {

+ 0 - 1
internal/logic/Wxhook/get_friends_and_groups_logic.go

@@ -224,7 +224,6 @@ func (l *GetFriendsAndGroupsLogic) GetFriendsAndGroups(req *types.IDReq) (resp *
 
 		if wxInfo.Ctype == 3 {
 			_ = hookClient.TriggerCustomerPushTask(wxInfo.Wxid)
-			_ = hookClient.TriggerConversationPushTask(wxInfo.Wxid)
 		} else {
 			_ = hookClient.TriggerChatroomPush(wxInfo.Wxid)
 		}