-
Notifications
You must be signed in to change notification settings - Fork 12
/
ModifyRequest.go
40 lines (35 loc) · 1004 Bytes
/
ModifyRequest.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
package mtopopen
import (
"sync"
)
// ModifyRequest 结构体
type ModifyRequest struct {
// 订单ID
OrderCode string `json:"order_code,omitempty" xml:"order_code,omitempty"`
// 快递公司标准编码
CpCode string `json:"cp_code,omitempty" xml:"cp_code,omitempty"`
// 快递单号
MailNo string `json:"mail_no,omitempty" xml:"mail_no,omitempty"`
// 修改后收件人
Fetcher string `json:"fetcher,omitempty" xml:"fetcher,omitempty"`
// 修改后派送时间
DeliveryTime string `json:"delivery_time,omitempty" xml:"delivery_time,omitempty"`
}
var poolModifyRequest = sync.Pool{
New: func() any {
return new(ModifyRequest)
},
}
// GetModifyRequest() 从对象池中获取ModifyRequest
func GetModifyRequest() *ModifyRequest {
return poolModifyRequest.Get().(*ModifyRequest)
}
// ReleaseModifyRequest 释放ModifyRequest
func ReleaseModifyRequest(v *ModifyRequest) {
v.OrderCode = ""
v.CpCode = ""
v.MailNo = ""
v.Fetcher = ""
v.DeliveryTime = ""
poolModifyRequest.Put(v)
}