pay:新增获取用户代金券
This commit is contained in:
parent
2da94cfe7c
commit
a82061d592
@ -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
|
||||||
|
}
|
||||||
|
|||||||
51
services/pay/get_user_voucher.go
Normal file
51
services/pay/get_user_voucher.go
Normal 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
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user