From a0a4ea0dc47b14e069d0cf36a1cdb4391194832d Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 6 Jun 2023 21:03:04 +0800 Subject: [PATCH] update --- consume/dou_shen_user_register_for_my_my_fans.go | 4 ++-- .../dou_shen_user_register_for_my_my_recommender.go | 4 ++-- consume/dou_shen_user_register_for_official_consume.go | 10 +++++----- consume/dou_shen_user_register_for_operation_center.go | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/consume/dou_shen_user_register_for_my_my_fans.go b/consume/dou_shen_user_register_for_my_my_fans.go index 62d0114..078bc98 100644 --- a/consume/dou_shen_user_register_for_my_my_fans.go +++ b/consume/dou_shen_user_register_for_my_my_fans.go @@ -80,8 +80,8 @@ func handleDouShenUserRegisterConsumeForMyFans(msgData []byte) error { return err } if gimUser == nil { - time.Sleep(time.Duration(10) * time.Second) - gimUser, err := db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ + time.Sleep(time.Duration(1) * time.Second) + gimUser, err = db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ "key": "phone_number", "value": msg.Phone, }) diff --git a/consume/dou_shen_user_register_for_my_my_recommender.go b/consume/dou_shen_user_register_for_my_my_recommender.go index 57a8b73..aa0589d 100644 --- a/consume/dou_shen_user_register_for_my_my_recommender.go +++ b/consume/dou_shen_user_register_for_my_my_recommender.go @@ -62,7 +62,7 @@ func DouShenUserRegisterConsumeForMyRecommender(queue md.MqQueue) { } func handleDouShenUserRegisterConsumeForMyRecommender(msgData []byte) error { - time.Sleep(time.Duration(10) * time.Second) + time.Sleep(time.Duration(1) * time.Second) //1、解析mq中queue的数据结构体 var msg *md.DouShenUserRegisterMessageStructForMyRecommender err := json.Unmarshal(msgData, &msg) @@ -100,7 +100,7 @@ func handleDouShenUserRegisterConsumeForMyRecommender(msgData []byte) error { if err != nil { return err } - gimUser, err := db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ + gimUser, err = db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ "key": "id", "value": gimUserId, }) diff --git a/consume/dou_shen_user_register_for_official_consume.go b/consume/dou_shen_user_register_for_official_consume.go index cd7e5f3..f2bd336 100644 --- a/consume/dou_shen_user_register_for_official_consume.go +++ b/consume/dou_shen_user_register_for_official_consume.go @@ -88,7 +88,7 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { return err } - _, err = db2.UserInsert(db.ImDb, &model2.User{ + gimUserId, err := db2.UserInsert(db.ImDb, &model2.User{ PhoneNumber: strconv.FormatInt(msg.Phone, 10), Nickname: user.Nickname, AvatarUrl: userProfile.AvatarUrl, @@ -101,9 +101,9 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { if err != nil { return err } - gimUser, err := db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ - "key": "phone_number", - "value": msg.Phone, + gimUser, err = db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ + "key": "id", + "value": gimUserId, }) if gimUser == nil { return errors.New("用户暂未注册im系统") @@ -174,7 +174,7 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { if userGroup == nil { return errors.New("当前官方群暂未设置群主,请联系管理员!!!") } - fmt.Println("!!!!!!!!!!", gimUser) + //加入群 _, err = utils.GetLogicExtClient(cfg.ImLogicRpc.URL, cfg.ImLogicRpc.PORT).AddGroupMembers( utils.GetCtx("", strconv.FormatInt(userGroup.UserId, 10), "", msg.MasterId), diff --git a/consume/dou_shen_user_register_for_operation_center.go b/consume/dou_shen_user_register_for_operation_center.go index cd30881..b1c64da 100644 --- a/consume/dou_shen_user_register_for_operation_center.go +++ b/consume/dou_shen_user_register_for_operation_center.go @@ -63,7 +63,7 @@ func DouShenUserRegisterConsumeForOperationCenter(queue md.MqQueue) { } func handleDouShenUserRegisterConsumeForOperationCenter(msgData []byte) error { - time.Sleep(time.Duration(10) * time.Second) + time.Sleep(time.Duration(1) * time.Second) //1、解析mq中queue的数据结构体 var msg *md.DouShenUserRegisterMessageStructForOperationCenter err := json.Unmarshal(msgData, &msg) @@ -101,7 +101,7 @@ func handleDouShenUserRegisterConsumeForOperationCenter(msgData []byte) error { if err != nil { return err } - gimUser, err := db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ + gimUser, err = db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ "key": "id", "value": gimUserId, })