package com.tofly.base.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: 翘屁老猫
 * @Date: 2020/11/4 10:19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("TF_SMPN_LOG_X")
@KeySequence("TF_SMPN_LOG_X")
@ApiModel
public class Log extends Model<Log> {
    private static final long serialVersionUID = 1L;

    /**
     * 日志ID
     */
    @TableId(value = "ID",type= IdType.INPUT)
    @ApiModelProperty(value = "日志ID")
    private Long id;

    /**
     * 关联表名
     */
    @ApiModelProperty(value = "关联表名")
    private String tableName;

    /**
     * 关联表名对应关键值ID
     */
    @ApiModelProperty(value = "关联表名对应关键值ID")
    private String tableId;

    /**
     * 路由地址进行跳转
     */
    @ApiModelProperty(value = "路由地址进行跳转")
    private String routeIp;
    /**
     * 日志类型
     */
    @ApiModelProperty(value = "日志类型")
    private String type;
    /**
     * 服务ID
     */
    @ApiModelProperty(value = "服务ID")
    private String serviceId;
    /**
     * 创建者
     */
    @ApiModelProperty(value = "创建者")
    private String createBy;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "CREATE_TIME",fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "UPDATE_TIME",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
     * 操作ip
     */
    @ApiModelProperty(value = "操作ip")
    private String remoteAddr;
    /**
     * 用户代理
     */
    @ApiModelProperty(value = "用户代理")
    private String userAgent;
    /**
     * 请求URI
     */
    @ApiModelProperty(value = "请求URI")
    private String requestUri;
    /**
     * 操作方法
     */
    @ApiModelProperty(value = "操作方法")
    private String method;
    /**
     * 操作提交数据
     */
    @ApiModelProperty(value = "操作提交数据")
    private String params;
    /**
     * 相应时间
     */
    @ApiModelProperty(value = "响应时间")
    private Long time;
    /**
     * 删除标记
     */
    @ApiModelProperty(value = "删除标记")
    private String delFlag;
    /**
     * 异常信息
     */
    @ApiModelProperty(value = "异常信息")
    private String exception;
    /**
     * 日志内容
     */
    @ApiModelProperty(value = "日志内容")
    private String title;

    @ApiModelProperty(value = "登录时长")
    private BigDecimal operatingTime;

}
