8
0
gaore-common-sdk-go/services/game/pay_switch.go
yuxh 7097afb18c feat(pay): 新增切支付名单中转与清缓存 SDK 接口
game 服务新增 GetPaySwitchUser(按 user_name+game_id 读 db_center 切支付名单,返回 status+risk_level);
asdk 服务新增 ClearPaySwitchCache(内网无签名,按 user_name+game_id 即时清切支付判定缓存)。
供 asdk/center 微信小游戏切支付功能调用。
2026-06-12 15:37:48 +08:00

46 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
}