2024-09-06 17:59:18 +08:00
|
|
|
package stat
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
2025-10-16 12:22:40 +08:00
|
|
|
"fmt"
|
2024-09-06 17:59:18 +08:00
|
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
|
|
)
|
|
|
|
|
|
|
|
type SyncGameServerListReq struct {
|
|
|
|
*requests.RpcRequest
|
|
|
|
}
|
|
|
|
|
|
|
|
type SyncGameServerListResp struct {
|
|
|
|
*responses.BaseResponse
|
|
|
|
Code int `json:"code"`
|
|
|
|
Msg string `json:"msg"`
|
|
|
|
Count int `json:"count"`
|
|
|
|
}
|
|
|
|
|
2025-10-15 15:26:09 +08:00
|
|
|
type GetGameServerCountDataReq struct {
|
|
|
|
*requests.RpcRequest
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetGameServerCountDataResp struct {
|
|
|
|
*responses.BaseResponse
|
2025-10-16 12:22:40 +08:00
|
|
|
Code int `json:"code"`
|
|
|
|
Msg string `json:"msg"`
|
|
|
|
Data GetGameServerCountData `json:"data"`
|
2025-10-15 15:26:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type GetGameServerCountData struct {
|
2025-10-15 16:29:48 +08:00
|
|
|
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"`
|
2025-10-15 15:26:09 +08:00
|
|
|
}
|
|
|
|
|
2025-10-16 11:13:41 +08:00
|
|
|
type GetGameServerCountDataParam struct {
|
|
|
|
GameSign string `json:"game_sign"`
|
2025-10-16 11:18:39 +08:00
|
|
|
ServerSign int64 `json:"server_sign"`
|
|
|
|
ServerId int64 `json:"server_id"`
|
2025-10-16 11:13:41 +08:00
|
|
|
RoleDates string `json:"role_dates"`
|
|
|
|
}
|
|
|
|
|
2024-09-06 17:59:18 +08:00
|
|
|
// CreateSyncGameServerListReq 创建同步开服数据请求
|
|
|
|
// opt: 更新 insertOrUpdate, 删除 del
|
|
|
|
//
|
|
|
|
// data: []map[string]interface{}{
|
|
|
|
// {
|
|
|
|
// "id": data.ID,
|
|
|
|
// "channel_id": data.ChannelID,
|
|
|
|
// "version_id": data.VersionID,
|
|
|
|
// "game_id": data.GameID,
|
|
|
|
// "server_id": data.ServerID,
|
|
|
|
// "game_sign": data.GameSign,
|
|
|
|
// "name": data.Name,
|
|
|
|
// "open_date": data.OpenDate.Format(constants.DateFormat),
|
|
|
|
// "open_time": data.OpenTime,
|
|
|
|
// "remark": data.Remark,
|
|
|
|
// "status": data.Status,
|
|
|
|
// "if_tj": data.IfTj,
|
|
|
|
// },
|
|
|
|
// }
|
|
|
|
func CreateSyncGameServerListReq(opt string, data []map[string]interface{}) *SyncGameServerListReq {
|
|
|
|
req := &SyncGameServerListReq{
|
|
|
|
&requests.RpcRequest{},
|
|
|
|
}
|
|
|
|
|
|
|
|
req.InitWithApiInfo(HOST, VERSION, "/game/syncGameServerList")
|
|
|
|
req.Method = requests.POST
|
|
|
|
|
|
|
|
marshal, _ := json.Marshal(data)
|
|
|
|
|
|
|
|
req.FormParams = map[string]string{
|
|
|
|
"opt": opt,
|
|
|
|
"data": string(marshal),
|
|
|
|
}
|
|
|
|
|
|
|
|
return req
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreateSyncGameServerListResp 创建同步开服数据响应
|
|
|
|
func CreateSyncGameServerListResp() *SyncGameServerListResp {
|
|
|
|
return &SyncGameServerListResp{
|
|
|
|
BaseResponse: &responses.BaseResponse{},
|
|
|
|
}
|
|
|
|
}
|
2025-10-15 15:26:09 +08:00
|
|
|
|
2025-10-16 11:13:41 +08:00
|
|
|
func CreateGetGameServerCountData(param GetGameServerCountDataParam) *GetGameServerCountDataReq {
|
2025-10-15 15:26:09 +08:00
|
|
|
req := &GetGameServerCountDataReq{
|
|
|
|
&requests.RpcRequest{},
|
|
|
|
}
|
|
|
|
|
|
|
|
req.InitWithApiInfo(HOST, VERSION, "/game/getGameServerCountData")
|
|
|
|
req.Method = requests.POST
|
|
|
|
req.FormParams = make(map[string]string)
|
2025-10-16 11:13:41 +08:00
|
|
|
req.FormParams["role_dates"] = param.RoleDates
|
2025-10-16 12:22:40 +08:00
|
|
|
req.FormParams["server_id"] = fmt.Sprintf("%v", param.ServerId)
|
|
|
|
req.FormParams["server_sign"] = fmt.Sprintf("%v", param.ServerSign)
|
2025-10-16 11:13:41 +08:00
|
|
|
req.FormParams["game_sign"] = param.GameSign
|
2025-10-15 15:26:09 +08:00
|
|
|
|
|
|
|
return req
|
|
|
|
}
|
|
|
|
|
|
|
|
func CreateGetGameServerCountDataResp() *GetGameServerCountDataResp {
|
|
|
|
return &GetGameServerCountDataResp{
|
|
|
|
BaseResponse: &responses.BaseResponse{},
|
|
|
|
}
|
|
|
|
}
|