新增踢人接口
This commit is contained in:
parent
0f671231b5
commit
13a6e20087
@ -116,3 +116,10 @@ func (c *Client) GetProtocolByCompany(req *GetProtocolByCompanyRep) (resp *GetPr
|
||||
err = c.DoAction(req, resp)
|
||||
return
|
||||
}
|
||||
|
||||
// KickUser 踢人
|
||||
func (c *Client) KickUser(req *KickUserReq) (resp *KickUserResp, err error) {
|
||||
resp = CreateKickUserResp()
|
||||
err = c.DoAction(req, resp)
|
||||
return
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package game
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestGetGameOsInfo(t *testing.T) {
|
||||
@ -211,3 +212,18 @@ func TestClient_GetProtocolByCompany(t *testing.T) {
|
||||
}
|
||||
t.Log(resp.Code, resp.Msg, resp.Data.Content)
|
||||
}
|
||||
|
||||
// 测试踢人
|
||||
func TestKickUser(t *testing.T) {
|
||||
client, err := NewClient()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
} // CreateKickUserReq
|
||||
getRealAuthBlackListReq := CreateKickUserReq(8677, 123, "8676", time.Now().Unix())
|
||||
kickUserResp, err := client.KickUser(getRealAuthBlackListReq)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
t.Log(kickUserResp)
|
||||
}
|
||||
|
@ -442,3 +442,49 @@ func CreateGetGameRealAuthInfoResp() *GetGameRealAuthInfoResp {
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
}
|
||||
|
||||
// KickUserReq
|
||||
// 踢人下线
|
||||
type KickUserReq struct {
|
||||
*requests.RpcRequest
|
||||
GameId int64 `position:"Body" field:"game_id" default:"-" `
|
||||
Uid int64 `position:"Body" field:"uid" default:"-" `
|
||||
ServerSign string `position:"Body" field:"server_sign" default:"-" `
|
||||
Time int64 `position:"Body" field:"time" default:"-" `
|
||||
}
|
||||
|
||||
type KickUserRespDataCallCpInfo struct {
|
||||
Url string `json:"url"`
|
||||
RequestParam map[string]any `json:"request_param"`
|
||||
Response map[string]any `json:"response"`
|
||||
}
|
||||
|
||||
type KickUserRespData struct {
|
||||
CallCpInfo KickUserRespDataCallCpInfo `json:"call_cp_info"`
|
||||
}
|
||||
|
||||
type KickUserResp struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data KickUserRespData `json:"data"`
|
||||
}
|
||||
|
||||
func CreateKickUserReq(gameId int64, uid int64, serverSign string, time int64) *KickUserReq {
|
||||
req := &KickUserReq{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
GameId: gameId,
|
||||
Uid: uid,
|
||||
ServerSign: serverSign,
|
||||
Time: time,
|
||||
}
|
||||
req.InitWithApiInfo(HOST, VERSION, "/api/game/kickUser")
|
||||
req.Method = requests.POST
|
||||
return req
|
||||
}
|
||||
|
||||
func CreateKickUserResp() *KickUserResp {
|
||||
return &KickUserResp{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user