package com.ruoyi.system.domain;
|
|
import java.util.Date;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
|
/**
|
* 通知发送记录对象 sys_notify_send_log
|
* 用于记录各类通知消息的发送记录,实现防重机制
|
*
|
* @author ruoyi
|
* @date 2025-12-07
|
*/
|
public class NotifySendLog extends BaseEntity {
|
|
private static final long serialVersionUID = 1L;
|
|
/** 主键ID */
|
private Long id;
|
|
/** 关联的通知任务ID */
|
@Excel(name = "通知任务ID")
|
private Long notifyTaskId;
|
|
/** 任务ID */
|
@Excel(name = "任务ID")
|
private Long taskId;
|
|
/** 接收用户ID */
|
@Excel(name = "用户ID")
|
private Long userId;
|
|
/** 接收用户姓名 */
|
@Excel(name = "用户姓名")
|
private String userName;
|
|
/** 通知类型:TASK_ASSIGN-任务分配, STATUS_CHANGE-状态变更, TASK_CREATE-任务创建 */
|
@Excel(name = "通知类型")
|
private String notifyType;
|
|
/** 通知渠道:WECHAT-微信订阅消息, SMS-短信, APP_PUSH-APP推送, SITE_MSG-站内消息 */
|
@Excel(name = "通知渠道")
|
private String channel;
|
|
/** 发送状态:0-待发送, 1-发送成功, 2-发送失败 */
|
@Excel(name = "发送状态")
|
private String sendStatus;
|
|
/** 发送的内容 */
|
private String sendContent;
|
|
/** 发送时间 */
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
private Date sendTime;
|
|
/** 发送结果/错误信息 */
|
@Excel(name = "发送结果")
|
private String sendResult;
|
|
/** 响应消息 */
|
private String responseMsg;
|
|
/** 重试次数 */
|
@Excel(name = "重试次数")
|
private Integer retryCount;
|
|
// ==================== 通知类型常量 ====================
|
/** 任务分配通知 */
|
public static final String NOTIFY_TYPE_TASK_ASSIGN = "TASK_ASSIGN";
|
/** 状态变更通知 */
|
public static final String NOTIFY_TYPE_STATUS_CHANGE = "STATUS_CHANGE";
|
/** 任务创建通知 */
|
public static final String NOTIFY_TYPE_TASK_CREATE = "TASK_CREATE";
|
|
// ==================== 通知渠道常量 ====================
|
/** 微信订阅消息 */
|
public static final String CHANNEL_WECHAT = "WECHAT";
|
/** 短信 */
|
public static final String CHANNEL_SMS = "SMS";
|
/** APP推送 */
|
public static final String CHANNEL_APP_PUSH = "APP_PUSH";
|
/** 站内消息 */
|
public static final String CHANNEL_SITE_MSG = "SITE_MSG";
|
|
// ==================== 发送状态常量 ====================
|
/** 待发送 */
|
public static final String SEND_STATUS_PENDING = "0";
|
/** 发送成功 */
|
public static final String SEND_STATUS_SUCCESS = "1";
|
/** 发送失败 */
|
public static final String SEND_STATUS_FAILED = "2";
|
|
public Long getId() {
|
return id;
|
}
|
|
public void setId(Long id) {
|
this.id = id;
|
}
|
|
public Long getNotifyTaskId() {
|
return notifyTaskId;
|
}
|
|
public void setNotifyTaskId(Long notifyTaskId) {
|
this.notifyTaskId = notifyTaskId;
|
}
|
|
public Long getTaskId() {
|
return taskId;
|
}
|
|
public void setTaskId(Long taskId) {
|
this.taskId = taskId;
|
}
|
|
public Long getUserId() {
|
return userId;
|
}
|
|
public void setUserId(Long userId) {
|
this.userId = userId;
|
}
|
|
public String getUserName() {
|
return userName;
|
}
|
|
public void setUserName(String userName) {
|
this.userName = userName;
|
}
|
|
public String getNotifyType() {
|
return notifyType;
|
}
|
|
public void setNotifyType(String notifyType) {
|
this.notifyType = notifyType;
|
}
|
|
public String getChannel() {
|
return channel;
|
}
|
|
public void setChannel(String channel) {
|
this.channel = channel;
|
}
|
|
public String getSendStatus() {
|
return sendStatus;
|
}
|
|
public void setSendStatus(String sendStatus) {
|
this.sendStatus = sendStatus;
|
}
|
|
public Date getSendTime() {
|
return sendTime;
|
}
|
|
public void setSendTime(Date sendTime) {
|
this.sendTime = sendTime;
|
}
|
|
public String getSendResult() {
|
return sendResult;
|
}
|
|
public void setSendResult(String sendResult) {
|
this.sendResult = sendResult;
|
}
|
|
public String getSendContent() {
|
return sendContent;
|
}
|
|
public void setSendContent(String sendContent) {
|
this.sendContent = sendContent;
|
}
|
|
public String getResponseMsg() {
|
return responseMsg;
|
}
|
|
public void setResponseMsg(String responseMsg) {
|
this.responseMsg = responseMsg;
|
}
|
|
public Integer getRetryCount() {
|
return retryCount;
|
}
|
|
public void setRetryCount(Integer retryCount) {
|
this.retryCount = retryCount;
|
}
|
|
@Override
|
public String toString() {
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
.append("id", getId())
|
.append("taskId", getTaskId())
|
.append("userId", getUserId())
|
.append("userName", getUserName())
|
.append("notifyType", getNotifyType())
|
.append("channel", getChannel())
|
.append("sendStatus", getSendStatus())
|
.append("sendTime", getSendTime())
|
.append("sendResult", getSendResult())
|
.append("sendContent", getSendContent())
|
.append("retryCount", getRetryCount())
|
.append("createTime", getCreateTime())
|
.append("createBy", getCreateBy())
|
.append("updateTime", getUpdateTime())
|
.append("updateBy", getUpdateBy())
|
.append("remark", getRemark())
|
.toString();
|
}
|
}
|