7
0

pay:新增获取用户代金券

This commit is contained in:
叶 茂新 2026-01-16 12:06:42 +08:00
parent 2da94cfe7c
commit a82061d592
2 changed files with 59 additions and 0 deletions

View File

@ -86,3 +86,11 @@ func (c *Client) GetUserPay(req *GetUserPayRequest) (response *GetUserPayRespons
err = c.DoAction(req, response) err = c.DoAction(req, response)
return return
} }
// GetUserVoucher
// 获取用户代金券
func (c *Client) GetUserVoucher(req *GetUserVoucherRequest) (response *GetUserVoucherResponse, err error) {
response = CreateGetUserVoucherResponse()
err = c.DoAction(req, response)
return
}

View File

@ -0,0 +1,51 @@
package pay
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
type GetUserVoucherRequest struct {
*requests.RpcRequest
UserName string `position:"Body" field:"user_name"`
PayMoney float64 `position:"Body" field:"pay_money"`
GameId int64 `position:"Body" field:"game_id" `
}
type GetUserVoucherResponse struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data struct {
List []Voucher `json:"list"`
} `json:"data"`
}
type Voucher struct {
Code string `json:"code"`
Threshold float64 `json:"threshold"`
Discount float64 `json:"discount"`
Type int `json:"type"`
Status int `json:"status"`
Number int `json:"number"`
Deadline string `json:"deadline"`
}
func CreateGetUserVoucherRequest(userName string, gameId int64, payMoney float64) (req *GetUserVoucherRequest) {
req = &GetUserVoucherRequest{
RpcRequest: &requests.RpcRequest{},
UserName: userName,
GameId: gameId,
PayMoney: payMoney,
}
req.InitWithApiInfo(HOST, VERSION, "/api/user/getUserVoucher")
req.Method = requests.POST
return
}
func CreateGetUserVoucherResponse() (response *GetUserVoucherResponse) {
response = &GetUserVoucherResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}