package com.aegis.notification.domain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aegis.common.core.domain.BaseEntity;

/**
 * 通知模板实体类 sys_notification_template
 * 
 * @author aegis
 */
public class NotificationTemplate extends BaseEntity {
    
    private static final long serialVersionUID = 1L;

    /** 模板ID */
    private Long id;

    /** 模板编码（唯一） */
    private String templateCode;

    /** 模板名称 */
    private String templateName;

    /** 业务类型：plan_publish-预案发布，plan_approve-预案审批等 */
    private String businessType;

    /** 通知渠道：station-站内消息，sms-短信，email-邮件 */
    private String channel;

    /** 标题模板（支持变量：${变量名}） */
    private String titleTemplate;

    /** 内容模板（支持变量：${变量名}） */
    private String contentTemplate;

    /** 模板变量说明（JSON格式） */
    private String variables;

    /** 状态（0正常 1停用） */
    private String status;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @NotBlank(message = "模板编码不能为空")
    @Size(min = 0, max = 64, message = "模板编码长度不能超过64个字符")
    public String getTemplateCode() {
        return templateCode;
    }

    public void setTemplateCode(String templateCode) {
        this.templateCode = templateCode;
    }

    @NotBlank(message = "模板名称不能为空")
    @Size(min = 0, max = 100, message = "模板名称长度不能超过100个字符")
    public String getTemplateName() {
        return templateName;
    }

    public void setTemplateName(String templateName) {
        this.templateName = templateName;
    }

    @NotBlank(message = "业务类型不能为空")
    @Size(min = 0, max = 64, message = "业务类型长度不能超过64个字符")
    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    @NotBlank(message = "通知渠道不能为空")
    @Size(min = 0, max = 16, message = "通知渠道长度不能超过16个字符")
    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    @NotBlank(message = "标题模板不能为空")
    @Size(min = 0, max = 200, message = "标题模板长度不能超过200个字符")
    public String getTitleTemplate() {
        return titleTemplate;
    }

    public void setTitleTemplate(String titleTemplate) {
        this.titleTemplate = titleTemplate;
    }

    @NotBlank(message = "内容模板不能为空")
    public String getContentTemplate() {
        return contentTemplate;
    }

    public void setContentTemplate(String contentTemplate) {
        this.contentTemplate = contentTemplate;
    }

    public String getVariables() {
        return variables;
    }

    public void setVariables(String variables) {
        this.variables = variables;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("templateCode", getTemplateCode())
            .append("templateName", getTemplateName())
            .append("businessType", getBusinessType())
            .append("channel", getChannel())
            .append("titleTemplate", getTitleTemplate())
            .append("contentTemplate", getContentTemplate())
            .append("variables", getVariables())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}