package com.qmth.paper.library.common.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.paper.library.common.enums.log.LevelEnum;
import com.qmth.paper.library.common.enums.log.OperationTypeEnum;
import com.qmth.paper.library.common.enums.log.OperationUnitEnum;
import com.qmth.paper.library.common.enums.log.SystemEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @Description: 基础日志记录表
 * @Author: CaoZixuan
 * @Date: 2022-02-14
 */
@ApiModel(value = "BasicOperationLog对象", description = "基础日志记录表")
public class BasicOperationLog implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "日志详情")
    private String detail;

    @ApiModelProperty(value = "日志等级（PRIMARY(\"一级日志：敏感信息\"),SECONDARY(\"二级日志：重要信息\"),TERTIARY(\"三级日志：次要信息\"),QUATERNARY(\"四级日志：普通信息\")）")
    private LevelEnum level;

    @ApiModelProperty(value = "操作类型（UN_KNOW(\"未知\"),SELECT(\"查询\"),EDIT(\"新增或更新\"),DELETE(\"删除\")）")
    private OperationTypeEnum operationType;

    @ApiModelProperty(value = "操作对象（略）")
    private OperationUnitEnum operationUnit;

    @ApiModelProperty(value = "日志系统类型")
    private SystemEnum systemType;

    @ApiModelProperty(value = "请求地址url")
    private String url;

    @ApiModelProperty(value = "类名称")
    private String clazzName;

    @ApiModelProperty(value = "方法名称")
    private String method;

    @ApiModelProperty(value = "参数")
    private String args;

    @ApiModelProperty(value = "方法运行时间")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long runTime;

    @ApiModelProperty(value = "运行状态")
    private String runStatus;

    @ApiModelProperty(value = "方法返回值")
    private String returnValue;

    @ApiModelProperty(value = "用户对象id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @ApiModelProperty(value = "用户名称")
    private String userName;

    @ApiModelProperty(value = "日志记录时间")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long createTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public LevelEnum getLevel() {
        return level;
    }

    public void setLevel(LevelEnum level) {
        this.level = level;
    }

    public OperationTypeEnum getOperationType() {
        return operationType;
    }

    public void setOperationType(OperationTypeEnum operationType) {
        this.operationType = operationType;
    }

    public OperationUnitEnum getOperationUnit() {
        return operationUnit;
    }

    public void setOperationUnit(OperationUnitEnum operationUnit) {
        this.operationUnit = operationUnit;
    }

    public SystemEnum getSystemType() {
        return systemType;
    }

    public void setSystemType(SystemEnum systemType) {
        this.systemType = systemType;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getClazzName() {
        return clazzName;
    }

    public void setClazzName(String clazzName) {
        this.clazzName = clazzName;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getArgs() {
        return args;
    }

    public void setArgs(String args) {
        this.args = args;
    }

    public Long getRunTime() {
        return runTime;
    }

    public void setRunTime(Long runTime) {
        this.runTime = runTime;
    }

    public String getRunStatus() {
        return runStatus;
    }

    public void setRunStatus(String runStatus) {
        this.runStatus = runStatus;
    }

    public String getReturnValue() {
        return returnValue;
    }

    public void setReturnValue(String returnValue) {
        this.returnValue = returnValue;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }
}
