Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujiebin
hilo-common
Commits
6ea0c337
Commit
6ea0c337
authored
Jun 21, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cp进场特效信息
parent
7b67793b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
user.go
rpc/user.go
+36
-0
rpc_test.go
test/rpc_test.go
+5
-0
No files found.
rpc/user.go
View file @
6ea0c337
...
@@ -457,3 +457,39 @@ func GetUserCp(model *domain.Model, userId mysql.ID) (*CvCp, error) {
...
@@ -457,3 +457,39 @@ func GetUserCp(model *domain.Model, userId mysql.ID) (*CvCp, error) {
}
}
return
nil
,
nil
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
}
test/rpc_test.go
View file @
6ea0c337
...
@@ -18,3 +18,8 @@ func TestMGetUserOnMic(t *testing.T) {
...
@@ -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
)
res
,
err
:=
rpc
.
MGetUserOnMic
(
domain
.
CreateModelNil
(),
"2023-04-11"
,
[]
mysql
.
ID
{
4556
,
4549
},
timezone_e
.
TimezoneKSA
)
fmt
.
Printf
(
"%+v,err:%v"
,
res
,
err
)
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
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment