yangys
2024-04-04 ed4a5236bab800094be4a8378f5098eebe3de6ac
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
package com.qianwen.smartman.modules.notify.entity;
 
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.Map;
import org.apache.ibatis.type.JdbcType;
import com.qianwen.core.mp.base.BaseEntity;
import com.qianwen.core.notify.event.SerializableNotifierEvent;
import com.qianwen.core.tool.utils.BeanUtil;
import com.qianwen.core.tool.utils.DateUtil;
import com.qianwen.smartman.modules.notify.enums.NotifyState;
 
@ApiModel(value = "通知历史", description = "通知历史")
@TableName(value = "blade_notify_history", autoResultMap = true)
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/entity/NotifyHistoryEntity.class */
public class NotifyHistoryEntity extends BaseEntity {
    @ApiModelProperty("追溯ID")
    private String tranceId;
    @ApiModelProperty("通知ID")
    private String notifierId;
    @ApiModelProperty("通知状态")
    private NotifyState state;
    @ApiModelProperty("错误类型")
    private String errorType;
    @TableField(jdbcType = JdbcType.CLOB)
    @ApiModelProperty("异常栈")
    private String errorStack;
    @ApiModelProperty("模版ID")
    private String templateId;
    @TableField(jdbcType = JdbcType.CLOB)
    @ApiModelProperty("模版内容")
    private String template;
    @TableField(jdbcType = JdbcType.CLOB, typeHandler = JacksonTypeHandler.class)
    @ApiModelProperty("上下文")
    private Map<String, Object> contextData;
    @ApiModelProperty("服务商")
    private String provider;
    @ApiModelProperty("通知类型")
    private String notifyType;
    @ApiModelProperty("通知时间")
    private Date notifyTime;
    @ApiModelProperty("重试次数")
    private Integer retryTimes;
    @ApiModelProperty("业务名称")
    private String businessName;
    @ApiModelProperty("通知类型名称")
    private String notifyTypeName;
 
    public void setTranceId(final String tranceId) {
        this.tranceId = tranceId;
    }
 
    public void setNotifierId(final String notifierId) {
        this.notifierId = notifierId;
    }
 
    public void setState(final NotifyState state) {
        this.state = state;
    }
 
    public void setErrorType(final String errorType) {
        this.errorType = errorType;
    }
 
    public void setErrorStack(final String errorStack) {
        this.errorStack = errorStack;
    }
 
    public void setTemplateId(final String templateId) {
        this.templateId = templateId;
    }
 
    public void setTemplate(final String template) {
        this.template = template;
    }
 
    public void setContextData(final Map<String, Object> contextData) {
        this.contextData = contextData;
    }
 
    public void setProvider(final String provider) {
        this.provider = provider;
    }
 
    public void setNotifyType(final String notifyType) {
        this.notifyType = notifyType;
    }
 
    public void setNotifyTime(final Date notifyTime) {
        this.notifyTime = notifyTime;
    }
 
    public void setRetryTimes(final Integer retryTimes) {
        this.retryTimes = retryTimes;
    }
 
    public void setBusinessName(final String businessName) {
        this.businessName = businessName;
    }
 
    public void setNotifyTypeName(final String notifyTypeName) {
        this.notifyTypeName = notifyTypeName;
    }
 
