From 55f2d49e048d79eea6f7cd0d28e31d9e4fb83b48 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Wed, 19 Apr 2023 15:46:12 +0800 Subject: [PATCH] update --- consume/dou_shen_user_register_for_my_my_fans.go | 14 ++++++++++++-- ...ou_shen_user_register_for_my_my_recommender.go | 14 ++++++++++++-- ...dou_shen_user_register_for_official_consume.go | 14 ++++++++++++-- ...dou_shen_user_register_for_operation_center.go | 15 +++++++++++++-- 4 files changed, 49 insertions(+), 8 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 b89096d..c0e8adb 100644 --- a/consume/dou_shen_user_register_for_my_my_fans.go +++ b/consume/dou_shen_user_register_for_my_my_fans.go @@ -54,7 +54,7 @@ func DouShenUserRegisterConsumeForMyFans(queue md.MqQueue) { } func handleDouShenUserRegisterConsumeForMyFans(msgData []byte) error { - time.Sleep(time.Duration(3) * time.Second) + time.Sleep(time.Duration(4) * time.Second) //1、解析mq中queue的数据结构体 var msg *md.DouShenUserRegisterMessageStructForMyFans err := json.Unmarshal(msgData, &msg) @@ -70,7 +70,17 @@ func handleDouShenUserRegisterConsumeForMyFans(msgData []byte) error { return err } if gimUser == nil { - return errors.New("用户暂未注册im系统") + time.Sleep(time.Duration(4) * time.Second) + gimUser, err := db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ + "key": "phone_number", + "value": msg.Phone, + }) + if err != nil { + return err + } + if gimUser == nil { + return errors.New("用户暂未注册im系统") + } } groupName := "我的粉丝[1]群" 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 e09ea17..0986d62 100644 --- a/consume/dou_shen_user_register_for_my_my_recommender.go +++ b/consume/dou_shen_user_register_for_my_my_recommender.go @@ -52,7 +52,7 @@ func DouShenUserRegisterConsumeForMyRecommender(queue md.MqQueue) { } func handleDouShenUserRegisterConsumeForMyRecommender(msgData []byte) error { - time.Sleep(time.Duration(3) * time.Second) + time.Sleep(time.Duration(4) * time.Second) //1、解析mq中queue的数据结构体 var msg *md.DouShenUserRegisterMessageStructForMyRecommender err := json.Unmarshal(msgData, &msg) @@ -68,7 +68,17 @@ func handleDouShenUserRegisterConsumeForMyRecommender(msgData []byte) error { return err } if gimUser == nil { - return errors.New("用户暂未注册im系统") + time.Sleep(time.Duration(4) * time.Second) + gimUser, err := db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ + "key": "phone_number", + "value": msg.Phone, + }) + if err != nil { + return err + } + if gimUser == nil { + return errors.New("用户暂未注册im系统") + } } //2、查找是否有群 diff --git a/consume/dou_shen_user_register_for_official_consume.go b/consume/dou_shen_user_register_for_official_consume.go index 3bfd978..d21b2d8 100644 --- a/consume/dou_shen_user_register_for_official_consume.go +++ b/consume/dou_shen_user_register_for_official_consume.go @@ -53,7 +53,7 @@ func DouShenUserRegisterConsumeForOfficial(queue md.MqQueue) { } func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { - time.Sleep(time.Duration(3) * time.Second) + time.Sleep(time.Duration(4) * time.Second) //1、解析mq中queue的数据结构体 var msg *md.DouShenUserRegisterMessageStructForOfficial err := json.Unmarshal(msgData, &msg) @@ -69,7 +69,17 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { return err } if gimUser == nil { - return errors.New("用户暂未注册im系统") + time.Sleep(time.Duration(4) * time.Second) + gimUser, err := db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ + "key": "phone_number", + "value": msg.Phone, + }) + if err != nil { + return err + } + if gimUser == nil { + return errors.New("用户暂未注册im系统") + } } //2、查找是否有群 diff --git a/consume/dou_shen_user_register_for_operation_center.go b/consume/dou_shen_user_register_for_operation_center.go index f474f22..346eaa0 100644 --- a/consume/dou_shen_user_register_for_operation_center.go +++ b/consume/dou_shen_user_register_for_operation_center.go @@ -52,7 +52,7 @@ func DouShenUserRegisterConsumeForOperationCenter(queue md.MqQueue) { } func handleDouShenUserRegisterConsumeForOperationCenter(msgData []byte) error { - time.Sleep(time.Duration(3) * time.Second) + time.Sleep(time.Duration(4) * time.Second) //1、解析mq中queue的数据结构体 var msg *md.DouShenUserRegisterMessageStructForOperationCenter err := json.Unmarshal(msgData, &msg) @@ -67,8 +67,19 @@ func handleDouShenUserRegisterConsumeForOperationCenter(msgData []byte) error { if err != nil { return err } + if gimUser == nil { - return errors.New("用户暂未注册im系统") + time.Sleep(time.Duration(4) * time.Second) + gimUser, err := db2.UserGetOneByParams(db.ImDb, msg.MasterId, map[string]interface{}{ + "key": "phone_number", + "value": msg.Phone, + }) + if err != nil { + return err + } + if gimUser == nil { + return errors.New("用户暂未注册im系统") + } } //2、查找是否有群