1
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 审计日志级别:用于区分重要/次要/一般操作,配合保留期策略。
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum LogLevel {
|
||||
IMPORTANT(1, "重要(删除)"),
|
||||
SECONDARY(2, "次要(新增/编辑)"),
|
||||
GENERAL(3, "一般(查询)");
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
public static LogLevel fromCode(Integer code) {
|
||||
if (code == null) return SECONDARY;
|
||||
for (LogLevel l : values()) if (l.code == code) return l;
|
||||
return SECONDARY;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user