-
Notifications
You must be signed in to change notification settings - Fork 9
/
CustomerOutInfo.go
31 lines (26 loc) · 1.2 KB
/
CustomerOutInfo.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
package alsc
import (
"sync"
)
// CustomerOutInfo 结构体
type CustomerOutInfo struct {
// 外部类型 * * 手机号 MOBILE("mobile","手机号注册"), * * 微信openId WECHAT("wechat","微信openid注册"), * * 微信小程序Id WEAPP("weapp","微信小程序注册"), * * 支付宝用户ID ALIPAY("alipay","支付宝id注册"), * * 面部ID FACE_CODE("faceCode","faceCode注册"), * * 座机注册 PHONE_CUSTOMER("phone_customer","座机注册")
OutType string `json:"out_type,omitempty" xml:"out_type,omitempty"`
// 外部id
OutId string `json:"out_id,omitempty" xml:"out_id,omitempty"`
}
var poolCustomerOutInfo = sync.Pool{
New: func() any {
return new(CustomerOutInfo)
},
}
// GetCustomerOutInfo() 从对象池中获取CustomerOutInfo
func GetCustomerOutInfo() *CustomerOutInfo {
return poolCustomerOutInfo.Get().(*CustomerOutInfo)
}
// ReleaseCustomerOutInfo 释放CustomerOutInfo
func ReleaseCustomerOutInfo(v *CustomerOutInfo) {
v.OutType = ""
v.OutId = ""
poolCustomerOutInfo.Put(v)
}