-
Notifications
You must be signed in to change notification settings - Fork 9
/
FastBuyPosQueryResult.go
49 lines (44 loc) · 1.57 KB
/
FastBuyPosQueryResult.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package trade
import (
"sync"
)
// FastBuyPosQueryResult 结构体
type FastBuyPosQueryResult struct {
// 五道口订单id
BizOrderId string `json:"biz_order_id,omitempty" xml:"biz_order_id,omitempty"`
// 返回的错误码
ReturnCode string `json:"return_code,omitempty" xml:"return_code,omitempty"`
// 错误信息
ReturnMsg string `json:"return_msg,omitempty" xml:"return_msg,omitempty"`
// 商品分摊优惠
ItemPromotions string `json:"item_promotions,omitempty" xml:"item_promotions,omitempty"`
// 优惠券优惠金额
CouponFee int64 `json:"coupon_fee,omitempty" xml:"coupon_fee,omitempty"`
// 订单状态:1为已下单,未支付;2为交易完成;3为已退款;4为已关单
OrderStatus int64 `json:"order_status,omitempty" xml:"order_status,omitempty"`
// 优惠活动优惠金额
PromotionFee int64 `json:"promotion_fee,omitempty" xml:"promotion_fee,omitempty"`
// 是否调用成功
Success bool `json:"success,omitempty" xml:"success,omitempty"`
}
var poolFastBuyPosQueryResult = sync.Pool{
New: func() any {
return new(FastBuyPosQueryResult)
},
}
// GetFastBuyPosQueryResult() 从对象池中获取FastBuyPosQueryResult
func GetFastBuyPosQueryResult() *FastBuyPosQueryResult {
return poolFastBuyPosQueryResult.Get().(*FastBuyPosQueryResult)
}
// ReleaseFastBuyPosQueryResult 释放FastBuyPosQueryResult
func ReleaseFastBuyPosQueryResult(v *FastBuyPosQueryResult) {
v.BizOrderId = ""
v.ReturnCode = ""
v.ReturnMsg = ""
v.ItemPromotions = ""
v.CouponFee = 0
v.OrderStatus = 0
v.PromotionFee = 0
v.Success = false
poolFastBuyPosQueryResult.Put(v)
}