日志切面功能整合
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
package com.czg.system.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 操作日志
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-02-12 11:21
|
||||
*/
|
||||
@Data
|
||||
public class OperationLogDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 日志类型 info-正常日志 error-异常日志
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 用户操作
|
||||
*/
|
||||
private String operation;
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
private String requestUri;
|
||||
/**
|
||||
* 请求方式
|
||||
*/
|
||||
private String requestMethod;
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
private String requestParams;
|
||||
/**
|
||||
* 请求时长(毫秒)
|
||||
*/
|
||||
private Integer requestTime;
|
||||
/**
|
||||
* 用户代理
|
||||
*/
|
||||
private String userAgent;
|
||||
/**
|
||||
* 操作IP
|
||||
*/
|
||||
private String ip;
|
||||
/**
|
||||
* 操作地点
|
||||
*/
|
||||
private String location;
|
||||
/**
|
||||
* 状态 0:失败 1:成功
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String errorInfo;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Long createUserId;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String createUserName;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime beginTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.czg.system.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import com.mybatisflex.core.keygen.KeyGenerators;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 操作日志
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-02-12 11:21
|
||||
*/
|
||||
@Data
|
||||
@Table("operation_log")
|
||||
public class OperationLog implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
|
||||
private Long id;
|
||||
/**
|
||||
* 日志类型 info-正常日志 error-异常日志
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 用户操作
|
||||
*/
|
||||
private String operation;
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
private String requestUri;
|
||||
/**
|
||||
* 请求方式
|
||||
*/
|
||||
private String requestMethod;
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
private String requestParams;
|
||||
/**
|
||||
* 请求时长(毫秒)
|
||||
*/
|
||||
private Integer requestTime;
|
||||
/**
|
||||
* 用户代理
|
||||
*/
|
||||
private String userAgent;
|
||||
/**
|
||||
* 操作IP
|
||||
*/
|
||||
private String ip;
|
||||
/**
|
||||
* 操作地点
|
||||
*/
|
||||
private String location;
|
||||
/**
|
||||
* 状态 0:失败 1:成功
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String errorInfo;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Long createUserId;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String createUserName;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.czg.system.service;
|
||||
|
||||
import com.czg.system.dto.OperationLogDTO;
|
||||
import com.czg.system.entity.OperationLog;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 操作日志
|
||||
* @author tankaikai
|
||||
* @since 2025-02-12 11:35
|
||||
*/
|
||||
public interface OperationLogService extends IService<OperationLog> {
|
||||
|
||||
Page<OperationLogDTO> page(OperationLogDTO param);
|
||||
|
||||
List<OperationLogDTO> list(OperationLogDTO param);
|
||||
}
|
||||
Reference in New Issue
Block a user