-
Notifications
You must be signed in to change notification settings - Fork 9
/
AwardVo.go
70 lines (65 loc) · 1.95 KB
/
AwardVo.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
package gameact
import (
"sync"
)
// AwardVo 结构体
type AwardVo struct {
// 活动名称
Name string `json:"name,omitempty" xml:"name,omitempty"`
// 根据类型展示不同的名称
TypeName string `json:"type_name,omitempty" xml:"type_name,omitempty"`
// 发奖单位
Unit string `json:"unit,omitempty" xml:"unit,omitempty"`
// 分组描述
GroupDesc string `json:"group_desc,omitempty" xml:"group_desc,omitempty"`
// 简短描述
SimpleDesc string `json:"simple_desc,omitempty" xml:"simple_desc,omitempty"`
// 完整描述
FullDesc string `json:"full_desc,omitempty" xml:"full_desc,omitempty"`
// 超链文案
HyperlinkDesc string `json:"hyperlink_desc,omitempty" xml:"hyperlink_desc,omitempty"`
// 超链url
HyperlinkUrl string `json:"hyperlink_url,omitempty" xml:"hyperlink_url,omitempty"`
// 加密串,对外流水号
SerialNumber string `json:"serial_number,omitempty" xml:"serial_number,omitempty"`
// 奖品id
AwardId int64 `json:"award_id,omitempty" xml:"award_id,omitempty"`
// 活动id
ActivityId int64 `json:"activity_id,omitempty" xml:"activity_id,omitempty"`
// 1:集分宝 2:红包 3:彩票 4:宝点 5:淘金币
Type int64 `json:"type,omitempty" xml:"type,omitempty"`
// 数量
Amount int64 `json:"amount,omitempty" xml:"amount,omitempty"`
// 单位为分
Price int64 `json:"price,omitempty" xml:"price,omitempty"`
// 分组编码
GroupCode int64 `json:"group_code,omitempty" xml:"group_code,omitempty"`
}
var poolAwardVo = sync.Pool{
New: func() any {
return new(AwardVo)
},
}
// GetAwardVo() 从对象池中获取AwardVo
func GetAwardVo() *AwardVo {
return poolAwardVo.Get().(*AwardVo)
}
// ReleaseAwardVo 释放AwardVo
func ReleaseAwardVo(v *AwardVo) {
v.Name = ""
v.TypeName = ""
v.Unit = ""
v.GroupDesc = ""
v.SimpleDesc = ""
v.FullDesc = ""
v.HyperlinkDesc = ""
v.HyperlinkUrl = ""
v.SerialNumber = ""
v.AwardId = 0
v.ActivityId = 0
v.Type = 0
v.Amount = 0
v.Price = 0
v.GroupCode = 0
poolAwardVo.Put(v)
}