Compare commits
No commits in common. "master" and "v1.2.69" have entirely different histories.
@ -23,8 +23,8 @@ type GetRoleCreateLogParam struct {
|
|||||||
ServerId string `json:"server_id"`
|
ServerId string `json:"server_id"`
|
||||||
RoleLevelMin *int64 `json:"role_level_min"`
|
RoleLevelMin *int64 `json:"role_level_min"`
|
||||||
RoleLevelMax *int64 `json:"role_level_max"`
|
RoleLevelMax *int64 `json:"role_level_max"`
|
||||||
PayAmtAccMin *float64 `json:"pay_amt_acc_min"`
|
PayAmtAccMin *int64 `json:"pay_amt_acc_min"`
|
||||||
PayAmtAccMax *float64 `json:"pay_amt_acc_max"`
|
PayAmtAccMax *int64 `json:"pay_amt_acc_max"`
|
||||||
Page int `json:"page"`
|
Page int `json:"page"`
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
XDebug string `json:"x_debug"` // 测试环境调试头,正式调用可留空
|
XDebug string `json:"x_debug"` // 测试环境调试头,正式调用可留空
|
||||||
@ -43,8 +43,8 @@ type GetRoleCreateLogRequest struct {
|
|||||||
ServerId string `position:"Json" field:"server_id"`
|
ServerId string `position:"Json" field:"server_id"`
|
||||||
RoleLevelMin *int64 `position:"Json" field:"role_level_min"`
|
RoleLevelMin *int64 `position:"Json" field:"role_level_min"`
|
||||||
RoleLevelMax *int64 `position:"Json" field:"role_level_max"`
|
RoleLevelMax *int64 `position:"Json" field:"role_level_max"`
|
||||||
PayAmtAccMin *float64 `position:"Json" field:"pay_amt_acc_min"`
|
PayAmtAccMin *int64 `position:"Json" field:"pay_amt_acc_min"`
|
||||||
PayAmtAccMax *float64 `position:"Json" field:"pay_amt_acc_max"`
|
PayAmtAccMax *int64 `position:"Json" field:"pay_amt_acc_max"`
|
||||||
Page int `position:"Json" field:"page"`
|
Page int `position:"Json" field:"page"`
|
||||||
PageSize int `position:"Json" field:"page_size"`
|
PageSize int `position:"Json" field:"page_size"`
|
||||||
Authorization string `position:"Header" field:"Authorization"`
|
Authorization string `position:"Header" field:"Authorization"`
|
||||||
@ -52,7 +52,7 @@ type GetRoleCreateLogRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getRoleCreateLogBody 自定义请求体序列化结构,绕开 core 的反射序列化(JsonParams):
|
// getRoleCreateLogBody 自定义请求体序列化结构,绕开 core 的反射序列化(JsonParams):
|
||||||
// - 数值字段 *float64 + omitempty:未设置(nil)时该字段不出现在 JSON 中,避免 0 被 DMS 当成真实筛选条件;
|
// - 数值字段 *int64 + omitempty:未设置(nil)时该字段不出现在 JSON 中,避免 0 被 DMS 当成真实筛选条件;
|
||||||
// - event_time 切片统一为非 nil 空数组 []:避免 nil 被序列化成 null 触发 DMS 类型校验失败;
|
// - event_time 切片统一为非 nil 空数组 []:避免 nil 被序列化成 null 触发 DMS 类型校验失败;
|
||||||
// - 标量字符串用 omitempty:空串时不出现在 JSON 中。
|
// - 标量字符串用 omitempty:空串时不出现在 JSON 中。
|
||||||
type getRoleCreateLogBody struct {
|
type getRoleCreateLogBody struct {
|
||||||
@ -66,8 +66,8 @@ type getRoleCreateLogBody struct {
|
|||||||
ServerId string `json:"server_id,omitempty"`
|
ServerId string `json:"server_id,omitempty"`
|
||||||
RoleLevelMin *int64 `json:"role_level_min,omitempty"`
|
RoleLevelMin *int64 `json:"role_level_min,omitempty"`
|
||||||
RoleLevelMax *int64 `json:"role_level_max,omitempty"`
|
RoleLevelMax *int64 `json:"role_level_max,omitempty"`
|
||||||
PayAmtAccMin *float64 `json:"pay_amt_acc_min,omitempty"`
|
PayAmtAccMin *int64 `json:"pay_amt_acc_min,omitempty"`
|
||||||
PayAmtAccMax *float64 `json:"pay_amt_acc_max,omitempty"`
|
PayAmtAccMax *int64 `json:"pay_amt_acc_max,omitempty"`
|
||||||
Page int `json:"page"`
|
Page int `json:"page"`
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,10 +28,10 @@ type GetUserProfileParam struct {
|
|||||||
RegisterDate []string `json:"register_date"` // 区间 [开始, 结束]
|
RegisterDate []string `json:"register_date"` // 区间 [开始, 结束]
|
||||||
LastLoginDate []string `json:"last_login_date"` // 区间 [开始, 结束]
|
LastLoginDate []string `json:"last_login_date"` // 区间 [开始, 结束]
|
||||||
LastPayDate []string `json:"last_pay_date"` // 区间 [开始, 结束]
|
LastPayDate []string `json:"last_pay_date"` // 区间 [开始, 结束]
|
||||||
PayAmtAccMin *float64 `json:"pay_amt_acc_min"`
|
PayAmtAccMin *int64 `json:"pay_amt_acc_min"`
|
||||||
PayAmtAccMax *float64 `json:"pay_amt_acc_max"`
|
PayAmtAccMax *int64 `json:"pay_amt_acc_max"`
|
||||||
LastPayAmountMin *float64 `json:"last_pay_amount_min"`
|
LastPayAmountMin *int64 `json:"last_pay_amount_min"`
|
||||||
LastPayAmountMax *float64 `json:"last_pay_amount_max"`
|
LastPayAmountMax *int64 `json:"last_pay_amount_max"`
|
||||||
Page int `json:"page"`
|
Page int `json:"page"`
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
XDebug string `json:"x_debug"` // 测试环境调试头,正式调用可留空
|
XDebug string `json:"x_debug"` // 测试环境调试头,正式调用可留空
|
||||||
@ -55,10 +55,10 @@ type GetUserProfileRequest struct {
|
|||||||
RegisterDate []string `position:"Json" field:"register_date"`
|
RegisterDate []string `position:"Json" field:"register_date"`
|
||||||
LastLoginDate []string `position:"Json" field:"last_login_date"`
|
LastLoginDate []string `position:"Json" field:"last_login_date"`
|
||||||
LastPayDate []string `position:"Json" field:"last_pay_date"`
|
LastPayDate []string `position:"Json" field:"last_pay_date"`
|
||||||
PayAmtAccMin *float64 `position:"Json" field:"pay_amt_acc_min"`
|
PayAmtAccMin *int64 `position:"Json" field:"pay_amt_acc_min"`
|
||||||
PayAmtAccMax *float64 `position:"Json" field:"pay_amt_acc_max"`
|
PayAmtAccMax *int64 `position:"Json" field:"pay_amt_acc_max"`
|
||||||
LastPayAmountMin *float64 `position:"Json" field:"last_pay_amount_min"`
|
LastPayAmountMin *int64 `position:"Json" field:"last_pay_amount_min"`
|
||||||
LastPayAmountMax *float64 `position:"Json" field:"last_pay_amount_max"`
|
LastPayAmountMax *int64 `position:"Json" field:"last_pay_amount_max"`
|
||||||
Page int `position:"Json" field:"page"`
|
Page int `position:"Json" field:"page"`
|
||||||
PageSize int `position:"Json" field:"page_size"`
|
PageSize int `position:"Json" field:"page_size"`
|
||||||
Authorization string `position:"Header" field:"Authorization"`
|
Authorization string `position:"Header" field:"Authorization"`
|
||||||
@ -66,7 +66,7 @@ type GetUserProfileRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getUserProfileBody 自定义请求体序列化结构,绕开 core 的反射序列化(JsonParams):
|
// getUserProfileBody 自定义请求体序列化结构,绕开 core 的反射序列化(JsonParams):
|
||||||
// - 金额字段 *float64 + omitempty:未设置(nil)时该字段不出现在 JSON 中,避免 0 被 DMS 当成真实筛选条件;
|
// - 金额字段 *int64 + omitempty:未设置(nil)时该字段不出现在 JSON 中,避免 0 被 DMS 当成真实筛选条件;
|
||||||
// - 切片字段统一为非 nil 空数组 []:避免 nil 被序列化成 null 触发 DMS 类型校验失败。
|
// - 切片字段统一为非 nil 空数组 []:避免 nil 被序列化成 null 触发 DMS 类型校验失败。
|
||||||
type getUserProfileBody struct {
|
type getUserProfileBody struct {
|
||||||
UserName []string `json:"user_name"`
|
UserName []string `json:"user_name"`
|
||||||
@ -84,10 +84,10 @@ type getUserProfileBody struct {
|
|||||||
RegisterDate []string `json:"register_date"`
|
RegisterDate []string `json:"register_date"`
|
||||||
LastLoginDate []string `json:"last_login_date"`
|
LastLoginDate []string `json:"last_login_date"`
|
||||||
LastPayDate []string `json:"last_pay_date"`
|
LastPayDate []string `json:"last_pay_date"`
|
||||||
PayAmtAccMin *float64 `json:"pay_amt_acc_min,omitempty"`
|
PayAmtAccMin *int64 `json:"pay_amt_acc_min,omitempty"`
|
||||||
PayAmtAccMax *float64 `json:"pay_amt_acc_max,omitempty"`
|
PayAmtAccMax *int64 `json:"pay_amt_acc_max,omitempty"`
|
||||||
LastPayAmountMin *float64 `json:"last_pay_amount_min,omitempty"`
|
LastPayAmountMin *int64 `json:"last_pay_amount_min,omitempty"`
|
||||||
LastPayAmountMax *float64 `json:"last_pay_amount_max,omitempty"`
|
LastPayAmountMax *int64 `json:"last_pay_amount_max,omitempty"`
|
||||||
Page int `json:"page"`
|
Page int `json:"page"`
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,20 +56,6 @@ func (c *Client) EditCard(req EditCardRequestParam) (response string, err error)
|
|||||||
return createEditCardResponse.GetHttpContentString(), nil
|
return createEditCardResponse.GetHttpContentString(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DelUserAuth
|
|
||||||
// 清除用户实名信息(清空分表 true_name/id_card,删除 user_real_auth 记录),成功返回 "ok"
|
|
||||||
func (c *Client) DelUserAuth(param DelUserAuthRequestParam) (response string, err error) {
|
|
||||||
delUserAuthRequest := CreateDelUserAuthRequest(param)
|
|
||||||
delUserAuthResponse := CreateDelUserAuthResponse()
|
|
||||||
err = c.DoAction(delUserAuthRequest, delUserAuthResponse)
|
|
||||||
if err != nil && strings.Contains(err.Error(), "json Unmarshal:") {
|
|
||||||
return delUserAuthResponse.GetHttpContentString(), nil
|
|
||||||
} else if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
return delUserAuthResponse.GetHttpContentString(), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUserGameSign
|
// GetUserGameSign
|
||||||
// 获取用户登录过的游戏大类
|
// 获取用户登录过的游戏大类
|
||||||
func (c *Client) GetUserGameSign(req *GetUserGameSignRequest) (response *GetUserGameSignResponse, err error) {
|
func (c *Client) GetUserGameSign(req *GetUserGameSignRequest) (response *GetUserGameSignResponse, err error) {
|
||||||
|
|||||||
@ -213,28 +213,6 @@ func TestGetUserId(t *testing.T) {
|
|||||||
fmt.Printf("data: %+v\n", data)
|
fmt.Printf("data: %+v\n", data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 测试清除用户实名信息(演示调用方式)
|
|
||||||
// 注意:该接口会真实清除账号实名(清空分表 true_name/id_card 并删除 user_real_auth 记录),
|
|
||||||
// 仅可对测试账号执行,切勿对真实玩家账号运行。
|
|
||||||
func TestDelUserAuth(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 调用方式:传入待清除实名的玩家账号
|
|
||||||
param := DelUserAuthRequestParam{
|
|
||||||
UserName: "pv23669710", // 占位测试账号
|
|
||||||
}
|
|
||||||
res, err := client.DelUserAuth(param)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 远端返回纯文本,"ok" 表示清除成功
|
|
||||||
t.Logf("del user auth result: %s", res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 测试获取用户登陆信息
|
// 测试获取用户登陆信息
|
||||||
func TestGetUserLogin(t *testing.T) {
|
func TestGetUserLogin(t *testing.T) {
|
||||||
client, err := NewClient()
|
client, err := NewClient()
|
||||||
|
|||||||
@ -2,11 +2,10 @@ package passport
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"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"
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const weeDongKey = "aVCxX2B3yswpxCMjaaSUHFXAzLYyuGhW"
|
const weeDongKey = "aVCxX2B3yswpxCMjaaSUHFXAzLYyuGhW"
|
||||||
@ -96,44 +95,3 @@ func CreateEditCardResponse() (response *EditCardResponse) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type DelUserAuthRequestParam struct {
|
|
||||||
UserName string `position:"Body" field:"user_name"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type DelUserAuthResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
}
|
|
||||||
|
|
||||||
type DelUserAuthRequest struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
UserName string `position:"Body" field:"user_name"`
|
|
||||||
Action string `position:"Body" field:"action"`
|
|
||||||
Flag string `position:"Body" field:"flag"`
|
|
||||||
Time string `position:"Body" field:"time"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// CreateDelUserAuthRequest 清除用户实名信息接口
|
|
||||||
// 远端会清空分表 user_X 的 true_name、id_card,并删除 user_real_auth 整条记录,只需传 user_name
|
|
||||||
func CreateDelUserAuthRequest(param DelUserAuthRequestParam) (req *DelUserAuthRequest) {
|
|
||||||
ts := time.Now().Unix()
|
|
||||||
sign := weeDongGetSign(ts)
|
|
||||||
|
|
||||||
req = &DelUserAuthRequest{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
Action: "del_user_auth",
|
|
||||||
Flag: sign,
|
|
||||||
Time: fmt.Sprintf("%v", ts),
|
|
||||||
UserName: param.UserName,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/weedong.php")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateDelUserAuthResponse() (response *DelUserAuthResponse) {
|
|
||||||
response = &DelUserAuthResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|||||||
@ -164,10 +164,3 @@ func (c *Client) GetGamePayAmount(req *GetGamePayAmountReq) (resp *GetGamePayAmo
|
|||||||
err = c.DoAction(req, resp)
|
err = c.DoAction(req, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// KafkaEvent 通用推入kafka数据
|
|
||||||
func (c *Client) KafkaEvent(req *KafkaEventReq) (resp *KafkaEventResp, err error) {
|
|
||||||
resp = CreateKafkaEventResp()
|
|
||||||
err = c.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|||||||
@ -378,27 +378,3 @@ func TestGetGamePayAmount(t *testing.T) {
|
|||||||
t.Errorf("GetGamePayAmount failed: code=%d msg=%s", resp.Code, resp.Msg)
|
t.Errorf("GetGamePayAmount failed: code=%d msg=%s", resp.Code, resp.Msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestKafkaEvent(t *testing.T) {
|
|
||||||
client, err := NewClient()
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
req := CreateKafkaEventReq(map[string]any{
|
|
||||||
"topic": "test_lebian_sop_event",
|
|
||||||
"event_name": "测试数据",
|
|
||||||
"event_data": map[string]any{},
|
|
||||||
})
|
|
||||||
|
|
||||||
resp, err := client.KafkaEvent(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println(resp.Code, resp.Msg)
|
|
||||||
|
|
||||||
// 成功码为 1
|
|
||||||
if resp.Code != 1 {
|
|
||||||
t.Errorf("TestKafkaEvent failed: code=%d msg=%s", resp.Code, resp.Msg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,28 +0,0 @@
|
|||||||
package stat
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
||||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
||||||
)
|
|
||||||
|
|
||||||
type KafkaEventReq = requests.JsonRequest
|
|
||||||
|
|
||||||
type KafkaEventResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateKafkaEventReq(param map[string]any) *KafkaEventReq {
|
|
||||||
req := &requests.JsonRequest{}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/event_track/kafka")
|
|
||||||
req.Method = requests.POST
|
|
||||||
req.JsonParams = param
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateKafkaEventResp() *KafkaEventResp {
|
|
||||||
return &KafkaEventResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user