-
Notifications
You must be signed in to change notification settings - Fork 9
/
EnterpriseData.go
79 lines (74 loc) · 2.63 KB
/
EnterpriseData.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 eleenterpriseordernew
import (
"sync"
)
// EnterpriseData 结构体
type EnterpriseData struct {
// 电话号码
PhoneList []string `json:"phone_list,omitempty" xml:"phone_list>string,omitempty"`
// 预定送达时间
DeliverTime string `json:"deliver_time,omitempty" xml:"deliver_time,omitempty"`
// 送餐地址
Address string `json:"address,omitempty" xml:"address,omitempty"`
// 收餐人姓名
Consignee string `json:"consignee,omitempty" xml:"consignee,omitempty"`
// 饿了么订单Id
OrderId string `json:"order_id,omitempty" xml:"order_id,omitempty"`
// 订单备注
Description string `json:"description,omitempty" xml:"description,omitempty"`
// 餐厅唯一码
OnlyRestaurantCode string `json:"only_restaurant_code,omitempty" xml:"only_restaurant_code,omitempty"`
// 订单创建时间
CreatedAt string `json:"created_at,omitempty" xml:"created_at,omitempty"`
// 餐厅名称
RestaurantName string `json:"restaurant_name,omitempty" xml:"restaurant_name,omitempty"`
// 长餐厅Id
ErestaurantId string `json:"erestaurant_id,omitempty" xml:"erestaurant_id,omitempty"`
// 送达费用
DeliverFee string `json:"deliver_fee,omitempty" xml:"deliver_fee,omitempty"`
// 状态
StateCode string `json:"state_code,omitempty" xml:"state_code,omitempty"`
// 最近更新时间
LastUpdatedAt string `json:"last_updated_at,omitempty" xml:"last_updated_at,omitempty"`
// 菜价加上配送费和打包费的价格
OriginalPrice int64 `json:"original_price,omitempty" xml:"original_price,omitempty"`
// 订单总价
TotalPrice int64 `json:"total_price,omitempty" xml:"total_price,omitempty"`
// 订单状态码
Status int64 `json:"status,omitempty" xml:"status,omitempty"`
// 配送员信息
DeliverymanInfo *DeliverymanInfoDto `json:"deliveryman_info,omitempty" xml:"deliveryman_info,omitempty"`
// 地址信息
TrackingInfo *TrackingInfoDto `json:"tracking_info,omitempty" xml:"tracking_info,omitempty"`
}
var poolEnterpriseData = sync.Pool{
New: func() any {
return new(EnterpriseData)
},
}
// GetEnterpriseData() 从对象池中获取EnterpriseData
func GetEnterpriseData() *EnterpriseData {
return poolEnterpriseData.Get().(*EnterpriseData)
}
// ReleaseEnterpriseData 释放EnterpriseData
func ReleaseEnterpriseData(v *EnterpriseData) {
v.PhoneList = v.PhoneList[:0]
v.DeliverTime = ""
v.Address = ""
v.Consignee = ""
v.OrderId = ""
v.Description = ""
v.OnlyRestaurantCode = ""
v.CreatedAt = ""
v.RestaurantName = ""
v.ErestaurantId = ""
v.DeliverFee = ""
v.StateCode = ""
v.LastUpdatedAt = ""
v.OriginalPrice = 0
v.TotalPrice = 0
v.Status = 0
v.DeliverymanInfo = nil
v.TrackingInfo = nil
poolEnterpriseData.Put(v)
}