-
Notifications
You must be signed in to change notification settings - Fork 9
/
ExpressDto.go
79 lines (74 loc) · 3.13 KB
/
ExpressDto.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package tmallservice
import (
"sync"
)
// ExpressDto 结构体
type ExpressDto struct {
// 子物流单号
SubMailNos []string `json:"sub_mail_nos,omitempty" xml:"sub_mail_nos>string,omitempty"`
// 取件员名称
CourierName string `json:"courier_name,omitempty" xml:"courier_name,omitempty"`
// 取件员手机号码
CourierMobile string `json:"courier_mobile,omitempty" xml:"courier_mobile,omitempty"`
// 寄件单号(废弃)
ExpressOrderId string `json:"express_order_id,omitempty" xml:"express_order_id,omitempty"`
// 快递单号
MailNo string `json:"mail_no,omitempty" xml:"mail_no,omitempty"`
// 物流服务商账号名称
CompanyName string `json:"company_name,omitempty" xml:"company_name,omitempty"`
// 打印免单信息
PrintInfo string `json:"print_info,omitempty" xml:"print_info,omitempty"`
// 物品信息明细 字符串格式为:json 串 例子: [{ "name": "大衣,毛衣", "count": 1 }, { "name": "裤子", "count": 2 }]
GoodsInfo string `json:"goods_info,omitempty" xml:"goods_info,omitempty"`
// 预约开始时间
ReserveEndTime string `json:"reserve_end_time,omitempty" xml:"reserve_end_time,omitempty"`
// 预约结束时间
ReserveStartTime string `json:"reserve_start_time,omitempty" xml:"reserve_start_time,omitempty"`
// 物流创建 :create 物流取消 :cancel 分派小件员:assign 已经分派小件员: assigned 包裹上门揽收: pickup_door 包裹已揽收完成: pickup_finished 包裹派送中: dispatching 包裹已签收: signed
StatusCode string `json:"status_code,omitempty" xml:"status_code,omitempty"`
// luxury(奢饰商品)/common(普通商品)
GoodsType string `json:"goods_type,omitempty" xml:"goods_type,omitempty"`
// 增值服务需求
ValueAddedServiceDemand string `json:"value_added_service_demand,omitempty" xml:"value_added_service_demand,omitempty"`
// 扩展属性
ExtendInfo string `json:"extend_info,omitempty" xml:"extend_info,omitempty"`
// 物流订单号
LogisticsOrderId int64 `json:"logistics_order_id,omitempty" xml:"logistics_order_id,omitempty"`
// 物流商账号ID((ERP服务商依据不同的账号ID,走不同的物流系统对接方式))
LogisticsTpId int64 `json:"logistics_tp_id,omitempty" xml:"logistics_tp_id,omitempty"`
// 寄件人信息
Sender *CustomerInfo `json:"sender,omitempty" xml:"sender,omitempty"`
// 收件人信息
Receiver *CustomerInfo `json:"receiver,omitempty" xml:"receiver,omitempty"`
}
var poolExpressDto = sync.Pool{
New: func() any {
return new(ExpressDto)
},
}
// GetExpressDto() 从对象池中获取ExpressDto
func GetExpressDto() *ExpressDto {
return poolExpressDto.Get().(*ExpressDto)
}
// ReleaseExpressDto 释放ExpressDto
func ReleaseExpressDto(v *ExpressDto) {
v.SubMailNos = v.SubMailNos[:0]
v.CourierName = ""
v.CourierMobile = ""
v.ExpressOrderId = ""
v.MailNo = ""
v.CompanyName = ""
v.PrintInfo = ""
v.GoodsInfo = ""
v.ReserveEndTime = ""
v.ReserveStartTime = ""
v.StatusCode = ""
v.GoodsType = ""
v.ValueAddedServiceDemand = ""
v.ExtendInfo = ""
v.LogisticsOrderId = 0
v.LogisticsTpId = 0
v.Sender = nil
v.Receiver = nil
poolExpressDto.Put(v)
}