package com.jiayue.ipfcst.common.data.abst;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.core.annotation.Order;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.Date;

/**
 * 所有实体的基类
 *
 * @author zzy
 * @version 2.0
 * @since 2018/10/11 11:08
 */
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public
class AbstractBaseEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 备用字段A
	 */
	@Order(200)
	@Column
	@ApiModelProperty("备用字段A")
	private String backupA;

	/**
	 * 备用字段B
	 */
	@Order(201)
	@Column
	@ApiModelProperty("备用字段B")
	private String backupB;

	/**
	 * 备用字段C
	 */
	@Order(202)
	@Column
	@ApiModelProperty("备用字段C")
	private String backupC;

	/**
	 * 备用字段D
	 */
	@Order(203)
	@Column
	@ApiModelProperty("备用字段D")
	private String backupD;

	/**
	 * 备用字段E
	 */
	@Order(204)
	@Column
	@ApiModelProperty("备用字段E")
	private String backupE;

	/**
	 * 备用字段F
	 */
	@Order(205)
	@Column
	@ApiModelProperty("备用字段F")
	private String backupF;


	/**
	 * 创建人,不允许修改
	 */
	@Order(206)
	@CreatedBy
	@Column(updatable = false)
	@ApiModelProperty("创建人")
	private String creator;

	/**
	 * 创建时间,不允许修改
	 */
	@Order(207)
	@CreatedDate
	@Column(updatable = true)
	@ApiModelProperty("创建时间")
	private Date createTime;

	/**
	 * 最后修改者
	 */
	@Order(208)
	@LastModifiedBy
	@Column(insertable = false)
	@ApiModelProperty("修改人")
	private String lastModifier;
	/**
	 * 最后修改时间
	 */
	@Order(209)
	@LastModifiedDate
	@Column(insertable = false)
	@ApiModelProperty("修改时间")
	private Date lastModifyTime;
}
