Commit 86bd19b1 authored by hujiebin's avatar hujiebin

feat:反转svga

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