-
Notifications
You must be signed in to change notification settings - Fork 9
/
Content.go
58 lines (53 loc) · 1.84 KB
/
Content.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
50
51
52
53
54
55
56
57
58
package lstlogistics2
import (
"sync"
)
// Content 结构体
type Content struct {
// 子订单
SubOrders []SubOrders `json:"sub_orders,omitempty" xml:"sub_orders>sub_orders,omitempty"`
// 揽收时间
PickTime string `json:"pick_time,omitempty" xml:"pick_time,omitempty"`
// 签收时间
SignTime string `json:"sign_time,omitempty" xml:"sign_time,omitempty"`
// 外单主订单号
OutOrderId string `json:"out_order_id,omitempty" xml:"out_order_id,omitempty"`
// 车辆信息
VehicleInfo string `json:"vehicle_info,omitempty" xml:"vehicle_info,omitempty"`
// 司机手机号
DriverMobile string `json:"driver_mobile,omitempty" xml:"driver_mobile,omitempty"`
// 司机
DriverName string `json:"driver_name,omitempty" xml:"driver_name,omitempty"`
// * 发货单状态 * NEW ---> 新建 * LOAD_WAIT ---> 待装车 * LOAD_SUCCESS ---> 已装车 * SIGN_SUCCESS ---> 签收、部分签收 * SIGN_FAILED ---> 拒签 * CANCEL ---> 取消
ShipStatus string `json:"ship_status,omitempty" xml:"ship_status,omitempty"`
// 出库时间
OutBoundTime string `json:"out_bound_time,omitempty" xml:"out_bound_time,omitempty"`
// 供应商userId
SupplierUserId int64 `json:"supplier_user_id,omitempty" xml:"supplier_user_id,omitempty"`
// 零售通订单id
LstOrderId int64 `json:"lst_order_id,omitempty" xml:"lst_order_id,omitempty"`
}
var poolContent = sync.Pool{
New: func() any {
return new(Content)
},
}
// GetContent() 从对象池中获取Content
func GetContent() *Content {
return poolContent.Get().(*Content)
}
// ReleaseContent 释放Content
func ReleaseContent(v *Content) {
v.SubOrders = v.SubOrders[:0]
v.PickTime = ""
v.SignTime = ""
v.OutOrderId = ""
v.VehicleInfo = ""
v.DriverMobile = ""
v.DriverName = ""
v.ShipStatus = ""
v.OutBoundTime = ""
v.SupplierUserId = 0
v.LstOrderId = 0
poolContent.Put(v)
}