-
Notifications
You must be signed in to change notification settings - Fork 9
/
GenShortLinkRequest.go
34 lines (29 loc) · 1.48 KB
/
GenShortLinkRequest.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
package alsc
import (
"sync"
)
// GenShortLinkRequest 结构体
type GenShortLinkRequest struct {
// 域名类型,按实际填写,目前映射关系:{ "alipay": "alipays://platformapi/startapp", "duanqu": "https://m.duanqu.com", "eleH5": "https://h5.ele.me", "eleMiniApp": "eleme://miniapp", "elemeSns": "eleme://sns_share_v2", "koubei": "koubei://platformapi/startapp", "mod": "https://tb.ele.me", "modPpe": "https://ppe-tb.ele.me", "ppe-r": "https://ppe-r.ele.me", "pt": "https://pt.ele.me", "ptPre": "https://ppe-pt.ele.me", "r": "https://r.ele.me" }
DomainType string `json:"domain_type,omitempty" xml:"domain_type,omitempty"`
// 域名后面的路径
Path string `json:"path,omitempty" xml:"path,omitempty"`
// 业务场景
BizScene string `json:"biz_scene,omitempty" xml:"biz_scene,omitempty"`
}
var poolGenShortLinkRequest = sync.Pool{
New: func() any {
return new(GenShortLinkRequest)
},
}
// GetGenShortLinkRequest() 从对象池中获取GenShortLinkRequest
func GetGenShortLinkRequest() *GenShortLinkRequest {
return poolGenShortLinkRequest.Get().(*GenShortLinkRequest)
}
// ReleaseGenShortLinkRequest 释放GenShortLinkRequest
func ReleaseGenShortLinkRequest(v *GenShortLinkRequest) {
v.DomainType = ""
v.Path = ""
v.BizScene = ""
poolGenShortLinkRequest.Put(v)
}