package com.gci.boot.modules.system.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gci.boot.common.dict.annotation.Dict;
import com.gci.boot.common.dict.excel.DictConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 系统日志表
 * </p>
 *
 * @author chenzhiwei
 * @since 2023-09-08
 */
@Data
@TableName("sys_log")
@ApiModel(value = "SysLog对象", description = "系统日志表")
public class SysLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty("日志类型（1登录日志，2操作日志）")
    private Integer logType;

    @ApiModelProperty("日志内容")
    private String logContent;

    @ApiModelProperty("操作类型")
    private Integer operateType;

    @ApiModelProperty("操作用户账号")
    private String userid;

    @ApiModelProperty("操作用户名称")
    private String username;

    @ApiModelProperty("IP")
    private String ip;

    @ApiModelProperty("请求java方法")
    private String method;

    @ApiModelProperty("请求路径")
    private String requestUrl;

    @ApiModelProperty("请求参数")
    private String requestParam;

    @ApiModelProperty("请求类型")
    private String requestType;

    @ApiModelProperty("耗时")
    private Long costTime;

    @ApiModelProperty("创建人")
    private String createBy;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新人")
    @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname")
    @ExcelProperty(value = "更新人",converter = DictConverter.class)
    private String updateBy;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("日志来源")
    private String logSource;
}
