@@ -0,0 +1,48 @@ | |||
package cn.com.taiji.core.entity.dict.msgw; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
/*** | |||
* 消息结果 | |||
* @Author weicailin | |||
* @Date 2023/4/19 16:36 | |||
* @Email 13079168756@163.com | |||
*/ | |||
public enum MessageResult { | |||
WAIT("待发送", 1) {}, | |||
SEND("已发送", 2) {}, | |||
EXPIRED("已过期", 3) {}, | |||
FAIL("发送失败", 4) {}, | |||
CANCEL("取消发送", 5) {}, | |||
; | |||
private final String value; | |||
private final int code; | |||
MessageResult(String value, int code) { | |||
this.value = value; | |||
this.code = code; | |||
} | |||
public String getValue() { | |||
return value; | |||
} | |||
public int getCode() { | |||
return code; | |||
} | |||
public static MessageResult findByCode(Integer code) throws ManagerException { | |||
if (null == code) { | |||
throw new ManagerException("证件类型不存在"); | |||
} | |||
for (MessageResult value : MessageResult.values()) { | |||
if (code.equals(value.getCode())) { | |||
return value; | |||
} | |||
} | |||
throw new ManagerException("证件类型不存在"); | |||
} | |||
} |
@@ -3,14 +3,13 @@ package cn.com.taiji.core.entity.msgw; | |||
import java.time.LocalDateTime; | |||
import java.time.format.DateTimeFormatter; | |||
import javax.persistence.Column; | |||
import javax.persistence.Entity; | |||
import javax.persistence.Table; | |||
import javax.persistence.*; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.msgw.MessageType; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -40,7 +39,8 @@ public class MsgwAlarmConfig extends StringPropertyUUIDEntity { | |||
@NotBlank | |||
@Size(max = 100) | |||
@Column(name = "MESSAGE_TYPE") | |||
private String messageType;//消息类型 | |||
@Enumerated(EnumType.STRING) | |||
private MessageType messageType;//消息类型 | |||
@NotBlank | |||
@Size(max = 100) | |||
@Column(name = "STATUS") |
@@ -11,6 +11,8 @@ import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.msgw.MessageResult; | |||
import cn.com.taiji.core.entity.dict.msgw.MessageType; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -40,8 +42,9 @@ public class MsgwSendDetails extends StringPropertyUUIDEntity { | |||
private String modelId;//模板id | |||
@NotBlank | |||
@Size(max = 20) | |||
@Column(name = "CLIENT_TYPE") | |||
private String clientType;//客户端类型 | |||
@Column(name = "MESSAGE_TYPE") | |||
@Enumerated(EnumType.STRING) | |||
private MessageType messageType;//发送客户端类型 | |||
@Size(max = 32) | |||
@Column(name = "MESSAGE_CHANNEL") | |||
private String messageChannel;//发送渠道 | |||
@@ -56,7 +59,8 @@ public class MsgwSendDetails extends StringPropertyUUIDEntity { | |||
@NotBlank | |||
@Size(max = 255) | |||
@Column(name = "SEND_RESULT") | |||
private String sendResult;//发送结果 | |||
@Enumerated(EnumType.STRING) | |||
private MessageResult sendResult;//发送结果 | |||
@Digits(integer=0,fraction=-127) | |||
@Column(name = "RETRY_NUM") | |||
private BigDecimal retryNum;//发送次数 |