52 lines
1.3 KiB
Go
52 lines
1.3 KiB
Go
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
|
|
}
|