package com.wms.entity.table;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 操作日志类
 */
@Data
@TableName(value = "tbl_sys_log", autoResultMap = true)
public class WmsLog {
    /**
     * id
     */
    @TableId("log_id")
    private String logId;
    /**
     * 描述/标题
     */
    @TableField("log_title")
    private String logTitle;
    /**
     * 方法
     */
    @TableField("log_method")
    private String logMethod;
    /**
     * 请求参数
     */
    @TableField(value = "log_request", typeHandler = Fastjson2TypeHandler.class)
    private Object logRequest;
    /**
     * 响应参数
     */
    @TableField(value = "log_response", typeHandler = Fastjson2TypeHandler.class)
    private Object logResponse;
    /**
     * 请求的ip
     */
    @TableField("log_ip")
    private String logIp;
    /**
     * 请求时间
     */
    @TableField("log_time")
    private LocalDateTime logTime;
    /**
     * 请求用户
     */
    @TableField("log_user")
    private String logUser;

    public WmsLog() {
    }

    public WmsLog(String logId, String logTitle, String logMethod, Object logRequest, Object logResponse, String logIp, LocalDateTime logTime, String logUser) {
        this.logId = logId;
        this.logTitle = logTitle;
        this.logMethod = logMethod;
        this.logRequest = logRequest;
        this.logResponse = logResponse;
        this.logIp = logIp;
        this.logTime = logTime;
        this.logUser = logUser;
    }
}
