Merge branch 'master' of https://golib.gaore.com/GaoreGo/gaore-common-sdk-go
This commit is contained in:
commit
451be79b39
@ -54,3 +54,10 @@ func (c *Client) Auth(req *AuthReq) (resp *AuthResp, err error) {
|
||||
err = c.DoAction(req, resp)
|
||||
return
|
||||
}
|
||||
|
||||
// ClearPaySwitchCache 清切支付名单判定缓存(内网无签名接口,按 user_name + game_id 即时清 asdk 判定缓存)
|
||||
func (c *Client) ClearPaySwitchCache(req *ClearPaySwitchCacheReq) (resp *ClearPaySwitchCacheResp, err error) {
|
||||
resp = CreateClearPaySwitchCacheResp()
|
||||
err = c.DoAction(req, resp)
|
||||
return
|
||||
}
|
||||
|
||||
42
services/asdk/pay_switch.go
Normal file
42
services/asdk/pay_switch.go
Normal file
@ -0,0 +1,42 @@
|
||||
package asdk
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
// ClearPaySwitchCacheReq
|
||||
// 清切支付名单判定缓存请求(内网无签名接口,按 user_name + game_id 即时清 asdk 判定缓存)
|
||||
type ClearPaySwitchCacheReq struct {
|
||||
*requests.RpcRequest
|
||||
}
|
||||
|
||||
type ClearPaySwitchCacheResp struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data struct{} `json:"data"`
|
||||
TraceId string `json:"trace_id"`
|
||||
}
|
||||
|
||||
// CreateClearPaySwitchCacheReq 构造清缓存请求(user_name + game_id)
|
||||
func CreateClearPaySwitchCacheReq(userName string, gameId int64) *ClearPaySwitchCacheReq {
|
||||
req := &ClearPaySwitchCacheReq{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
req.InitWithApiInfo(HOST, VERSION, "/api/vip/clear_pay_switch_cache")
|
||||
req.Method = requests.POST
|
||||
req.FormParams = map[string]string{
|
||||
"user_name": userName,
|
||||
"game_id": strconv.FormatInt(gameId, 10),
|
||||
}
|
||||
return req
|
||||
}
|
||||
|
||||
func CreateClearPaySwitchCacheResp() *ClearPaySwitchCacheResp {
|
||||
return &ClearPaySwitchCacheResp{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@ import (
|
||||
// 说明:切片为空表示不限定该条件;标量字符串为空时不参与筛选
|
||||
type GetUserLoginLogParam struct {
|
||||
Uid string `json:"uid"`
|
||||
EventTime string `json:"event_time"` // 形如 "2026-06"
|
||||
EventTime []string `json:"event_time"` // 区间 [开始, 结束]
|
||||
GameSign string `json:"game_sign"`
|
||||
ServerGroupId []string `json:"server_group_id"`
|
||||
GameId string `json:"game_id"`
|
||||
@ -31,7 +31,7 @@ type GetUserLoginLogParam struct {
|
||||
type GetUserLoginLogRequest struct {
|
||||
*requests.JsonRequest
|
||||
Uid string `position:"Json" field:"uid"`
|
||||
EventTime string `position:"Json" field:"event_time"`
|
||||
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"`
|
||||
@ -50,7 +50,7 @@ type GetUserLoginLogRequest struct {
|
||||
// - 标量字符串用 omitempty:空串时不出现在 JSON 中,避免被 DMS 当成真实筛选条件。
|
||||
type getUserLoginLogBody struct {
|
||||
Uid string `json:"uid,omitempty"`
|
||||
EventTime string `json:"event_time,omitempty"`
|
||||
EventTime []string `json:"event_time"`
|
||||
GameSign string `json:"game_sign,omitempty"`
|
||||
ServerGroupId []string `json:"server_group_id"`
|
||||
GameId string `json:"game_id,omitempty"`
|
||||
@ -67,7 +67,7 @@ type getUserLoginLogBody struct {
|
||||
func (request *GetUserLoginLogRequest) GetBodyReader() io.Reader {
|
||||
body := getUserLoginLogBody{
|
||||
Uid: request.Uid,
|
||||
EventTime: request.EventTime,
|
||||
EventTime: emptyStrSlice(request.EventTime),
|
||||
GameSign: request.GameSign,
|
||||
ServerGroupId: emptyStrSlice(request.ServerGroupId),
|
||||
GameId: request.GameId,
|
||||
|
||||
@ -205,3 +205,10 @@ func (c *Client) GetRole(req *GetRoleReq) (response *GetRoleResp, err error) {
|
||||
err = c.DoAction(req, response)
|
||||
return
|
||||
}
|
||||
|
||||
// GetPaySwitchUser 微信小游戏切支付名单中转查询(按 user_name + game_id 读 db_center 名单,返回 status + risk_level)
|
||||
func (c *Client) GetPaySwitchUser(req *GetPaySwitchUserReq) (resp *GetPaySwitchUserResp, err error) {
|
||||
resp = CreateGetPaySwitchUserResp()
|
||||
err = c.DoAction(req, resp)
|
||||
return
|
||||
}
|
||||
|
||||
45
services/game/pay_switch.go
Normal file
45
services/game/pay_switch.go
Normal file
@ -0,0 +1,45 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
// GetPaySwitchUserReq
|
||||
// 微信小游戏切支付名单中转查询请求(按 user_name + game_id 读 db_center.wd_pay_switch_user)
|
||||
type GetPaySwitchUserReq struct {
|
||||
*requests.RpcRequest
|
||||
UserName string `position:"Body" field:"user_name"` // 账号
|
||||
GameId int64 `position:"Body" field:"game_id"` // 子游戏ID
|
||||
}
|
||||
|
||||
// GetPaySwitchUserRespData 中转返回的名单状态
|
||||
type GetPaySwitchUserRespData struct {
|
||||
Status int64 `json:"status"` // 切支付开关 1开启 0关闭
|
||||
RiskLevel int64 `json:"risk_level"` // 风险档位 1高 2中 3低;0未设置/关闭
|
||||
}
|
||||
|
||||
type GetPaySwitchUserResp struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data GetPaySwitchUserRespData `json:"data"`
|
||||
}
|
||||
|
||||
func CreateGetPaySwitchUserReq(userName string, gameId int64) *GetPaySwitchUserReq {
|
||||
req := &GetPaySwitchUserReq{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
req.UserName = userName
|
||||
req.GameId = gameId
|
||||
req.InitWithApiInfo(HOST, VERSION, "/api/pay/switchUser")
|
||||
req.Method = requests.POST
|
||||
return req
|
||||
}
|
||||
|
||||
func CreateGetPaySwitchUserResp() *GetPaySwitchUserResp {
|
||||
resp := &GetPaySwitchUserResp{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
return resp
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user