package com.ff.weijinxiao.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.weijinxiao.util.jsonfilter.DateSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

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

@Data
@Entity
@Table(name = "tb_system_log")
public class SystemLog {

    private static final long serialVersionUID = 1L;

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

    //操作用户
    @Column(name = "log_account", length = 50)
    private String logAccount;

    //操作用户姓名
    @Column(name = "log_user", length = 50)
    private String logUser;

    //操作内容
    @Column(name = "log_content", length = 250)
    private String logContent;

    //操作url
    @Column(name = "log_url", length = 250)
    private String logUrl;

    //登录ip
    @Column(name = "log_ip", length = 100)
    private String logIp;

    //操作时间
    @Column(updatable = false)
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    private Date create_date;

}
