diff --git a/domain/model/group_m/micData.go b/domain/model/group_m/micData.go index 350fbd163183522f98cff57337442fb97193985b..865f324160be79f63129c52310f1579a34feca61 100644 --- a/domain/model/group_m/micData.go +++ b/domain/model/group_m/micData.go @@ -42,25 +42,24 @@ type MicContent struct { Timestamp int64 `json:"timestamp"` //用户 User *MicUserData `json:"user"` - //mic位置特效svga - MicEffect string `json:"micEffect"` - //头饰里面的小头像 - HeadwearIcon string `json:"headwearIcon"` } type MicUserData struct { - Id uint64 `json:"id,omitempty"` - ExternalId string `json:"externalId"` - Avatar string `json:"avatar"` - Nick string `json:"nick"` - Sex uint8 `json:"sex"` - Code string `json:"code"` - IsVip bool `json:"isVip"` - NobleLeave uint16 `json:"noble"` // 当前的贵族等级 - HeadwearPicUrl string `json:"headwearPicUrl"` - HeadwearEffectUrl string `json:"headwearEffectUrl"` - SvipLevel int `json:"svipLevel"` - Svip rpc.CvSvip `json:"svip"` + Id uint64 `json:"id,omitempty"` + ExternalId string `json:"externalId"` + Avatar string `json:"avatar"` + Nick string `json:"nick"` + Sex uint8 `json:"sex"` + Code string `json:"code"` + IsVip bool `json:"isVip"` + NobleLeave uint16 `json:"noble"` // 当前的贵族等级 + HeadwearPicUrl string `json:"headwearPicUrl"` + HeadwearEffectUrl string `json:"headwearEffectUrl"` + HeadwearReverseEffectUrl string `json:"headwearReverseEffectUrl"` // 反转svga效果 + SvipLevel int `json:"svipLevel"` + Svip rpc.CvSvip `json:"svip"` + MicEffect string `json:"micEffect"` //mic位置特效svga + HeadwearIcon string `json:"headwearIcon"` //头饰里面的小头像 } type MicNumChangeContent struct { @@ -405,19 +404,19 @@ func getMicIContent(model *domain.Model, groupId string, i int) (MicContent, err headwearIcon = cpUser.Avatar } micEffect = "https://image.whoisamy.shop/hilo/resource/svga/mic_effect_cp.svga" + micUserData.MicEffect = micEffect + micUserData.HeadwearIcon = headwearIcon } return MicContent{ - GroupId: txGroupId, - I: mic.I, - Lock: mic.Lock, - Forbid: micUser.Forbid, - MicForbid: mic.MicForbid, - ExternalId: micUser.ExternalId, - AgoraId: uint32(micUser.UserId), - Timestamp: time.Now().UnixNano(), - User: micUserData, - MicEffect: micEffect, - HeadwearIcon: headwearIcon, + GroupId: txGroupId, + I: mic.I, + Lock: mic.Lock, + Forbid: micUser.Forbid, + MicForbid: mic.MicForbid, + ExternalId: micUser.ExternalId, + AgoraId: uint32(micUser.UserId), + Timestamp: time.Now().UnixNano(), + User: micUserData, }, nil } @@ -467,23 +466,26 @@ func getMicUserDatas(model *domain.Model, userIds []uint64) (map[uint64]*MicUser } var headwearPicUrl string var headwearEffectUrl string + var reverseHeadwearEffectUrl string if headwearUser, flag := headwearMap[id]; flag { headwearPicUrl = resHeadwearMap[headwearUser.HeadwearId].PicUrl headwearEffectUrl = resHeadwearMap[headwearUser.HeadwearId].EffectUrl + reverseHeadwearEffectUrl = resHeadwearMap[headwearUser.HeadwearId].ReverseEffectUrl } micUserDataMap[id] = &MicUserData{ - Id: user.ID, - ExternalId: user.ExternalId, - Avatar: user.Avatar, - Nick: user.Nick, - Sex: user.Sex, - Code: user.Code, - IsVip: vipFlag, - NobleLeave: nobleMap[id], - HeadwearPicUrl: headwearPicUrl, - HeadwearEffectUrl: headwearEffectUrl, - SvipLevel: svips[id].SvipLevel, - Svip: rpc.CopySimpleSvip(svips[id]), + Id: user.ID, + ExternalId: user.ExternalId, + Avatar: user.Avatar, + Nick: user.Nick, + Sex: user.Sex, + Code: user.Code, + IsVip: vipFlag, + NobleLeave: nobleMap[id], + HeadwearPicUrl: headwearPicUrl, + HeadwearEffectUrl: headwearEffectUrl, + HeadwearReverseEffectUrl: reverseHeadwearEffectUrl, + SvipLevel: svips[id].SvipLevel, + Svip: rpc.CopySimpleSvip(svips[id]), } } return micUserDataMap, nil diff --git a/domain/model/res_m/headwear.go b/domain/model/res_m/headwear.go index 642b325c0182ce51dcb11f782caed59658d0b350..a14576f609e6777d65125aeff75e3417cc751a8f 100644 --- a/domain/model/res_m/headwear.go +++ b/domain/model/res_m/headwear.go @@ -10,10 +10,11 @@ import ( type ResHeadwear struct { mysql.Entity - *domain.Model `gorm:"-"` - Name mysql.Str - PicUrl mysql.Str - EffectUrl mysql.Str + *domain.Model `gorm:"-"` + Name mysql.Str + PicUrl mysql.Str + EffectUrl mysql.Str + ReverseEffectUrl mysql.Str } func GetResHeadwearById(model *domain.Model, id mysql.ID) (*ResHeadwear, error) {