|
@@ -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 {
|