diff --git a/domain/service/group_s/group_op.go b/domain/service/group_s/group_op.go index 45ae38998a75dfa4fafc724fe99e75e4be51240b..30e6213a5ca7fb266f56e66b0ce06b9ec288bfc5 100644 --- a/domain/service/group_s/group_op.go +++ b/domain/service/group_s/group_op.go @@ -253,16 +253,10 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin var cpLevel int var cpUserAvatar string var cpEntryEffect bool - if cp, _ := rpc.GetUserCp(model, userId); cp != nil { - cpLevel = cp.CpLevel.Level - if cp.CpUserInfo.Avatar != nil { - cpUserAvatar = *cp.CpUserInfo.Avatar - } - for _, v := range cp.MyPrivilegeList { - if v.Type == 5 { - cpEntryEffect = true - } - } + if cp, _ := rpc.GetUserCpEntryEffect(model, userId); cp != nil { + cpLevel = cp.CpLevel + cpUserAvatar = cp.CpUserAvatar + cpEntryEffect = cp.CpEntryEffect } r := UserParam{ Nick: user.Nick, diff --git a/route/group_r/group_info.go b/route/group_r/group_info.go index 18e3baec9fa20cac5dafc96045daf862fc717946..68b8a4ce987930d2c49b529b8fde6219cda1b313 100644 --- a/route/group_r/group_info.go +++ b/route/group_r/group_info.go @@ -612,16 +612,10 @@ func GetRoomInfo(c *gin.Context) (*mycontext.MyContext, error) { var entryEffectType int // 进场特效类型 1: CP 2:神秘人 3:贵族 4:vip ,顺序从小到大 var cpEntryEffect bool - if cp, _ := rpc.GetUserCp(model, userId); cp != nil { - for _, v := range cp.MyPrivilegeList { - if v.Type == 5 { - cpEntryEffect = true - } - } - result.CpLevel = cp.CpLevel.Level - if cp.CpUserInfo != nil && cp.CpUserInfo.Avatar != nil { - result.CpUserAvatar = *cp.CpUserInfo.Avatar - } + if cp, _ := rpc.GetUserCpEntryEffect(model, userId); cp != nil { + cpEntryEffect = cp.CpEntryEffect + result.CpLevel = cp.CpLevel + result.CpUserAvatar = cp.CpUserAvatar } if user, _ := user_cv.GetUserDetail(model, userId, userId); user != nil { if user.IsVip {