refactor: 日志完善
This commit is contained in:
51
src/main/java/com/youlai/system/enums/LogModuleEnum.java
Normal file
51
src/main/java/com/youlai/system/enums/LogModuleEnum.java
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user