package cn.estsh.i3plus.pojo.platform.bean;

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
 * @Description :
 * @Reference :
 * @Author : yunhao
 * @CreateDate : 2020-12-13 16:13
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "SYS_SMS_SEND_RECORD")
@ApiModel(value = "短信发送记录", description = "短信发送记录")
public class SysSmsSendRecord extends BaseBean {

    private static final long serialVersionUID = -3745690058553350416L;

    /**
     * 发送回执ID
     */
    @Column(name = "BIZ_ID")
    @ApiModelProperty(value = "回执id")
    private String bizId;

    /**
     * 软件模块
     */
    @Column(name = "SOFT_TYPE")
    @ApiModelProperty(value = "软件模块")
    private Integer softType;

    public String getSoftTypeTxt() {
        return softType == null ? null : CommonEnumUtil.SOFT_TYPE.valueOfDescription(softType);
    }

    /**
     * 接收手机号
     */
    @Column(name = "RECEIVE_PHONE_NUMBER")
    @ApiModelProperty(value = "接收手机号")
    private String receivePhoneNumber;

    /**
     * 模板代码
     */
    @Column(name = "TEMPLATE_CODE")
    @ApiModelProperty(value = "模板代码")
    private String templateCode;

    /**
     * 模板名称
     */
    @Column(name = "TEMPLATE_NAME")
    @ApiModelProperty(value = "模板名称")
    private String templateName;

    /**
     * 短信签名代码
     */
    @Column(name = "SMS_SIGN_CODE")
    @ApiModelProperty(value = "短信签名代码")
    private String smsSignCode;

    /**
     * 短信签名
     */
    @Column(name = "SMS_SIGN")
    @ApiModelProperty(value = "短信签名")
    private String smsSign;

    /**
     * 短信内容
     */
    @Column(name = "SMS_CONTENT")
    @ApiModelProperty(value = "短信内容")
    private String smsContent;

    /**
     * 短信内容
     */
    @Column(name = "SMS_Param", length = 1000)
    @ApiModelProperty(value = "短信参数")
    private String smsParam;

    /**
     * 短信发送状态
     */
    @AnnoOutputColumn(refClass = ImppEnumUtil.SMS_SEND_STATUS.class)
    @Column(name = "SMS_SEND_STATUS")
    @ApiModelProperty(value = "短信发送状态")
    private Integer smsSendStatus;

    public String getSmsSendStatusTxt() {
        return smsSendStatus == null ? null : ImppEnumUtil.SMS_SEND_STATUS.valueOfDescription(smsSendStatus);
    }

    /**
     * 短信发送时间
     */
    @Column(name = "SEND_DATE_TIME")
    @ApiModelProperty(value = "短信发送时间")
    private String sendDateTime;

    /**
     * 短信接收日期和时间
     */
    @Column(name = "RECEIVE_DATE_TIME")
    @ApiModelProperty(value = "短信接收日期和时间")
    private String receiveDateTime;

    /**
     * 短信发送异常信息
     */
    @Lob
    @Column(name = "SEND_ERR_MSG")
    @ApiModelProperty(value = "短信发送异常信息")
    private String sendErrMsg;
}
