/
OfficialAppVerifyResponse.go
55 lines (50 loc) · 1.77 KB
/
OfficialAppVerifyResponse.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
53
54
55
package security
import (
"sync"
)
// OfficialAppVerifyResponse 结构体
type OfficialAppVerifyResponse struct {
// 应用名
AppName string `json:"app_name,omitempty" xml:"app_name,omitempty"`
// 包名
PkgName string `json:"pkg_name,omitempty" xml:"pkg_name,omitempty"`
// 开发者
Developer string `json:"developer,omitempty" xml:"developer,omitempty"`
// message
ErrMsg string `json:"err_msg,omitempty" xml:"err_msg,omitempty"`
// 证书md5
CertMd5 string `json:"cert_md5,omitempty" xml:"cert_md5,omitempty"`
// 查询任务状态0-处理中 1-处理完成
Status int64 `json:"status,omitempty" xml:"status,omitempty"`
// 任务轮询间隔,单位毫秒
QueryInterval int64 `json:"query_interval,omitempty" xml:"query_interval,omitempty"`
// 错误码 400-参数错误 500-服务错误
ErrCode int64 `json:"err_code,omitempty" xml:"err_code,omitempty"`
// 0-未知 1-官方正式 2-官方开发 3-非官方应用 4-待定
OfficialResult int64 `json:"official_result,omitempty" xml:"official_result,omitempty"`
// 请求是否成功
Success bool `json:"success,omitempty" xml:"success,omitempty"`
}
var poolOfficialAppVerifyResponse = sync.Pool{
New: func() any {
return new(OfficialAppVerifyResponse)
},
}
// GetOfficialAppVerifyResponse() 从对象池中获取OfficialAppVerifyResponse
func GetOfficialAppVerifyResponse() *OfficialAppVerifyResponse {
return poolOfficialAppVerifyResponse.Get().(*OfficialAppVerifyResponse)
}
// ReleaseOfficialAppVerifyResponse 释放OfficialAppVerifyResponse
func ReleaseOfficialAppVerifyResponse(v *OfficialAppVerifyResponse) {
v.AppName = ""
v.PkgName = ""
v.Developer = ""
v.ErrMsg = ""
v.CertMd5 = ""
v.Status = 0
v.QueryInterval = 0
v.ErrCode = 0
v.OfficialResult = 0
v.Success = false
poolOfficialAppVerifyResponse.Put(v)
}