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 { if err != nil {
return return
} }
fmt.Println(string(body))
baseResponse.httpStatus = httpResponse.StatusCode baseResponse.httpStatus = httpResponse.StatusCode
baseResponse.httpHeaders = httpResponse.Header baseResponse.httpHeaders = httpResponse.Header
baseResponse.httpContentBytes = body baseResponse.httpContentBytes = body

View File

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

View File

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