package me.zhengjie.domain;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @author Zheng Jie
 * @date 2018-11-24
 */
@Entity
@Data
@Table(name = "log")
@NoArgsConstructor
public class Log  implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /** 操作用户 */
    private String username;

    /** 描述 */
    private String description;

    /** 方法名 */
    private String method;

    /** 参数 */
    @Column(columnDefinition = "text")
    private String params;

    /** 日志类型 */
    @Column(name = "log_type")
    private String logType;

    /** 请求ip */
    @Column(name = "request_ip")
    private String requestIp;

    /** 地址 */
    @Column(name = "address")
    private String address;

    /** 浏览器  */
    private String browser;

    /** 请求耗时 */
    private Long time;

    /** 异常详细  */
    @Column(name = "exception_detail", columnDefinition = "text")
    private byte[] exceptionDetail;

    /** 创建日期 */
    @CreationTimestamp
    @Column(name = "create_time")
    private Timestamp createTime;

    public Log(String logType, Long time) {
        this.logType = logType;
        this.time = time;
    }
}

@@ -294,16 +294,103 @@
  = %22log%22
+,%0A       indexes = %7B@Index(name = %22log_create_time_index%22, columnList = %22create_time%22)%7D
 )%0A@NoArg

Add index on log.create_time (#288)