game 服务新增 GetPaySwitchUser(按 user_name+game_id 读 db_center 切支付名单,返回 status+risk_level); asdk 服务新增 ClearPaySwitchCache(内网无签名,按 user_name+game_id 即时清切支付判定缓存)。 供 asdk/center 微信小游戏切支付功能调用。
46 lines
1.4 KiB
Go
46 lines
1.4 KiB
Go
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
|
||
}
|