-
Notifications
You must be signed in to change notification settings - Fork 9
/
WaybillApplyNewInfo.go
55 lines (50 loc) · 2.19 KB
/
WaybillApplyNewInfo.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
package waybill
import (
"sync"
)
// WaybillApplyNewInfo 结构体
type WaybillApplyNewInfo struct {
// 包裹对应的派件(收件)物流服务商网点(分支机构)代码
ConsigneeBranchCode string `json:"consignee_branch_code,omitempty" xml:"consignee_branch_code,omitempty"`
// 包裹对应的派件(收件)物流服务商网点(分支机构)名称
ConsigneeBranchName string `json:"consignee_branch_name,omitempty" xml:"consignee_branch_name,omitempty"`
// 集包地代码
PackageCenterCode string `json:"package_center_code,omitempty" xml:"package_center_code,omitempty"`
// 集包地名称
PackageCenterName string `json:"package_center_name,omitempty" xml:"package_center_name,omitempty"`
// 打印配置项,传给ali-print组件
PrintConfig string `json:"print_config,omitempty" xml:"print_config,omitempty"`
// 面单号对应的物流服务商网点(分支机构)代码
ShippingBranchCode string `json:"shipping_branch_code,omitempty" xml:"shipping_branch_code,omitempty"`
// 面单号对于的物流服务商网点(分支机构)名称
ShippingBranchName string `json:"shipping_branch_name,omitempty" xml:"shipping_branch_name,omitempty"`
// 根据收货地址返回大头笔信息
ShortAddress string `json:"short_address,omitempty" xml:"short_address,omitempty"`
// 返回的面单号
WaybillCode string `json:"waybill_code,omitempty" xml:"waybill_code,omitempty"`
// 面单对应的订单列
TradeOrderInfo *TradeOrderInfo `json:"trade_order_info,omitempty" xml:"trade_order_info,omitempty"`
}
var poolWaybillApplyNewInfo = sync.Pool{
New: func() any {
return new(WaybillApplyNewInfo)
},
}
// GetWaybillApplyNewInfo() 从对象池中获取WaybillApplyNewInfo
func GetWaybillApplyNewInfo() *WaybillApplyNewInfo {
return poolWaybillApplyNewInfo.Get().(*WaybillApplyNewInfo)
}
// ReleaseWaybillApplyNewInfo 释放WaybillApplyNewInfo
func ReleaseWaybillApplyNewInfo(v *WaybillApplyNewInfo) {
v.ConsigneeBranchCode = ""
v.ConsigneeBranchName = ""
v.PackageCenterCode = ""
v.PackageCenterName = ""
v.PrintConfig = ""
v.ShippingBranchCode = ""
v.ShippingBranchName = ""
v.ShortAddress = ""
v.WaybillCode = ""
v.TradeOrderInfo = nil
poolWaybillApplyNewInfo.Put(v)
}