/
TaobaoCmedicalFaceDetectionCallbackAPIRequest.go
158 lines (135 loc) · 4.53 KB
/
TaobaoCmedicalFaceDetectionCallbackAPIRequest.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
package dt
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoCmedicalFaceDetectionCallbackAPIRequest 魔镜测肤结果数据回调接口 API请求
// taobao.cmedical.face.detection.callback
//
// 消费医疗魔镜项目,isv将异步测肤结果数据,回传给行业。
type TaobaoCmedicalFaceDetectionCallbackAPIRequest struct {
model.Params
// 一次测肤接口的唯一请求id
_requestId string
// isv身份识别
_identity string
// 场景,直播:live,店铺:shop
_scene string
// 测肤结果数据
_data string
// 错误消息
_errorMsg string
// true:成功,false:失败
_success bool
}
// NewTaobaoCmedicalFaceDetectionCallbackRequest 初始化TaobaoCmedicalFaceDetectionCallbackAPIRequest对象
func NewTaobaoCmedicalFaceDetectionCallbackRequest() *TaobaoCmedicalFaceDetectionCallbackAPIRequest {
return &TaobaoCmedicalFaceDetectionCallbackAPIRequest{
Params: model.NewParams(6),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *TaobaoCmedicalFaceDetectionCallbackAPIRequest) Reset() {
r._requestId = ""
r._identity = ""
r._scene = ""
r._data = ""
r._errorMsg = ""
r._success = false
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoCmedicalFaceDetectionCallbackAPIRequest) GetApiMethodName() string {
return "taobao.cmedical.face.detection.callback"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoCmedicalFaceDetectionCallbackAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoCmedicalFaceDetectionCallbackAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetRequestId is RequestId Setter
// 一次测肤接口的唯一请求id
func (r *TaobaoCmedicalFaceDetectionCallbackAPIRequest) SetRequestId(_requestId string) error {
r._requestId = _requestId
r.Set("request_id", _requestId)
return nil
}
// GetRequestId RequestId Getter
func (r TaobaoCmedicalFaceDetectionCallbackAPIRequest) GetRequestId() string {
return r._requestId
}
// SetIdentity is Identity Setter
// isv身份识别
func (r *TaobaoCmedicalFaceDetectionCallbackAPIRequest) SetIdentity(_identity string) error {
r._identity = _identity
r.Set("identity", _identity)
return nil
}
// GetIdentity Identity Getter
func (r TaobaoCmedicalFaceDetectionCallbackAPIRequest) GetIdentity() string {
return r._identity
}
// SetScene is Scene Setter
// 场景,直播:live,店铺:shop
func (r *TaobaoCmedicalFaceDetectionCallbackAPIRequest) SetScene(_scene string) error {
r._scene = _scene
r.Set("scene", _scene)
return nil
}
// GetScene Scene Getter
func (r TaobaoCmedicalFaceDetectionCallbackAPIRequest) GetScene() string {
return r._scene
}
// SetData is Data Setter
// 测肤结果数据
func (r *TaobaoCmedicalFaceDetectionCallbackAPIRequest) SetData(_data string) error {
r._data = _data
r.Set("data", _data)
return nil
}
// GetData Data Getter
func (r TaobaoCmedicalFaceDetectionCallbackAPIRequest) GetData() string {
return r._data
}
// SetErrorMsg is ErrorMsg Setter
// 错误消息
func (r *TaobaoCmedicalFaceDetectionCallbackAPIRequest) SetErrorMsg(_errorMsg string) error {
r._errorMsg = _errorMsg
r.Set("error_msg", _errorMsg)
return nil
}
// GetErrorMsg ErrorMsg Getter
func (r TaobaoCmedicalFaceDetectionCallbackAPIRequest) GetErrorMsg() string {
return r._errorMsg
}
// SetSuccess is Success Setter
// true:成功,false:失败
func (r *TaobaoCmedicalFaceDetectionCallbackAPIRequest) SetSuccess(_success bool) error {
r._success = _success
r.Set("success", _success)
return nil
}
// GetSuccess Success Getter
func (r TaobaoCmedicalFaceDetectionCallbackAPIRequest) GetSuccess() bool {
return r._success
}
var poolTaobaoCmedicalFaceDetectionCallbackAPIRequest = sync.Pool{
New: func() any {
return NewTaobaoCmedicalFaceDetectionCallbackRequest()
},
}
// GetTaobaoCmedicalFaceDetectionCallbackRequest 从 sync.Pool 获取 TaobaoCmedicalFaceDetectionCallbackAPIRequest
func GetTaobaoCmedicalFaceDetectionCallbackAPIRequest() *TaobaoCmedicalFaceDetectionCallbackAPIRequest {
return poolTaobaoCmedicalFaceDetectionCallbackAPIRequest.Get().(*TaobaoCmedicalFaceDetectionCallbackAPIRequest)
}
// ReleaseTaobaoCmedicalFaceDetectionCallbackAPIRequest 将 TaobaoCmedicalFaceDetectionCallbackAPIRequest 放入 sync.Pool
func ReleaseTaobaoCmedicalFaceDetectionCallbackAPIRequest(v *TaobaoCmedicalFaceDetectionCallbackAPIRequest) {
v.Reset()
poolTaobaoCmedicalFaceDetectionCallbackAPIRequest.Put(v)
}