-
Notifications
You must be signed in to change notification settings - Fork 12
/
QualityUsageDetail.go
52 lines (47 loc) · 1.62 KB
/
QualityUsageDetail.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
package qt
import (
"sync"
)
// QualityUsageDetail 结构体
type QualityUsageDetail struct {
// 质检服务的收费项目码
ArticleItemCode string `json:"article_item_code,omitempty" xml:"article_item_code,omitempty"`
// 该订单中每个质检服务的价格
Price string `json:"price,omitempty" xml:"price,omitempty"`
// 该订单的开通时间
StartDate string `json:"start_date,omitempty" xml:"start_date,omitempty"`
// 该订单的到期时间
EndDate string `json:"end_date,omitempty" xml:"end_date,omitempty"`
// 订购ID
SubId int64 `json:"sub_id,omitempty" xml:"sub_id,omitempty"`
// 用户ID
UserId int64 `json:"user_id,omitempty" xml:"user_id,omitempty"`
// 该订单订购的数量
PurchasAmount int64 `json:"purchas_amount,omitempty" xml:"purchas_amount,omitempty"`
// 该订单已经使用的数量
ApplicationAmount int64 `json:"application_amount,omitempty" xml:"application_amount,omitempty"`
// 该订单中尚未使用的数量
AvailableAmount int64 `json:"available_amount,omitempty" xml:"available_amount,omitempty"`
}
var poolQualityUsageDetail = sync.Pool{
New: func() any {
return new(QualityUsageDetail)
},
}
// GetQualityUsageDetail() 从对象池中获取QualityUsageDetail
func GetQualityUsageDetail() *QualityUsageDetail {
return poolQualityUsageDetail.Get().(*QualityUsageDetail)
}
// ReleaseQualityUsageDetail 释放QualityUsageDetail
func ReleaseQualityUsageDetail(v *QualityUsageDetail) {
v.ArticleItemCode = ""
v.Price = ""
v.StartDate = ""
v.EndDate = ""
v.SubId = 0
v.UserId = 0
v.PurchasAmount = 0
v.ApplicationAmount = 0
v.AvailableAmount = 0
poolQualityUsageDetail.Put(v)
}