新增获取区服统计数据接口
This commit is contained in:
parent
c753415404
commit
9bb792c453
@ -74,3 +74,13 @@ func (c *Client) GetUserTotalPay(req *GetUserTotalPayReq) (resp *GetUserTotalPay
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetGameServerCountData 获取区服统计数据
|
||||||
|
func (c *Client) GetGameServerCountData(req *GetGameServerCountDataReq) (resp *GetGameServerCountDataResp, err error) {
|
||||||
|
resp = CreateGetGameServerCountDataResp()
|
||||||
|
err = c.DoAction(req, resp)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@ -117,3 +117,20 @@ func TestGetUserTotalPay(t *testing.T) {
|
|||||||
}
|
}
|
||||||
fmt.Println(resp.Code, resp.Msg, resp.Data)
|
fmt.Println(resp.Code, resp.Msg, resp.Data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetGameServerCountData(t *testing.T) {
|
||||||
|
client, err := NewClient()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
req := CreateGetGameServerCountData(
|
||||||
|
"2024-07-30,2024-07-23",
|
||||||
|
"1111,1234",
|
||||||
|
)
|
||||||
|
resp, err := client.GetGameServerCountData(req)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(resp.Code, resp.Msg, resp.Data)
|
||||||
|
}
|
||||||
|
|||||||
@ -17,6 +17,24 @@ type SyncGameServerListResp struct {
|
|||||||
Count int `json:"count"`
|
Count int `json:"count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetGameServerCountDataReq struct {
|
||||||
|
*requests.RpcRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetGameServerCountDataResp struct {
|
||||||
|
*responses.BaseResponse
|
||||||
|
Code int `json:"code"`
|
||||||
|
Msg string `json:"msg"`
|
||||||
|
Data []GetGameServerCountData `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetGameServerCountData struct {
|
||||||
|
GameSign string `json:"game_sign"`
|
||||||
|
ServerId int64 `json:"server_id"`
|
||||||
|
RoleNum int64 `json:"role_num"`
|
||||||
|
TotalPayAmount float64 `json:"total_pay_amount"`
|
||||||
|
}
|
||||||
|
|
||||||
// CreateSyncGameServerListReq 创建同步开服数据请求
|
// CreateSyncGameServerListReq 创建同步开服数据请求
|
||||||
// opt: 更新 insertOrUpdate, 删除 del
|
// opt: 更新 insertOrUpdate, 删除 del
|
||||||
//
|
//
|
||||||
@ -60,3 +78,23 @@ func CreateSyncGameServerListResp() *SyncGameServerListResp {
|
|||||||
BaseResponse: &responses.BaseResponse{},
|
BaseResponse: &responses.BaseResponse{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CreateGetGameServerCountData(roleDates string, serverIds string) *GetGameServerCountDataReq {
|
||||||
|
req := &GetGameServerCountDataReq{
|
||||||
|
&requests.RpcRequest{},
|
||||||
|
}
|
||||||
|
|
||||||
|
req.InitWithApiInfo(HOST, VERSION, "/game/getGameServerCountData")
|
||||||
|
req.Method = requests.POST
|
||||||
|
req.FormParams = make(map[string]string)
|
||||||
|
req.FormParams["role_dates"] = roleDates
|
||||||
|
req.FormParams["server_ids"] = serverIds
|
||||||
|
|
||||||
|
return req
|
||||||
|
}
|
||||||
|
|
||||||
|
func CreateGetGameServerCountDataResp() *GetGameServerCountDataResp {
|
||||||
|
return &GetGameServerCountDataResp{
|
||||||
|
BaseResponse: &responses.BaseResponse{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user