-
Notifications
You must be signed in to change notification settings - Fork 9
/
OrderOpenInfo.go
55 lines (50 loc) · 1.73 KB
/
OrderOpenInfo.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 alsc
import (
"sync"
)
// OrderOpenInfo 结构体
type OrderOpenInfo struct {
// 行动点模型
ActionOpenInfos []ActionOpenInfo `json:"action_open_infos,omitempty" xml:"action_open_infos>action_open_info,omitempty"`
// 主单业务上下文
BizContext string `json:"biz_context,omitempty" xml:"biz_context,omitempty"`
// 主单业务状态
BizStatus string `json:"biz_status,omitempty" xml:"biz_status,omitempty"`
// 主单状态中文描述
BizStatusDesc string `json:"biz_status_desc,omitempty" xml:"biz_status_desc,omitempty"`
// 主单扩展信息
ExtInfo string `json:"ext_info,omitempty" xml:"ext_info,omitempty"`
// 下单渠道
OrderChannel string `json:"order_channel,omitempty" xml:"order_channel,omitempty"`
// 订单详情页跳转链接
OrderDetailUrl string `json:"order_detail_url,omitempty" xml:"order_detail_url,omitempty"`
// 下单子渠道
OrderSubChannel string `json:"order_sub_channel,omitempty" xml:"order_sub_channel,omitempty"`
// 订单标题
Subject string `json:"subject,omitempty" xml:"subject,omitempty"`
// 主单资金明细
FundOpenInfo *FundOpenInfo `json:"fund_open_info,omitempty" xml:"fund_open_info,omitempty"`
}
var poolOrderOpenInfo = sync.Pool{
New: func() any {
return new(OrderOpenInfo)
},
}
// GetOrderOpenInfo() 从对象池中获取OrderOpenInfo
func GetOrderOpenInfo() *OrderOpenInfo {
return poolOrderOpenInfo.Get().(*OrderOpenInfo)
}
// ReleaseOrderOpenInfo 释放OrderOpenInfo
func ReleaseOrderOpenInfo(v *OrderOpenInfo) {
v.ActionOpenInfos = v.ActionOpenInfos[:0]
v.BizContext = ""
v.BizStatus = ""
v.BizStatusDesc = ""
v.ExtInfo = ""
v.OrderChannel = ""
v.OrderDetailUrl = ""
v.OrderSubChannel = ""
v.Subject = ""
v.FundOpenInfo = nil
poolOrderOpenInfo.Put(v)
}