package com.zjty.inspect.entity;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;

/**
 * 规则类
 * @author mcj
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
//@Table(name = "master_rule")
@ApiModel(value = "规则类")
public class MasterRule {

    /**
     * 主键id
     */
    @Id
    @Column(length = 48)
    private String id;
    /**
     * 适配技术名称
     */
    private String technologyName;
    /**
     * 目标关键字
     */
    private String target;
    /**
     * 匹配的文件后缀
     */
    private String suffix;

    /**
     * 适配技术id
     */
    private String technologyId;
    /**
     * 数据创建时间
     */
    @Column(name="create_time",columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP",insertable = false,updatable = false)
    @CreatedDate
    private Date createDate;

    /**
     * 数据更新时间
     */
    @Column(name="update_time",columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP",insertable = false)
    @LastModifiedDate
    private Date updateDate;
}
