|
@@ -5,7 +5,6 @@ import (
|
|
|
"encoding/json"
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
|
"wechat-api/ent/wx"
|
|
|
- "wechat-api/hook"
|
|
|
"wechat-api/internal/pkg/wechat_ws"
|
|
|
"wechat-api/internal/svc"
|
|
|
"wechat-api/workphone"
|
|
@@ -34,15 +33,15 @@ func (f *FriendPushNoticeHandler) Handler(msg *wechat_ws.MsgJsonObject) error {
|
|
|
wx.WxidEQ(message.WeChatId), // Additional filter by organizationId
|
|
|
).
|
|
|
Only(context.TODO())
|
|
|
- hookClient := hook.NewHook("", "", "")
|
|
|
+ //hookClient := hook.NewHook("", "", "")
|
|
|
for _, friend := range message.Friends {
|
|
|
friendType := 1
|
|
|
- if friend.Type == 1 {
|
|
|
- friendType = 2
|
|
|
- _ = hookClient.RequestChatRoomInfo(friend.FriendId, message.WeChatId)
|
|
|
- } else {
|
|
|
- friendType = 1
|
|
|
- }
|
|
|
+ //if friend.Type == 1 {
|
|
|
+ // friendType = 2
|
|
|
+ // _ = hookClient.RequestChatRoomInfo(friend.FriendId, message.WeChatId)
|
|
|
+ //} else {
|
|
|
+ // friendType = 1
|
|
|
+ //}
|
|
|
_, err = f.svcCtx.DB.Contact.Create().
|
|
|
SetWxWxid(message.WeChatId).
|
|
|
SetType(friendType).
|
|
@@ -55,6 +54,7 @@ func (f *FriendPushNoticeHandler) Handler(msg *wechat_ws.MsgJsonObject) error {
|
|
|
SetOrganizationID(wx_info.OrganizationID).
|
|
|
OnConflict().
|
|
|
UpdateNewValues().
|
|
|
+ SetType(friendType).
|
|
|
SetOrganizationID(wx_info.OrganizationID).
|
|
|
ID(context.TODO())
|
|
|
|