package com.qmth.sop.business.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.enums.LogTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 系统日志
 * </p>
 *
 * @author wangliang
 * @since 2023-08-01
 */
@ApiModel(value="SysLog对象", description="系统日志")
public class SysLog implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

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

    @ApiModelProperty(value = "类别，LOGIN：登录，LOGOUT：退出以及数据库DDL和DML操作")
    private LogTypeEnum type;

    @ApiModelProperty(value = "实体名称")
    private String objName;

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

    @ApiModelProperty(value = "内容")
    private String content;

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

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

    @ApiModelProperty(value = "更改前内容")
    private String updateBeforeObj;

    @ApiModelProperty(value = "更改后内容")
    private String updateAfterObj;

    @ApiModelProperty(value = "创建时间")
    private Long createTime;

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

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

    public Long getId() {
        return id;
    }

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

    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 LogTypeEnum getType() {
        return type;
    }

    public void setType(LogTypeEnum type) {
        this.type = type;
    }

    public String getObjName() {
        return objName;
    }

    public void setObjName(String objName) {
        this.objName = objName;
    }

    public Long getObjId() {
        return objId;
    }

    public void setObjId(Long objId) {
        this.objId = objId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getUrl() {
        return url;
    }

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

    public String getArgs() {
        return args;
    }

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

    public String getUpdateBeforeObj() {
        return updateBeforeObj;
    }

    public void setUpdateBeforeObj(String updateBeforeObj) {
        this.updateBeforeObj = updateBeforeObj;
    }

    public String getUpdateAfterObj() {
        return updateAfterObj;
    }

    public void setUpdateAfterObj(String updateAfterObj) {
        this.updateAfterObj = updateAfterObj;
    }

    public Long getCreateTime() {
        return createTime;
    }

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

    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;
    }
}
