新增game getGameClientInfo接口
This commit is contained in:
parent
32e21d0594
commit
791e916418
@ -138,3 +138,12 @@ func (c *Client) GetLabelListByCate(req *GetLabelListByCateRep) (response *GetLa
|
|||||||
err = c.DoAction(req, response)
|
err = c.DoAction(req, response)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetGameClientInfo
|
||||||
|
// 获取游戏版本信息
|
||||||
|
func (c *Client) GetGameClientInfo(gameId, status int64) (response *ClientInfoResp, err error) {
|
||||||
|
clientInfoReq := CreateClientInfoReq(status, gameId)
|
||||||
|
response = CreateClientInfoResp()
|
||||||
|
err = c.DoAction(clientInfoReq, response)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@ -241,3 +241,17 @@ func TestGetLoginBg(t *testing.T) {
|
|||||||
}
|
}
|
||||||
t.Log(getLoginBgResp)
|
t.Log(getLoginBgResp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetGameClientInfo(t *testing.T) {
|
||||||
|
client, err := NewClient()
|
||||||
|
if err != nil {
|
||||||
|
t.Log(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := client.GetGameClientInfo(8961, 4)
|
||||||
|
if err != nil {
|
||||||
|
t.Log(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_ = resp
|
||||||
|
}
|
||||||
|
|||||||
45
services/game/game_client.go
Normal file
45
services/game/game_client.go
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
package game
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||||
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ClientInfoReq struct {
|
||||||
|
*requests.RpcRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
type ClientInfoResp struct {
|
||||||
|
*responses.BaseResponse
|
||||||
|
Code int `json:"code"`
|
||||||
|
Msg string `json:"msg"`
|
||||||
|
Data []ClientInfoDataItem `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ClientInfoDataItem struct {
|
||||||
|
Id int `json:"id"`
|
||||||
|
GameName string `json:"game_name"`
|
||||||
|
Status int `json:"status"`
|
||||||
|
Version string `json:"version"`
|
||||||
|
GameId int `json:"game_id"`
|
||||||
|
RequestDomain string `json:"request_domain"`
|
||||||
|
SpareRequestDomain string `json:"spare_request_domain"`
|
||||||
|
OtherRequestDomain string `json:"other_request_domain"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func CreateClientInfoReq(status, gameId int64) *ClientInfoReq {
|
||||||
|
req := &ClientInfoReq{
|
||||||
|
&requests.RpcRequest{},
|
||||||
|
}
|
||||||
|
|
||||||
|
req.InitWithApiInfo(HOST, VERSION, fmt.Sprintf("/api/game/getGameClientInfo?game_id=%d&status=%d", gameId, status))
|
||||||
|
req.Method = requests.GET
|
||||||
|
return req
|
||||||
|
}
|
||||||
|
|
||||||
|
func CreateClientInfoResp() *ClientInfoResp {
|
||||||
|
return &ClientInfoResp{
|
||||||
|
BaseResponse: &responses.BaseResponse{},
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user