package com.agileboot.system.log.entity;

import com.agileboot.common.mybatis.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.util.Date;

/**
 * <p>
 * 操作日志记录
 * </p>
 *
 * @author valarchie
 * @since 2022-10-02
 */
@Getter
@Setter
@TableName("sys_operation_log")
@ApiModel(value = "SysOperationLogEntity对象", description = "操作日志记录")
public class SysOperationLog extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("日志主键")
    @TableId(value = "operation_id", type = IdType.AUTO)
    private Long operationId;

    @ApiModelProperty("业务类型（0其它 1新增 2修改 3删除）")
    private Integer businessType;

    @ApiModelProperty("请求方式")
    private Integer requestMethod;

    @ApiModelProperty("请求模块")
    private String requestModule;

    @ApiModelProperty("请求URL")
    private String requestUrl;

    @ApiModelProperty("调用方法")
    private String calledMethod;

    @ApiModelProperty("操作类别（0其它 1后台用户 2手机端用户）")
    private Integer operatorType;

    @ApiModelProperty("用户ID")
    private Long userId;

    @ApiModelProperty("操作人员")
    private String username;

    @ApiModelProperty("操作人员ip")
    private String operatorIp;

    @ApiModelProperty("操作地点")
    private String operatorLocation;

    @ApiModelProperty("部门ID")
    private Long deptId;

    @ApiModelProperty("部门名称")
    private String deptName;

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

    @ApiModelProperty("返回参数")
    private String operationResult;

    @ApiModelProperty("操作状态（1正常 0异常）")
    private Integer status;

    @ApiModelProperty("错误消息")
    private String errorStack;

    @ApiModelProperty("操作时间")
    private Date operationTime;
}
