Commit 6ea0c337 authored by hujiebin's avatar hujiebin

cp进场特效信息

parent 7b67793b
......@@ -457,3 +457,39 @@ func GetUserCp(model *domain.Model, userId mysql.ID) (*CvCp, error) {
}
return nil, nil
}
// cp进场特效信息
type CvCpEntryEffect struct {
CpLevel int `json:"cpLevel"`
CpUserAvatar string `json:"cpUserAvatar"`
CpEntryEffect bool `json:"cpEntryEffect"`
}
// 获取用户cp进房特效
func GetUserCpEntryEffect(model *domain.Model, userId mysql.ID) (*CvCpEntryEffect, error) {
type Response struct {
Code int `json:"code"`
Message string `json:"message"`
Data *CvCpEntryEffect `json:"data"`
}
header := map[string]string{
mycontext.TRACEID: model.GetTraceId(),
}
_url := fmt.Sprintf("%v://%v/inner/user/cp/entryEffect", defaultUserServerScheme, getUserHost())
resp, err := HttpGet(model, _url, header, map[string][]string{
"id": {fmt.Sprintf("%d", userId)},
})
if err != nil {
model.Log.Errorf("GetUserCp fail:%v", err)
return nil, err
}
response := new(Response)
if err = json.Unmarshal(resp, response); err != nil {
model.Log.Errorf("GetUserCp json fail:%v", err)
return nil, err
}
if response.Data != nil {
return response.Data, nil
}
return nil, nil
}
......@@ -18,3 +18,8 @@ func TestMGetUserOnMic(t *testing.T) {
res, err := rpc.MGetUserOnMic(domain.CreateModelNil(), "2023-04-11", []mysql.ID{4556, 4549}, timezone_e.TimezoneKSA)
fmt.Printf("%+v,err:%v", res, err)
}
func TestGetUserCpEntryEffect(t *testing.T) {
res, err := rpc.GetUserCpEntryEffect(domain.CreateModelNil(), 7642)
fmt.Printf("%v-%v", res, err)
}
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