package com.simuwang.base.pojo.dos.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.simuwang.base.common.support.dos.BaseEntity;
import com.simuwang.base.pojo.vo.sys.SysLogVO;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
@TableName("sys_log")
public class SysLogDO extends BaseEntity<SysLogVO> {
    @TableId(type = IdType.AUTO)
    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;

    @Override
    public SysLogVO toVo() {
        SysLogVO vo = new SysLogVO();
        vo.setId(this.id);
        vo.setTitle(this.title);
        vo.setType(this.type);
        vo.setRequestUri(this.requestUri);
        vo.setMethod(this.method);
        vo.setRemoteAddr(this.remoteAddr);
        vo.setExecuteTime(this.executeTime);
        vo.setParams(this.params);
        vo.setResult(this.result);
        vo.setHasException(this.hasException);
        vo.setException(this.exception);
        return vo;
    }
}
