package com.simuwang.base.pojo.dos;

import com.simuwang.base.common.conts.Constants;
import com.simuwang.base.common.util.DateUtils;
import com.simuwang.base.pojo.vo.LoggingVO;
import lombok.Data;

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

/**
 * @author wangzaijun
 * @date 2024/9/14 14:04
 * @description 系统操作日志记录
 */
@Data
public class LoggingDO{

    private Integer id;
    private String title;
    private Integer type;
    private String requestUri;
    private String method;
    private String remoteAddr;
    private Long executeTime;
    private String params;
    private String result;
    private Boolean hasException;
    private String exception;
    private String userName;
    private Date createTime;


    public LoggingVO toVO() {
        LoggingVO vo = new LoggingVO();
        vo.setId(this.id);
        vo.setTitle(this.title);
        vo.setRequestUri(this.requestUri);
        vo.setMethod(this.method);
        vo.setParams(this.params);
        vo.setRemoteAddr(this.remoteAddr);
        vo.setUserName(this.userName);
        vo.setExecuteTime(this.executeTime);
        vo.setCreateTime(DateUtils.format(this.createTime,DateUtils.YYYY_MM_DD_HH_MM_SS));
        return vo;
    }
}
