系统日志
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package org.xyzh.api.system.constance;
|
||||
|
||||
public class SysLogContants {
|
||||
|
||||
private final static String LOG_LEVEL_DEBUG = "DEBUG";
|
||||
private final static String LOG_LEVEL_INFO = "INFO";
|
||||
private final static String LOG_LEVEL_WARN = "WARN";
|
||||
private final static String LOG_LEVEL_ERROR = "ERROR";
|
||||
|
||||
|
||||
private final static String LOG_MODULE_SYSTEM = "系统";
|
||||
private final static String LOG_MODULE_AI = "AI服务";
|
||||
private final static String LOG_MODULE_AUTH = "日志";
|
||||
private final static String LOG_MODULE_WORKCASE = "工单";
|
||||
private final static String LOG_MODULE_KNOWLEDGE = "知识库";
|
||||
private final static String LOG_MODULE_FILE = "文件";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.xyzh.api.system.dto;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
/**
|
||||
* @description 系统日志DTO
|
||||
* @filename TbSysLogDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "系统日志DTO")
|
||||
public class TbSysLogDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "日志ID")
|
||||
private String logId;
|
||||
|
||||
@Schema(description = "日志类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "日志级别")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "模块")
|
||||
private String module;
|
||||
|
||||
@Schema(description = "IP地址")
|
||||
private String ipAddress;
|
||||
|
||||
@Schema(description = "IP来源")
|
||||
private String ip_source;
|
||||
|
||||
@Schema(description = "浏览器")
|
||||
private String browser;
|
||||
|
||||
@Schema(description = "操作系统")
|
||||
private String os;
|
||||
|
||||
@Schema(description = "日志消息")
|
||||
private String message;
|
||||
|
||||
@Schema(description = "日志数据")
|
||||
private JSONObject data;
|
||||
|
||||
@Schema(description = "创建人姓名")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "服务")
|
||||
private String servce;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.xyzh.api.system.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
/**
|
||||
* @description 系统登录日志DTO
|
||||
* @filename TbSysLoginLogDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "系统登录日志DTO")
|
||||
public class TbSysLoginLogDTO extends BaseDTO {
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "IP地址")
|
||||
private String ipAddress;
|
||||
|
||||
@Schema(description = "IP来源")
|
||||
private String ipSource;
|
||||
|
||||
@Schema(description = "浏览器")
|
||||
private String browser;
|
||||
|
||||
@Schema(description = "操作系统")
|
||||
private String os;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "登录时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date loginTime;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "错误次数")
|
||||
private Integer errorCount;
|
||||
|
||||
@Schema(description = "消息")
|
||||
private String message;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.xyzh.api.system.service;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.xyzh.api.system.dto.TbSysLogDTO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
|
||||
/**
|
||||
* @description 系统日志服务
|
||||
* @filename LogService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2026-01-01
|
||||
*/
|
||||
public interface LogService {
|
||||
|
||||
/**
|
||||
* @description 统计系统日志
|
||||
* @param sysLog
|
||||
* @return 返回值描述
|
||||
* @author yslg
|
||||
* @since 2026-01-01
|
||||
*/
|
||||
ResultDomain<TbSysLogDTO> addSysLog(TbSysLogDTO sysLog);
|
||||
|
||||
/**
|
||||
* @description 统计日志数量
|
||||
* @param filter
|
||||
* @return 返回值描述
|
||||
* @author yslg
|
||||
* @since 2026-01-01
|
||||
*/
|
||||
ResultDomain<Integer> countSysLog(TbSysLogDTO filter);
|
||||
|
||||
/**
|
||||
* @description 获取日志列表
|
||||
* @param filter
|
||||
* @return 日志列表
|
||||
* @author yslg
|
||||
* @since 2026-01-01
|
||||
*/
|
||||
ResultDomain<TbSysLogDTO> getSysLogList(TbSysLogDTO filter);
|
||||
|
||||
/**
|
||||
* @description 获取日志分页
|
||||
* @param pageRequest
|
||||
* @return 日志分页
|
||||
* @author yslg
|
||||
* @since 2026-01-01
|
||||
*/
|
||||
ResultDomain<TbSysLogDTO> getSysLogPage(PageRequest<TbSysLogDTO> pageRequest);
|
||||
}
|
||||
Reference in New Issue
Block a user