33 lines
614 B
Go
33 lines
614 B
Go
package request
|
|
|
|
import "errors"
|
|
|
|
type CreateMallOrderRequest struct {
|
|
BaseRequest
|
|
BuyAmount string // 下单数量
|
|
GetterId string // 获得者Id
|
|
PriceId string // 价格ID
|
|
UserDiscountId string // 优惠ID
|
|
}
|
|
|
|
// 参数合法性检验
|
|
func (request *CreateMallOrderRequest) CheckParameter() (err error) {
|
|
|
|
if len(request.AccessToken) == 0 {
|
|
err = errors.New("AccessToken不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.BuyAmount) == 0 {
|
|
err = errors.New("BuyAmount不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.PriceId) == 0 {
|
|
err = errors.New("PriceId 不能为空")
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|