|
|
@@ -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), |
|
|
|