refactor: 日志完善

This commit is contained in:
Ray.Hao
2024-06-27 21:49:46 +08:00
parent f0a50ea6c5
commit 9b5fd036e5
8 changed files with 139 additions and 63 deletions

View File

@@ -0,0 +1,51 @@
package com.youlai.system.enums;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
/**
* 日志模块枚举
*
* @author Ray
* @since 2.10.0
*/
@Schema(enumAsRef = true)
@Getter
public enum LogModuleEnum {
/**
* 登录
*/
LOGIN("登录"),
/**
* 用户模块
*/
USER("用户模块"),
/**
* 部门模块
*/
DEPT("部门模块"),
/**
* 角色模块
*/
ROLE("角色模块"),
/**
* 菜单模块
*/
MENU("菜单模块"),
/**
* 字典模块
*/
DICT("字典模块"),
OTHER("其他")
;
@JsonValue
private final String moduleName;
LogModuleEnum(String moduleName) {
this.moduleName = moduleName;
}
}

View File

@@ -1,28 +0,0 @@
package com.youlai.system.enums;
import com.youlai.system.common.base.IBaseEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
/**
* 日志类型枚举
*
* @author Ray
* @since 2.10.0
*/
@Schema(enumAsRef = true)
@Getter
public enum LogTypeEnum implements IBaseEnum<Integer> {
OPERATION(1, "操作日志"),
LOGIN (2, "登录日志");
private final Integer value;
private final String label;
LogTypeEnum(Integer value, String label) {
this.value = value;
this.label = label;
}
}

View File

@@ -10,7 +10,7 @@ import lombok.Getter;
* @author haoxr
* @since 2022/4/23 9:36
*/
@Getter
public enum MenuTypeEnum implements IBaseEnum<Integer> {
NULL(0, null),
@@ -19,13 +19,12 @@ public enum MenuTypeEnum implements IBaseEnum<Integer> {
EXTLINK(3, "外链"),
BUTTON(4, "按钮");
@Getter
@EnumValue // Mybatis-Plus 提供注解表示插入数据库时插入该值
private Integer value;
// Mybatis-Plus 提供注解表示插入数据库时插入该值
@EnumValue
private final Integer value;
@Getter
// @JsonValue // 表示对枚举序列化时返回此字段
private String label;
private final String label;
MenuTypeEnum(Integer value, String label) {
this.value = value;