From 939f4fd22b827955d4fc64e5b92e026b8445b65b Mon Sep 17 00:00:00 2001 From: luoxun Date: Tue, 9 Jun 2026 17:24:30 +0800 Subject: [PATCH 1/5] =?UTF-8?q?dms=E8=BF=90=E8=90=A5sdk=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/big-data/client.go | 2 +- services/big-data/get_user_profile.go | 102 +++++++++++++++++++++++--- 2 files changed, 92 insertions(+), 12 deletions(-) diff --git a/services/big-data/client.go b/services/big-data/client.go index 945293a..98882dd 100644 --- a/services/big-data/client.go +++ b/services/big-data/client.go @@ -10,7 +10,7 @@ const ( ) var HOST requests.Host = requests.Host{ - Default: "dms-api.gaore.com", + Default: "dms-api", } type Client struct { diff --git a/services/big-data/get_user_profile.go b/services/big-data/get_user_profile.go index 7e960b9..f4b4789 100644 --- a/services/big-data/get_user_profile.go +++ b/services/big-data/get_user_profile.go @@ -1,13 +1,17 @@ package big_data import ( + "bytes" "encoding/json" + "io" + "strings" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" ) // GetUserProfileParam 用户筛选/圈选查询参数 +// 说明:金额类筛选用 *int64,未设置(nil)时不参与筛选;切片为空表示不限定该条件 type GetUserProfileParam struct { UserName []string `json:"user_name"` UserName2 []string `json:"user_name2"` @@ -21,13 +25,13 @@ type GetUserProfileParam struct { TradeOrderId []string `json:"trade_order_id"` GameSign []string `json:"game_sign"` GameId []string `json:"game_id"` - RegisterDate []string `json:"register_date"` // 区间 [开始, 结束] - LastLoginDate []string `json:"last_login_date"` // 区间 [开始, 结束] - LastPayDate []string `json:"last_pay_date"` // 区间 [开始, 结束] - PayAmtAccMin int64 `json:"pay_amt_acc_min"` - PayAmtAccMax int64 `json:"pay_amt_acc_max"` - LastPayAmountMin int64 `json:"last_pay_amount_min"` - LastPayAmountMax int64 `json:"last_pay_amount_max"` + RegisterDate []string `json:"register_date"` // 区间 [开始, 结束] + LastLoginDate []string `json:"last_login_date"` // 区间 [开始, 结束] + LastPayDate []string `json:"last_pay_date"` // 区间 [开始, 结束] + PayAmtAccMin *int64 `json:"pay_amt_acc_min"` + PayAmtAccMax *int64 `json:"pay_amt_acc_max"` + LastPayAmountMin *int64 `json:"last_pay_amount_min"` + LastPayAmountMax *int64 `json:"last_pay_amount_max"` Page int `json:"page"` PageSize int `json:"page_size"` XDebug string `json:"x_debug"` // 测试环境调试头,正式调用可留空 @@ -51,16 +55,92 @@ type GetUserProfileRequest struct { RegisterDate []string `position:"Json" field:"register_date"` LastLoginDate []string `position:"Json" field:"last_login_date"` LastPayDate []string `position:"Json" field:"last_pay_date"` - PayAmtAccMin int64 `position:"Json" field:"pay_amt_acc_min"` - PayAmtAccMax int64 `position:"Json" field:"pay_amt_acc_max"` - LastPayAmountMin int64 `position:"Json" field:"last_pay_amount_min"` - LastPayAmountMax int64 `position:"Json" field:"last_pay_amount_max"` + PayAmtAccMin *int64 `position:"Json" field:"pay_amt_acc_min"` + PayAmtAccMax *int64 `position:"Json" field:"pay_amt_acc_max"` + LastPayAmountMin *int64 `position:"Json" field:"last_pay_amount_min"` + LastPayAmountMax *int64 `position:"Json" field:"last_pay_amount_max"` Page int `position:"Json" field:"page"` PageSize int `position:"Json" field:"page_size"` Authorization string `position:"Header" field:"Authorization"` XDebug string `position:"Header" field:"x-debug"` } +// getUserProfileBody 自定义请求体序列化结构,绕开 core 的反射序列化(JsonParams): +// - 金额字段 *int64 + omitempty:未设置(nil)时该字段不出现在 JSON 中,避免 0 被 DMS 当成真实筛选条件; +// - 切片字段统一为非 nil 空数组 []:避免 nil 被序列化成 null 触发 DMS 类型校验失败。 +type getUserProfileBody struct { + UserName []string `json:"user_name"` + UserName2 []string `json:"user_name2"` + Uid []string `json:"uid"` + RoleId []string `json:"role_id"` + RoleName []string `json:"role_name"` + RoleNameLike string `json:"role_name_like,omitempty"` + LabelId []int `json:"label_id"` + WeworkTag []string `json:"wework_tag"` + OrderId []string `json:"order_id"` + TradeOrderId []string `json:"trade_order_id"` + GameSign []string `json:"game_sign"` + GameId []string `json:"game_id"` + RegisterDate []string `json:"register_date"` + LastLoginDate []string `json:"last_login_date"` + LastPayDate []string `json:"last_pay_date"` + PayAmtAccMin *int64 `json:"pay_amt_acc_min,omitempty"` + PayAmtAccMax *int64 `json:"pay_amt_acc_max,omitempty"` + LastPayAmountMin *int64 `json:"last_pay_amount_min,omitempty"` + LastPayAmountMax *int64 `json:"last_pay_amount_max,omitempty"` + Page int `json:"page"` + PageSize int `json:"page_size"` +} + +// GetBodyReader 覆盖 JsonRequest 默认实现,使用自定义结构序列化 body。 +// 鉴权头(Authorization / x-debug)仍由 core 的 InitParam 按 Header 字段设置,不受影响。 +func (request *GetUserProfileRequest) GetBodyReader() io.Reader { + body := getUserProfileBody{ + UserName: emptyStrSlice(request.UserName), + UserName2: emptyStrSlice(request.UserName2), + Uid: emptyStrSlice(request.Uid), + RoleId: emptyStrSlice(request.RoleId), + RoleName: emptyStrSlice(request.RoleName), + RoleNameLike: request.RoleNameLike, + LabelId: emptyIntSlice(request.LabelId), + WeworkTag: emptyStrSlice(request.WeworkTag), + OrderId: emptyStrSlice(request.OrderId), + TradeOrderId: emptyStrSlice(request.TradeOrderId), + GameSign: emptyStrSlice(request.GameSign), + GameId: emptyStrSlice(request.GameId), + RegisterDate: emptyStrSlice(request.RegisterDate), + LastLoginDate: emptyStrSlice(request.LastLoginDate), + LastPayDate: emptyStrSlice(request.LastPayDate), + PayAmtAccMin: request.PayAmtAccMin, + PayAmtAccMax: request.PayAmtAccMax, + LastPayAmountMin: request.LastPayAmountMin, + LastPayAmountMax: request.LastPayAmountMax, + Page: request.Page, + PageSize: request.PageSize, + } + b, err := json.Marshal(body) + if err != nil { + return strings.NewReader("") + } + return bytes.NewReader(b) +} + +// emptyStrSlice 将 nil 切片转成非 nil 空切片,避免序列化成 JSON null +func emptyStrSlice(s []string) []string { + if s == nil { + return []string{} + } + return s +} + +// emptyIntSlice 同 emptyStrSlice,针对 label_id 等 []int 字段 +func emptyIntSlice(s []int) []int { + if s == nil { + return []int{} + } + return s +} + // GetUserProfileResponse 用户筛选/圈选查询响应(返回不做处理,data 原样透出) type GetUserProfileResponse struct { *responses.BaseResponse From d4201e27afafbd8db1bb2ae39b42430bf910cafb Mon Sep 17 00:00:00 2001 From: luoxun Date: Tue, 9 Jun 2026 18:08:56 +0800 Subject: [PATCH 2/5] =?UTF-8?q?dms=E8=BF=90=E8=90=A5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/big-data/client.go | 7 ++ services/big-data/get_user_login_log.go | 126 ++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 services/big-data/get_user_login_log.go diff --git a/services/big-data/client.go b/services/big-data/client.go index 98882dd..e0b5fa2 100644 --- a/services/big-data/client.go +++ b/services/big-data/client.go @@ -36,3 +36,10 @@ func (c *Client) GetUserProfile(req *GetUserProfileRequest) (response *GetUserPr err = c.DoAction(req, response) return } + +// GetUserLoginLog 用户登录日志查询 +func (c *Client) GetUserLoginLog(req *GetUserLoginLogRequest) (response *GetUserLoginLogResponse, err error) { + response = CreateGetUserLoginLogResponse() + err = c.DoAction(req, response) + return +} diff --git a/services/big-data/get_user_login_log.go b/services/big-data/get_user_login_log.go new file mode 100644 index 0000000..2a5757b --- /dev/null +++ b/services/big-data/get_user_login_log.go @@ -0,0 +1,126 @@ +package big_data + +import ( + "bytes" + "encoding/json" + "io" + "strings" + + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +// GetUserLoginLogParam 用户登录日志查询参数 +// 说明:切片为空表示不限定该条件;标量字符串为空时不参与筛选 +type GetUserLoginLogParam struct { + Uid string `json:"uid"` + EventTime string `json:"event_time"` // 形如 "2026-06" + GameSign string `json:"game_sign"` + ServerGroupId []string `json:"server_group_id"` + GameId string `json:"game_id"` + Os []string `json:"os"` + OsTwo []string `json:"os_two"` + Ip string `json:"ip"` + DeviceId string `json:"device_id"` + Page int `json:"page"` + PageSize int `json:"page_size"` + XDebug string `json:"x_debug"` // 测试环境调试头,正式调用可留空 +} + +// GetUserLoginLogRequest 用户登录日志查询请求 +type GetUserLoginLogRequest struct { + *requests.JsonRequest + Uid string `position:"Json" field:"uid"` + EventTime string `position:"Json" field:"event_time"` + GameSign string `position:"Json" field:"game_sign"` + ServerGroupId []string `position:"Json" field:"server_group_id"` + GameId string `position:"Json" field:"game_id"` + Os []string `position:"Json" field:"os"` + OsTwo []string `position:"Json" field:"os_two"` + Ip string `position:"Json" field:"ip"` + DeviceId string `position:"Json" field:"device_id"` + Page int `position:"Json" field:"page"` + PageSize int `position:"Json" field:"page_size"` + Authorization string `position:"Header" field:"Authorization"` + XDebug string `position:"Header" field:"x-debug"` +} + +// getUserLoginLogBody 自定义请求体序列化结构,绕开 core 的反射序列化(JsonParams): +// - 切片字段统一为非 nil 空数组 []:避免 nil 被序列化成 null 触发 DMS 类型校验失败; +// - 标量字符串用 omitempty:空串时不出现在 JSON 中,避免被 DMS 当成真实筛选条件。 +type getUserLoginLogBody struct { + Uid string `json:"uid,omitempty"` + EventTime string `json:"event_time,omitempty"` + GameSign string `json:"game_sign,omitempty"` + ServerGroupId []string `json:"server_group_id"` + GameId string `json:"game_id,omitempty"` + Os []string `json:"os"` + OsTwo []string `json:"os_two"` + Ip string `json:"ip,omitempty"` + DeviceId string `json:"device_id,omitempty"` + Page int `json:"page"` + PageSize int `json:"page_size"` +} + +// GetBodyReader 覆盖 JsonRequest 默认实现,使用自定义结构序列化 body。 +// 鉴权头(Authorization / x-debug)仍由 core 的 InitParam 按 Header 字段设置,不受影响。 +func (request *GetUserLoginLogRequest) GetBodyReader() io.Reader { + body := getUserLoginLogBody{ + Uid: request.Uid, + EventTime: request.EventTime, + GameSign: request.GameSign, + ServerGroupId: emptyStrSlice(request.ServerGroupId), + GameId: request.GameId, + Os: emptyStrSlice(request.Os), + OsTwo: emptyStrSlice(request.OsTwo), + Ip: request.Ip, + DeviceId: request.DeviceId, + Page: request.Page, + PageSize: request.PageSize, + } + b, err := json.Marshal(body) + if err != nil { + return strings.NewReader("") + } + return bytes.NewReader(b) +} + +// GetUserLoginLogResponse 用户登录日志查询响应(返回不做处理,data 原样透出) +type GetUserLoginLogResponse struct { + *responses.BaseResponse + Code int `json:"code"` + Message string `json:"message"` + Data json.RawMessage `json:"data"` +} + +// CreateGetUserLoginLogRequest 创建用户登录日志查询请求 +// token 为 GetToken 返回的 data.token,直接放入 Authorization 头 +func CreateGetUserLoginLogRequest(token string, param GetUserLoginLogParam) *GetUserLoginLogRequest { + req := &GetUserLoginLogRequest{ + JsonRequest: &requests.JsonRequest{}, + Uid: param.Uid, + EventTime: param.EventTime, + GameSign: param.GameSign, + ServerGroupId: param.ServerGroupId, + GameId: param.GameId, + Os: param.Os, + OsTwo: param.OsTwo, + Ip: param.Ip, + DeviceId: param.DeviceId, + Page: param.Page, + PageSize: param.PageSize, + Authorization: token, + XDebug: param.XDebug, + } + req.InitWithApiInfo(HOST, VERSION, "/api/internal/v1/get_user_login_log") + req.Method = requests.POST + req.Scheme = requests.HTTPS + return req +} + +// CreateGetUserLoginLogResponse 创建用户登录日志查询响应 +func CreateGetUserLoginLogResponse() *GetUserLoginLogResponse { + return &GetUserLoginLogResponse{ + BaseResponse: &responses.BaseResponse{}, + } +} From 2772d761c6573f4ac7466f09e2bc015ddc7c554e Mon Sep 17 00:00:00 2001 From: luoxun Date: Wed, 10 Jun 2026 09:52:07 +0800 Subject: [PATCH 3/5] =?UTF-8?q?dms=E8=BF=90=E8=90=A5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=9B=E8=A7=92=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/big-data/client.go | 7 ++ services/big-data/get_role_create_log.go | 142 +++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 services/big-data/get_role_create_log.go diff --git a/services/big-data/client.go b/services/big-data/client.go index e0b5fa2..78ad07e 100644 --- a/services/big-data/client.go +++ b/services/big-data/client.go @@ -43,3 +43,10 @@ func (c *Client) GetUserLoginLog(req *GetUserLoginLogRequest) (response *GetUser err = c.DoAction(req, response) return } + +// GetRoleCreateLog 角色创建日志查询 +func (c *Client) GetRoleCreateLog(req *GetRoleCreateLogRequest) (response *GetRoleCreateLogResponse, err error) { + response = CreateGetRoleCreateLogResponse() + err = c.DoAction(req, response) + return +} diff --git a/services/big-data/get_role_create_log.go b/services/big-data/get_role_create_log.go new file mode 100644 index 0000000..581aff0 --- /dev/null +++ b/services/big-data/get_role_create_log.go @@ -0,0 +1,142 @@ +package big_data + +import ( + "bytes" + "encoding/json" + "io" + "strings" + + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +// GetRoleCreateLogParam 角色创建日志查询参数 +// 说明:数值区间用 *int64,未设置(nil)时不参与筛选;切片为空表示不限定该条件 +type GetRoleCreateLogParam struct { + Uid string `json:"uid"` + EventTime []string `json:"event_time"` // 区间 [开始, 结束] + GameSign []string `json:"game_sign"` + GameId []string `json:"game_id"` + RoleName []string `json:"role_name"` + RoleId []string `json:"role_id"` + ServerName []string `json:"server_name"` + ServerId []string `json:"server_id"` + RoleLevelMin *int64 `json:"role_level_min"` + RoleLevelMax *int64 `json:"role_level_max"` + PayAmtAccMin *int64 `json:"pay_amt_acc_min"` + PayAmtAccMax *int64 `json:"pay_amt_acc_max"` + Page int `json:"page"` + PageSize int `json:"page_size"` + XDebug string `json:"x_debug"` // 测试环境调试头,正式调用可留空 +} + +// GetRoleCreateLogRequest 角色创建日志查询请求 +type GetRoleCreateLogRequest struct { + *requests.JsonRequest + Uid string `position:"Json" field:"uid"` + EventTime []string `position:"Json" field:"event_time"` + GameSign []string `position:"Json" field:"game_sign"` + GameId []string `position:"Json" field:"game_id"` + RoleName []string `position:"Json" field:"role_name"` + RoleId []string `position:"Json" field:"role_id"` + ServerName []string `position:"Json" field:"server_name"` + ServerId []string `position:"Json" field:"server_id"` + RoleLevelMin *int64 `position:"Json" field:"role_level_min"` + RoleLevelMax *int64 `position:"Json" field:"role_level_max"` + PayAmtAccMin *int64 `position:"Json" field:"pay_amt_acc_min"` + PayAmtAccMax *int64 `position:"Json" field:"pay_amt_acc_max"` + Page int `position:"Json" field:"page"` + PageSize int `position:"Json" field:"page_size"` + Authorization string `position:"Header" field:"Authorization"` + XDebug string `position:"Header" field:"x-debug"` +} + +// getRoleCreateLogBody 自定义请求体序列化结构,绕开 core 的反射序列化(JsonParams): +// - 数值字段 *int64 + omitempty:未设置(nil)时该字段不出现在 JSON 中,避免 0 被 DMS 当成真实筛选条件; +// - 切片字段统一为非 nil 空数组 []:避免 nil 被序列化成 null 触发 DMS 类型校验失败; +// - 标量字符串用 omitempty:空串时不出现在 JSON 中。 +type getRoleCreateLogBody struct { + Uid string `json:"uid,omitempty"` + EventTime []string `json:"event_time"` + GameSign []string `json:"game_sign"` + GameId []string `json:"game_id"` + RoleName []string `json:"role_name"` + RoleId []string `json:"role_id"` + ServerName []string `json:"server_name"` + ServerId []string `json:"server_id"` + RoleLevelMin *int64 `json:"role_level_min,omitempty"` + RoleLevelMax *int64 `json:"role_level_max,omitempty"` + PayAmtAccMin *int64 `json:"pay_amt_acc_min,omitempty"` + PayAmtAccMax *int64 `json:"pay_amt_acc_max,omitempty"` + Page int `json:"page"` + PageSize int `json:"page_size"` +} + +// GetBodyReader 覆盖 JsonRequest 默认实现,使用自定义结构序列化 body。 +// 鉴权头(Authorization / x-debug)仍由 core 的 InitParam 按 Header 字段设置,不受影响。 +func (request *GetRoleCreateLogRequest) GetBodyReader() io.Reader { + body := getRoleCreateLogBody{ + Uid: request.Uid, + EventTime: emptyStrSlice(request.EventTime), + GameSign: emptyStrSlice(request.GameSign), + GameId: emptyStrSlice(request.GameId), + RoleName: emptyStrSlice(request.RoleName), + RoleId: emptyStrSlice(request.RoleId), + ServerName: emptyStrSlice(request.ServerName), + ServerId: emptyStrSlice(request.ServerId), + RoleLevelMin: request.RoleLevelMin, + RoleLevelMax: request.RoleLevelMax, + PayAmtAccMin: request.PayAmtAccMin, + PayAmtAccMax: request.PayAmtAccMax, + Page: request.Page, + PageSize: request.PageSize, + } + b, err := json.Marshal(body) + if err != nil { + return strings.NewReader("") + } + return bytes.NewReader(b) +} + +// GetRoleCreateLogResponse 角色创建日志查询响应(返回不做处理,data 原样透出) +type GetRoleCreateLogResponse struct { + *responses.BaseResponse + Code int `json:"code"` + Message string `json:"message"` + Data json.RawMessage `json:"data"` +} + +// CreateGetRoleCreateLogRequest 创建角色创建日志查询请求 +// token 为 GetToken 返回的 data.token,直接放入 Authorization 头 +func CreateGetRoleCreateLogRequest(token string, param GetRoleCreateLogParam) *GetRoleCreateLogRequest { + req := &GetRoleCreateLogRequest{ + JsonRequest: &requests.JsonRequest{}, + Uid: param.Uid, + EventTime: param.EventTime, + GameSign: param.GameSign, + GameId: param.GameId, + RoleName: param.RoleName, + RoleId: param.RoleId, + ServerName: param.ServerName, + ServerId: param.ServerId, + RoleLevelMin: param.RoleLevelMin, + RoleLevelMax: param.RoleLevelMax, + PayAmtAccMin: param.PayAmtAccMin, + PayAmtAccMax: param.PayAmtAccMax, + Page: param.Page, + PageSize: param.PageSize, + Authorization: token, + XDebug: param.XDebug, + } + req.InitWithApiInfo(HOST, VERSION, "/api/internal/v1/get_role_create_log") + req.Method = requests.POST + req.Scheme = requests.HTTPS + return req +} + +// CreateGetRoleCreateLogResponse 创建角色创建日志查询响应 +func CreateGetRoleCreateLogResponse() *GetRoleCreateLogResponse { + return &GetRoleCreateLogResponse{ + BaseResponse: &responses.BaseResponse{}, + } +} From a23ea97993214640650e2887ada5c0a0c06e64ff Mon Sep 17 00:00:00 2001 From: luoxun Date: Wed, 10 Jun 2026 10:35:07 +0800 Subject: [PATCH 4/5] =?UTF-8?q?dms=E8=BF=90=E8=90=A5=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E5=88=9B=E8=A7=92=E8=AE=B0=E5=BD=95=E4=BF=AE=E6=94=B9=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/big-data/get_role_create_log.go | 50 ++++++++++++------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/services/big-data/get_role_create_log.go b/services/big-data/get_role_create_log.go index 581aff0..ba034ad 100644 --- a/services/big-data/get_role_create_log.go +++ b/services/big-data/get_role_create_log.go @@ -15,12 +15,12 @@ import ( type GetRoleCreateLogParam struct { Uid string `json:"uid"` EventTime []string `json:"event_time"` // 区间 [开始, 结束] - GameSign []string `json:"game_sign"` - GameId []string `json:"game_id"` - RoleName []string `json:"role_name"` - RoleId []string `json:"role_id"` - ServerName []string `json:"server_name"` - ServerId []string `json:"server_id"` + GameSign string `json:"game_sign"` + GameId string `json:"game_id"` + RoleName string `json:"role_name"` + RoleId string `json:"role_id"` + ServerName string `json:"server_name"` + ServerId string `json:"server_id"` RoleLevelMin *int64 `json:"role_level_min"` RoleLevelMax *int64 `json:"role_level_max"` PayAmtAccMin *int64 `json:"pay_amt_acc_min"` @@ -35,12 +35,12 @@ type GetRoleCreateLogRequest struct { *requests.JsonRequest Uid string `position:"Json" field:"uid"` EventTime []string `position:"Json" field:"event_time"` - GameSign []string `position:"Json" field:"game_sign"` - GameId []string `position:"Json" field:"game_id"` - RoleName []string `position:"Json" field:"role_name"` - RoleId []string `position:"Json" field:"role_id"` - ServerName []string `position:"Json" field:"server_name"` - ServerId []string `position:"Json" field:"server_id"` + GameSign string `position:"Json" field:"game_sign"` + GameId string `position:"Json" field:"game_id"` + RoleName string `position:"Json" field:"role_name"` + RoleId string `position:"Json" field:"role_id"` + ServerName string `position:"Json" field:"server_name"` + ServerId string `position:"Json" field:"server_id"` RoleLevelMin *int64 `position:"Json" field:"role_level_min"` RoleLevelMax *int64 `position:"Json" field:"role_level_max"` PayAmtAccMin *int64 `position:"Json" field:"pay_amt_acc_min"` @@ -53,17 +53,17 @@ type GetRoleCreateLogRequest struct { // getRoleCreateLogBody 自定义请求体序列化结构,绕开 core 的反射序列化(JsonParams): // - 数值字段 *int64 + omitempty:未设置(nil)时该字段不出现在 JSON 中,避免 0 被 DMS 当成真实筛选条件; -// - 切片字段统一为非 nil 空数组 []:避免 nil 被序列化成 null 触发 DMS 类型校验失败; +// - event_time 切片统一为非 nil 空数组 []:避免 nil 被序列化成 null 触发 DMS 类型校验失败; // - 标量字符串用 omitempty:空串时不出现在 JSON 中。 type getRoleCreateLogBody struct { Uid string `json:"uid,omitempty"` EventTime []string `json:"event_time"` - GameSign []string `json:"game_sign"` - GameId []string `json:"game_id"` - RoleName []string `json:"role_name"` - RoleId []string `json:"role_id"` - ServerName []string `json:"server_name"` - ServerId []string `json:"server_id"` + GameSign string `json:"game_sign,omitempty"` + GameId string `json:"game_id,omitempty"` + RoleName string `json:"role_name,omitempty"` + RoleId string `json:"role_id,omitempty"` + ServerName string `json:"server_name,omitempty"` + ServerId string `json:"server_id,omitempty"` RoleLevelMin *int64 `json:"role_level_min,omitempty"` RoleLevelMax *int64 `json:"role_level_max,omitempty"` PayAmtAccMin *int64 `json:"pay_amt_acc_min,omitempty"` @@ -78,12 +78,12 @@ func (request *GetRoleCreateLogRequest) GetBodyReader() io.Reader { body := getRoleCreateLogBody{ Uid: request.Uid, EventTime: emptyStrSlice(request.EventTime), - GameSign: emptyStrSlice(request.GameSign), - GameId: emptyStrSlice(request.GameId), - RoleName: emptyStrSlice(request.RoleName), - RoleId: emptyStrSlice(request.RoleId), - ServerName: emptyStrSlice(request.ServerName), - ServerId: emptyStrSlice(request.ServerId), + GameSign: request.GameSign, + GameId: request.GameId, + RoleName: request.RoleName, + RoleId: request.RoleId, + ServerName: request.ServerName, + ServerId: request.ServerId, RoleLevelMin: request.RoleLevelMin, RoleLevelMax: request.RoleLevelMax, PayAmtAccMin: request.PayAmtAccMin, From 95b99d594500bbebc4d932c7ce693f7ab8000555 Mon Sep 17 00:00:00 2001 From: luoxun Date: Wed, 10 Jun 2026 11:05:55 +0800 Subject: [PATCH 5/5] =?UTF-8?q?dms=E8=BF=90=E8=90=A5=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=BE=E5=A4=87=E7=B3=BB=E7=BB=9F=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/big-data/client.go | 7 +++ .../big-data/get_user_login_log_os_options.go | 43 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 services/big-data/get_user_login_log_os_options.go diff --git a/services/big-data/client.go b/services/big-data/client.go index 78ad07e..7ff5e3d 100644 --- a/services/big-data/client.go +++ b/services/big-data/client.go @@ -50,3 +50,10 @@ func (c *Client) GetRoleCreateLog(req *GetRoleCreateLogRequest) (response *GetRo err = c.DoAction(req, response) return } + +// GetUserLoginLogOsOptions 登录日志 OS 选项查询 +func (c *Client) GetUserLoginLogOsOptions(req *GetUserLoginLogOsOptionsRequest) (response *GetUserLoginLogOsOptionsResponse, err error) { + response = CreateGetUserLoginLogOsOptionsResponse() + err = c.DoAction(req, response) + return +} diff --git a/services/big-data/get_user_login_log_os_options.go b/services/big-data/get_user_login_log_os_options.go new file mode 100644 index 0000000..5cbe21b --- /dev/null +++ b/services/big-data/get_user_login_log_os_options.go @@ -0,0 +1,43 @@ +package big_data + +import ( + "encoding/json" + + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +// GetUserLoginLogOsOptionsRequest 登录日志 OS 选项查询请求(无请求体,仅鉴权头) +type GetUserLoginLogOsOptionsRequest struct { + *requests.JsonRequest + Authorization string `position:"Header" field:"Authorization"` + XDebug string `position:"Header" field:"x-debug"` +} + +// GetUserLoginLogOsOptionsResponse 登录日志 OS 选项查询响应(返回不做处理,data 原样透出) +type GetUserLoginLogOsOptionsResponse struct { + *responses.BaseResponse + Code int `json:"code"` + Message string `json:"message"` + Data json.RawMessage `json:"data"` +} + +// CreateGetUserLoginLogOsOptionsRequest 创建登录日志 OS 选项查询请求 +// token 为 GetToken 返回的 data.token,直接放入 Authorization 头 +func CreateGetUserLoginLogOsOptionsRequest(token string) *GetUserLoginLogOsOptionsRequest { + req := &GetUserLoginLogOsOptionsRequest{ + JsonRequest: &requests.JsonRequest{}, + Authorization: token, + } + req.InitWithApiInfo(HOST, VERSION, "/api/internal/v1/get_user_login_log/os_options") + req.Method = requests.POST + req.Scheme = requests.HTTPS + return req +} + +// CreateGetUserLoginLogOsOptionsResponse 创建登录日志 OS 选项查询响应 +func CreateGetUserLoginLogOsOptionsResponse() *GetUserLoginLogOsOptionsResponse { + return &GetUserLoginLogOsOptionsResponse{ + BaseResponse: &responses.BaseResponse{}, + } +}