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("证件类型不存在"); | |||||
} | |||||
} |
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.time.format.DateTimeFormatter; | 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.NotBlank; | ||||
import javax.validation.constraints.NotNull; | import javax.validation.constraints.NotNull; | ||||
import javax.validation.constraints.Size; | import javax.validation.constraints.Size; | ||||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | ||||
import cn.com.taiji.core.entity.dict.msgw.MessageType; | |||||
import lombok.Getter; | import lombok.Getter; | ||||
import lombok.Setter; | import lombok.Setter; | ||||
@NotBlank | @NotBlank | ||||
@Size(max = 100) | @Size(max = 100) | ||||
@Column(name = "MESSAGE_TYPE") | @Column(name = "MESSAGE_TYPE") | ||||
private String messageType;//消息类型 | |||||
@Enumerated(EnumType.STRING) | |||||
private MessageType messageType;//消息类型 | |||||
@NotBlank | @NotBlank | ||||
@Size(max = 100) | @Size(max = 100) | ||||
@Column(name = "STATUS") | @Column(name = "STATUS") |
import javax.validation.constraints.Size; | import javax.validation.constraints.Size; | ||||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | 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.Getter; | ||||
import lombok.Setter; | import lombok.Setter; | ||||
private String modelId;//模板id | private String modelId;//模板id | ||||
@NotBlank | @NotBlank | ||||
@Size(max = 20) | @Size(max = 20) | ||||
@Column(name = "CLIENT_TYPE") | |||||
private String clientType;//客户端类型 | |||||
@Column(name = "MESSAGE_TYPE") | |||||
@Enumerated(EnumType.STRING) | |||||
private MessageType messageType;//发送客户端类型 | |||||
@Size(max = 32) | @Size(max = 32) | ||||
@Column(name = "MESSAGE_CHANNEL") | @Column(name = "MESSAGE_CHANNEL") | ||||
private String messageChannel;//发送渠道 | private String messageChannel;//发送渠道 | ||||
@NotBlank | @NotBlank | ||||
@Size(max = 255) | @Size(max = 255) | ||||
@Column(name = "SEND_RESULT") | @Column(name = "SEND_RESULT") | ||||
private String sendResult;//发送结果 | |||||
@Enumerated(EnumType.STRING) | |||||
private MessageResult sendResult;//发送结果 | |||||
@Digits(integer=0,fraction=-127) | @Digits(integer=0,fraction=-127) | ||||
@Column(name = "RETRY_NUM") | @Column(name = "RETRY_NUM") | ||||
private BigDecimal retryNum;//发送次数 | private BigDecimal retryNum;//发送次数 |