-
Notifications
You must be signed in to change notification settings - Fork 9
/
ItemDigestDto.go
40 lines (35 loc) · 1.02 KB
/
ItemDigestDto.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 trade
import (
"sync"
)
// ItemDigestDto 结构体
type ItemDigestDto struct {
// 图片url
ImgUrl string `json:"img_url,omitempty" xml:"img_url,omitempty"`
// 商品名称
ItemName string `json:"item_name,omitempty" xml:"item_name,omitempty"`
// 商品数量
ItemQuantity string `json:"item_quantity,omitempty" xml:"item_quantity,omitempty"`
// 商品金额
ItemPrice string `json:"item_price,omitempty" xml:"item_price,omitempty"`
// 商品订单状态描述
ItemOrderStatusDesc string `json:"item_order_status_desc,omitempty" xml:"item_order_status_desc,omitempty"`
}
var poolItemDigestDto = sync.Pool{
New: func() any {
return new(ItemDigestDto)
},
}
// GetItemDigestDto() 从对象池中获取ItemDigestDto
func GetItemDigestDto() *ItemDigestDto {
return poolItemDigestDto.Get().(*ItemDigestDto)
}
// ReleaseItemDigestDto 释放ItemDigestDto
func ReleaseItemDigestDto(v *ItemDigestDto) {
v.ImgUrl = ""
v.ItemName = ""
v.ItemQuantity = ""
v.ItemPrice = ""
v.ItemOrderStatusDesc = ""
poolItemDigestDto.Put(v)
}