-
Notifications
You must be signed in to change notification settings - Fork 9
/
TvmInsuranceInfo.go
37 lines (32 loc) · 1.11 KB
/
TvmInsuranceInfo.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
package bus
import (
"sync"
)
// TvmInsuranceInfo 结构体
type TvmInsuranceInfo struct {
// 保险名称
InsureName string `json:"insure_name,omitempty" xml:"insure_name,omitempty"`
// 保险唯一id
ProductNo string `json:"product_no,omitempty" xml:"product_no,omitempty"`
// 保险商品单价(单位分)
InsurePrice int64 `json:"insure_price,omitempty" xml:"insure_price,omitempty"`
// 保险状态: -1下单失败 0初始化 1已取消 2已关闭 3已挂起 4已挂起 5未知状态 6未生效 7保障中 8已失效 9退保中 10已退保 11未生效或保障中
InsureStatus int64 `json:"insure_status,omitempty" xml:"insure_status,omitempty"`
}
var poolTvmInsuranceInfo = sync.Pool{
New: func() any {
return new(TvmInsuranceInfo)
},
}
// GetTvmInsuranceInfo() 从对象池中获取TvmInsuranceInfo
func GetTvmInsuranceInfo() *TvmInsuranceInfo {
return poolTvmInsuranceInfo.Get().(*TvmInsuranceInfo)
}
// ReleaseTvmInsuranceInfo 释放TvmInsuranceInfo
func ReleaseTvmInsuranceInfo(v *TvmInsuranceInfo) {
v.InsureName = ""
v.ProductNo = ""
v.InsurePrice = 0
v.InsureStatus = 0
poolTvmInsuranceInfo.Put(v)
}