    public String toString() {
        return "NotifyHistoryEntity(tranceId=" + getTranceId() + ", notifierId=" + getNotifierId() + ", state=" + getState() + ", errorType=" + getErrorType() + ", errorStack=" + getErrorStack() + ", templateId=" + getTemplateId() + ", template=" + getTemplate() + ", contextData=" + getContextData() + ", provider=" + getProvider() + ", notifyType=" + getNotifyType() + ", notifyTime=" + getNotifyTime() + ", retryTimes=" + getRetryTimes() + ", businessName=" + getBusinessName() + ", notifyTypeName=" + getNotifyTypeName() + ")";
    }
 
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (o instanceof NotifyHistoryEntity) {
            NotifyHistoryEntity other = (NotifyHistoryEntity) o;
            if (other.canEqual(this) && super.equals(o)) {
                Object this$retryTimes = getRetryTimes();
                Object other$retryTimes = other.getRetryTimes();
                if (this$retryTimes == null) {
                    if (other$retryTimes != null) {
                        return false;
                    }
                } else if (!this$retryTimes.equals(other$retryTimes)) {
                    return false;
                }
                Object this$tranceId = getTranceId();
                Object other$tranceId = other.getTranceId();
                if (this$tranceId == null) {
                    if (other$tranceId != null) {
                        return false;
                    }
                } else if (!this$tranceId.equals(other$tranceId)) {
                    return false;
                }
                Object this$notifierId = getNotifierId();
                Object other$notifierId = other.getNotifierId();
                if (this$notifierId == null) {
                    if (other$notifierId != null) {
                        return false;
                    }
                } else if (!this$notifierId.equals(other$notifierId)) {
                    return false;
                }
                Object this$state = getState();
                Object other$state = other.getState();
                if (this$state == null) {
                    if (other$state != null) {
                        return false;
                    }
                } else if (!this$state.equals(other$state)) {
                    return false;
                }
                Object this$errorType = getErrorType();
                Object other$errorType = other.getErrorType();
                if (this$errorType == null) {
                    if (other$errorType != null) {
                        return false;
                    }
                } else if (!this$errorType.equals(other$errorType)) {
                    return false;
                }
                Object this$errorStack = getErrorStack();
                Object other$errorStack = other.getErrorStack();
                if (this$errorStack == null) {
                    if (other$errorStack != null) {
                        return false;
                    }
                } else if (!this$errorStack.equals(other$errorStack)) {
                    return false;
                }
                Object this$templateId = getTemplateId();
                Object other$templateId = other.getTemplateId();
                if (this$templateId == null) {
                    if (other$templateId != null) {
                        return false;
                    }
                } else if (!this$templateId.equals(other$templateId)) {
                    return false;
                }
                Object this$template = getTemplate();
                Object other$template = other.getTemplate();
                if (this$template == null) {
                    if (other$template != null) {
                        return false;
                    }
                } else if (!this$template.equals(other$template)) {
                    return false;
                }
                Object this$contextData = getContextData();
                Object other$contextData = other.getContextData();
                if (this$contextData == null) {
                    if (other$contextData != null) {
                        return false;
                    }
                } else if (!this$contextData.equals(other$contextData)) {
                    return false;
                }
                Object this$provider = getProvider();
                Object other$provider = other.getProvider();
                if (this$provider == null) {
                    if (other$provider != null) {
                        return false;
                    }
                } else if (!this$provider.equals(other$provider)) {
                    return false;
                }
                Object this$notifyType = getNotifyType();
                Object other$notifyType = other.getNotifyType();
                if (this$notifyType == null) {
                    if (other$notifyType != null) {
                        return false;
                    }
                } else if (!this$notifyType.equals(other$notifyType)) {
                    return false;
                }
                Object this$notifyTime = getNotifyTime();
                Object other$notifyTime = other.getNotifyTime();
                if (this$notifyTime == null) {
                    if (other$notifyTime != null) {
                        return false;
                    }
                } else if (!this$notifyTime.equals(other$notifyTime)) {
                    return false;
                }
                Object this$businessName = getBusinessName();
                Object other$businessName = other.getBusinessName();
                if (this$businessName == null) {
                    if (other$businessName != null) {
                        return false;
                    }
                } else if (!this$businessName.equals(other$businessName)) {
                    return false;
                }
                Object this$notifyTypeName = getNotifyTypeName();
                Object other$notifyTypeName = other.getNotifyTypeName();
                return this$notifyTypeName == null ? other$notifyTypeName == null : this$notifyTypeName.equals(other$notifyTypeName);
            }
            return false;
        }
        return false;
    }
 
    protected boolean canEqual(final Object other) {
        return other instanceof NotifyHistoryEntity;
    }
 
    public int hashCode() {
        int result = super.hashCode();
        Object $retryTimes = getRetryTimes();
        int result2 = (result * 59) + ($retryTimes == null ? 43 : $retryTimes.hashCode());
        Object $tranceId = getTranceId();
        int result3 = (result2 * 59) + ($tranceId == null ? 43 : $tranceId.hashCode());
        Object $notifierId = getNotifierId();
        int result4 = (result3 * 59) + ($notifierId == null ? 43 : $notifierId.hashCode());
        Object $state = getState();
        int result5 = (result4 * 59) + ($state == null ? 43 : $state.hashCode());
        Object $errorType = getErrorType();
        int result6 = (result5 * 59) + ($errorType == null ? 43 : $errorType.hashCode());
        Object $errorStack = getErrorStack();
        int result7 = (result6 * 59) + ($errorStack == null ? 43 : $errorStack.hashCode());
        Object $templateId = getTemplateId();
        int result8 = (result7 * 59) + ($templateId == null ? 43 : $templateId.hashCode());
        Object $template = getTemplate();
        int result9 = (result8 * 59) + ($template == null ? 43 : $template.hashCode());
        Object $contextData = getContextData();
        int result10 = (result9 * 59) + ($contextData == null ? 43 : $contextData.hashCode());
        Object $provider = getProvider();
        int result11 = (result10 * 59) + ($provider == null ? 43 : $provider.hashCode());
        Object $notifyType = getNotifyType();
        int result12 = (result11 * 59) + ($notifyType == null ? 43 : $notifyType.hashCode());
        Object $notifyTime = getNotifyTime();
        int result13 = (result12 * 59) + ($notifyTime == null ? 43 : $notifyTime.hashCode());
        Object $businessName = getBusinessName();
        int result14 = (result13 * 59) + ($businessName == null ? 43 : $businessName.hashCode());
        Object $notifyTypeName = getNotifyTypeName();
        return (result14 * 59) + ($notifyTypeName == null ? 43 : $notifyTypeName.hashCode());
    }
 
    public String getTranceId() {
        return this.tranceId;
    }
 
    public String getNotifierId() {
        return this.notifierId;
    }
 
    public NotifyState getState() {
        return this.state;
    }
 
    public String getErrorType() {
        return this.errorType;
    }
 
    public String getErrorStack() {
        return this.errorStack;
    }
 
    public String getTemplateId() {
        return this.templateId;
    }
 
    public String getTemplate() {
        return this.template;
    }
 
    public Map<String, Object> getContextData() {
        return this.contextData;
    }
 
    public String getProvider() {
        return this.provider;
    }
 
    public String getNotifyType() {
        return this.notifyType;
    }
 
    public Date getNotifyTime() {
        return this.notifyTime;
    }
 
    public Integer getRetryTimes() {
        return this.retryTimes;
    }
 
    public String getBusinessName() {
        return this.businessName;
    }
 
    public String getNotifyTypeName() {
        return this.notifyTypeName;
    }
 
    public static NotifyHistoryEntity of(SerializableNotifierEvent event) {
        NotifyHistoryEntity entity = (NotifyHistoryEntity) BeanUtil.copy(event, NotifyHistoryEntity.class);
        if (null != event.getTemplate()) {
            entity.setTemplate(JSON.toJSONString(event.getTemplate()));
        }
        if (event.isSuccess()) {
            entity.setState(NotifyState.success);
        } else {
            entity.setErrorStack(event.getCause());
            entity.setState(NotifyState.error);
        }
        entity.setNotifyTime(DateUtil.now());
        return entity;
    }
}