-
Notifications
You must be signed in to change notification settings - Fork 9
/
FamilyInfo.go
40 lines (35 loc) · 937 Bytes
/
FamilyInfo.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 wdk
import (
"sync"
)
// FamilyInfo 结构体
type FamilyInfo struct {
// 手机号码
Contact string `json:"contact,omitempty" xml:"contact,omitempty"`
// 家庭成员姓名
FamilyName string `json:"family_name,omitempty" xml:"family_name,omitempty"`
// 职位
Post string `json:"post,omitempty" xml:"post,omitempty"`
// 关系
Relationship string `json:"relationship,omitempty" xml:"relationship,omitempty"`
// 工作单位
WorkCompany string `json:"work_company,omitempty" xml:"work_company,omitempty"`
}
var poolFamilyInfo = sync.Pool{
New: func() any {
return new(FamilyInfo)
},
}
// GetFamilyInfo() 从对象池中获取FamilyInfo
func GetFamilyInfo() *FamilyInfo {
return poolFamilyInfo.Get().(*FamilyInfo)
}
// ReleaseFamilyInfo 释放FamilyInfo
func ReleaseFamilyInfo(v *FamilyInfo) {
v.Contact = ""
v.FamilyName = ""
v.Post = ""
v.Relationship = ""
v.WorkCompany = ""
poolFamilyInfo.Put(v)
}