-
Notifications
You must be signed in to change notification settings - Fork 10
/
ReceiptBatchInfo.go
46 lines (41 loc) · 1.37 KB
/
ReceiptBatchInfo.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
package wdk
import (
"sync"
)
// ReceiptBatchInfo 结构体
type ReceiptBatchInfo struct {
// 履约单集合
FulfillOrderList []FulfillOrder `json:"fulfill_order_list,omitempty" xml:"fulfill_order_list>fulfill_order,omitempty"`
// 容器信息
ContainerInfoList []string `json:"container_info_list,omitempty" xml:"container_info_list>string,omitempty"`
// 批次名称
BatchName string `json:"batch_name,omitempty" xml:"batch_name,omitempty"`
// 批次号
BatchId string `json:"batch_id,omitempty" xml:"batch_id,omitempty"`
// 波次标识
BcFlag string `json:"bc_flag,omitempty" xml:"bc_flag,omitempty"`
// 扩展属性()
Attributes string `json:"attributes,omitempty" xml:"attributes,omitempty"`
// 容器数量
ContainerCount int64 `json:"container_count,omitempty" xml:"container_count,omitempty"`
}
var poolReceiptBatchInfo = sync.Pool{
New: func() any {
return new(ReceiptBatchInfo)
},
}
// GetReceiptBatchInfo() 从对象池中获取ReceiptBatchInfo
func GetReceiptBatchInfo() *ReceiptBatchInfo {
return poolReceiptBatchInfo.Get().(*ReceiptBatchInfo)
}
// ReleaseReceiptBatchInfo 释放ReceiptBatchInfo
func ReleaseReceiptBatchInfo(v *ReceiptBatchInfo) {
v.FulfillOrderList = v.FulfillOrderList[:0]
v.ContainerInfoList = v.ContainerInfoList[:0]
v.BatchName = ""
v.BatchId = ""
v.BcFlag = ""
v.Attributes = ""
v.ContainerCount = 0
poolReceiptBatchInfo.Put(v)
}