Commit 86bd19b1 authored by hujiebin's avatar hujiebin

feat:反转svga

parent bc9fd55e
......@@ -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
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment