package com.storlead.system.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;

import com.storlead.framework.mybatis.entity.SysBaseField;
import com.storlead.system.enums.OperationLogTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 系统日志
 * </p>
 *
 * @author chenkq
 * @since 2022-07-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_operation_log")
public class SysOperationLogEntity extends SysBaseField {

    public SysOperationLogEntity(OperationLogTypeEnum typeEnum, Long time) {
        this.logType = typeEnum.getCode();
        this.time = time;
    }

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "sys_operation_log_id", type = IdType.AUTO)
    private Long sysOperationLogId;

    /**
     * 操作账号
     */
    private String userName;

    /**
     * 请求路径
     */
    private String requestPath;

    /**
     * 请求IP
     */
    private String requestIp;

    /**
     * 请求时间
     */
    private LocalDateTime requestTime;

    /**
     * 日志级别 0: INFO 1:ERROR
     */
    private Integer logType;

    /**
     * 描述
     */
    private String description;

    /**
     * 请求方法
     */
    private String method;

    /**
     * 请求参数
     */
    private String parameter;

    /**
     * 异常栈输出
     */
    private String exception;

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

    /**
     * 响应结果
     */
    private String result;

    /**
     * 网络地址
     */
    private String address;

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