7
0

Compare commits

..

No commits in common. "ac55968c24e09848e7924d623d487192f576b099" and "ca0c051b4a3c22075f2e8d46831599b2ec89ec2f" have entirely different histories.

3 changed files with 26 additions and 13 deletions

View File

@ -65,7 +65,6 @@ func (baseResponse *BaseResponse) parseFromHttpResponse(httpResponse *http.Respo
if err != nil {
return
}
fmt.Println(string(body))
baseResponse.httpStatus = httpResponse.StatusCode
baseResponse.httpHeaders = httpResponse.Header
baseResponse.httpContentBytes = body

View File

@ -123,10 +123,11 @@ func TestGetGameServerCountData(t *testing.T) {
if err != nil {
panic(err)
}
req := CreateGetGameServerCountDataReq(&GetGameServerCountDataReq{
GameIds: []int64{3706},
ServerId: 203902,
RoleDates: []string{"2023-10-09", "2024-02-06"},
req := CreateGetGameServerCountData(GetGameServerCountDataParam{
GameSign: "cs140",
ServerSign: 8678,
ServerId: 1944,
RoleDates: "2025-10-15",
})
resp, err := client.GetGameServerCountData(req)
if err != nil {

View File

@ -2,6 +2,7 @@ package stat
import (
"encoding/json"
"fmt"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
@ -18,10 +19,7 @@ type SyncGameServerListResp struct {
}
type GetGameServerCountDataReq struct {
*requests.JsonRequest
GameIds []int64 `position:"Json" field:"game_ids" json:"game_ids"`
ServerId int64 `position:"Json" field:"server_id" json:"server_id"`
RoleDates []string `position:"Json" field:"role_dates" json:"role_dates"`
*requests.RpcRequest
}
type GetGameServerCountDataResp struct {
@ -32,12 +30,20 @@ type GetGameServerCountDataResp struct {
}
type GetGameServerCountData struct {
ServerID int64 `json:"server_id"`
GameSign string `json:"game_sign"`
ServerId int64 `json:"server_id"`
RoleNum int64 `json:"role_num"`
TotalPayAmount float64 `json:"total_pay_amount"`
TotalPayRoleNum int64 `json:"total_pay_role_num"`
}
type GetGameServerCountDataParam struct {
GameSign string `json:"game_sign"`
ServerSign int64 `json:"server_sign"`
ServerId int64 `json:"server_id"`
RoleDates string `json:"role_dates"`
}
// CreateSyncGameServerListReq 创建同步开服数据请求
// opt: 更新 insertOrUpdate, 删除 del
//
@ -82,12 +88,19 @@ func CreateSyncGameServerListResp() *SyncGameServerListResp {
}
}
func CreateGetGameServerCountDataReq(req *GetGameServerCountDataReq) *GetGameServerCountDataReq {
if req.JsonRequest == nil {
req.JsonRequest = &requests.JsonRequest{}
func CreateGetGameServerCountData(param GetGameServerCountDataParam) *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"] = param.RoleDates
req.FormParams["server_id"] = fmt.Sprintf("%v", param.ServerId)
req.FormParams["server_sign"] = fmt.Sprintf("%v", param.ServerSign)
req.FormParams["game_sign"] = param.GameSign
return req
}