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
7dc2b033
Commit
7dc2b033
authored
Aug 03, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上麦
parent
0dd8eeac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
group.go
rpc/group.go
+36
-0
No files found.
rpc/group.go
View file @
7dc2b033
...
...
@@ -2,12 +2,14 @@ package rpc
import
(
"encoding/json"
"errors"
"fmt"
"git.hilo.cn/hilo-common/_const/enum/timezone_e"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mylogrus"
"git.hilo.cn/hilo-common/resource/consul"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/utils"
"math/rand"
)
...
...
@@ -190,3 +192,37 @@ func getGroupHost() string {
mylogrus
.
MyLog
.
Infof
(
"getHostGroup:%v---%v"
,
r
,
groupServerHost
[
r
])
return
groupServerHost
[
r
]
}
// 活动积分增加 fType: 1.上麦 2.ludo游戏完成 3.slots游戏完成 4.fruit游戏完成 5.特定座驾进入房间
func
MicIn
(
model
*
domain
.
Model
,
groupId
,
nonce
,
token
string
)
error
{
defer
utils
.
CheckGoPanic
()
type
MicInResp
struct
{
Code
int
`json:"code"`
Data
struct
{
MicIndex
int
`json:"micIndex"`
}
`json:"data"`
}
_url
:=
fmt
.
Sprintf
(
"%v://%v/v1/imGroup/mic/in"
,
defaultGroupServerScheme
,
getGroupHost
())
header
:=
map
[
string
]
string
{
"nonce"
:
nonce
,
"token"
:
token
,
}
resp
,
err
:=
HttpPostForm
(
model
,
_url
,
header
,
map
[
string
]
string
{
"groupUuid"
:
groupId
,
"i"
:
""
,
// 空则随意上一个空位置
})
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"MicIn fail:%v"
,
err
)
return
err
}
response
:=
new
(
MicInResp
)
if
err
=
json
.
Unmarshal
(
resp
,
response
);
err
!=
nil
{
model
.
Log
.
Errorf
(
"MicIn json fail:%v"
,
err
)
return
err
}
if
response
.
Code
!=
200
||
response
.
Data
.
MicIndex
<
0
{
model
.
Log
.
Errorf
(
fmt
.
Sprintf
(
"Mic In Not 200:%v,groupId:%v"
,
response
,
groupId
))
return
errors
.
New
(
fmt
.
Sprintf
(
"Mic In Not 200:%v"
,
response
))
}
return
nil
}
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