-
Notifications
You must be signed in to change notification settings - Fork 9
/
OrderInfoDto.go
37 lines (32 loc) · 1.55 KB
/
OrderInfoDto.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
package cainiaolocker
import (
"sync"
)
// OrderInfoDto 结构体
type OrderInfoDto struct {
// 外部电商平台交易子单号集合,非必填,数量限制100
OutTradeSubOrderList []string `json:"out_trade_sub_order_list,omitempty" xml:"out_trade_sub_order_list>string,omitempty"`
// 外部电商平台交易单号集合,非必填,数量限制100
OutTradeOrderList []string `json:"out_trade_order_list,omitempty" xml:"out_trade_order_list>string,omitempty"`
// 订单号,数量限制100,订单号(只限传入数字、字母、下划线和中划线,为避免出现冲突,请按电商平台真实订单号传入,请避免使用同个订单号重复取号)
TradeOrderList []string `json:"trade_order_list,omitempty" xml:"trade_order_list>string,omitempty"`
// <a href="http://open.taobao.com/doc2/detail.htm?spm=a219a.7629140.0.0.8cf9Nj&treeId=17&articleId=105085&docType=1#2">订单渠道平台编码</a>
OrderChannelsType string `json:"order_channels_type,omitempty" xml:"order_channels_type,omitempty"`
}
var poolOrderInfoDto = sync.Pool{
New: func() any {
return new(OrderInfoDto)
},
}
// GetOrderInfoDto() 从对象池中获取OrderInfoDto
func GetOrderInfoDto() *OrderInfoDto {
return poolOrderInfoDto.Get().(*OrderInfoDto)
}
// ReleaseOrderInfoDto 释放OrderInfoDto
func ReleaseOrderInfoDto(v *OrderInfoDto) {
v.OutTradeSubOrderList = v.OutTradeSubOrderList[:0]
v.OutTradeOrderList = v.OutTradeOrderList[:0]
v.TradeOrderList = v.TradeOrderList[:0]
v.OrderChannelsType = ""
poolOrderInfoDto.Put(v)
}