package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author 田平 create 2023-02-20 02:25:57
 */
@Entity
@Table(name = "tsm_template")
@NamedQuery(name = "TsmTemplate.findAll", query = "SELECT t FROM TsmTemplate t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = { "tempCode" })
@ApiModel(description = "内容模板表")
public class TsmTemplate implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "temp_code")
	@ApiModelProperty(value = "模板编码，手动生成,尽力通过前缀区分模板用途 例如 bsn_send.xml.v1,hlr.json.v12")
	private String tempCode;

	@Column(name = "temp_name")
	@ApiModelProperty(value = "模板名称")
	private String tempName;

	@Column(name = "temp_type")
	@ApiModelProperty(value = "1：接口模板 2：应用模板 3：页面模板")
	private int tempType;

	@Column(name = "temp_content")
	@ApiModelProperty(value = "模板内容可以是任意格式xml,json,properties")
	private String tempContent;

	@Column(name = "create_time")
	@ApiModelProperty(value = "创建时间")
	private java.util.Date createTime;

	@Column(name = "update_time")
	@ApiModelProperty(value = "更新时间")
	private java.util.Date updateTime;

	public String getNoContentStr() {
		return "TsmTemplate [tempCode=" + tempCode + ", tempName=" + tempName + ", tempType=" + tempType + ", createTime=" + createTime
				+ ", updateTime=" + updateTime + "]";
	}

}
