-
Notifications
You must be signed in to change notification settings - Fork 12
/
OrderQuery.go
40 lines (35 loc) · 1.12 KB
/
OrderQuery.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 tbtrade
import (
"sync"
)
// OrderQuery 结构体
type OrderQuery struct {
// 收件人电话号码
ReceiverPhone string `json:"receiver_phone,omitempty" xml:"receiver_phone,omitempty"`
// 收件人的手机号
ReceiverMobile string `json:"receiver_mobile,omitempty" xml:"receiver_mobile,omitempty"`
// 收件人的姓名
ReceiverName string `json:"receiver_name,omitempty" xml:"receiver_name,omitempty"`
// 查询三个月内交易创建时间开始。格式:yyyy-MM-dd HH:mm:ss
EndCreated string `json:"end_created,omitempty" xml:"end_created,omitempty"`
// 查询交易创建时间结束。格式:yyyy-MM-dd HH:mm:ss
StartCreated string `json:"start_created,omitempty" xml:"start_created,omitempty"`
}
var poolOrderQuery = sync.Pool{
New: func() any {
return new(OrderQuery)
},
}
// GetOrderQuery() 从对象池中获取OrderQuery
func GetOrderQuery() *OrderQuery {
return poolOrderQuery.Get().(*OrderQuery)
}
// ReleaseOrderQuery 释放OrderQuery
func ReleaseOrderQuery(v *OrderQuery) {
v.ReceiverPhone = ""
v.ReceiverMobile = ""
v.ReceiverName = ""
v.EndCreated = ""
v.StartCreated = ""
poolOrderQuery.Put(v)
}