infra 模块添加操作日志.

This commit is contained in:
lijiahang
2023-10-12 15:28:08 +08:00
parent b1e1a87089
commit 24c244cbbd
25 changed files with 273 additions and 24 deletions

View File

@@ -308,6 +308,7 @@ public class OperatorLogAspect {
* @param type type
*/
private void fillLogInfo(OperatorLogModel model, Map<String, Object> extra, OperatorType type) {
model.setRiskLevel(type.getRiskLevel().name());
model.setModule(type.getModule());
model.setType(type.getType());
model.setLogInfo(ReplacementFormatters.format(type.getTemplate(), extra));

View File

@@ -17,14 +17,16 @@ public interface OperatorLogKeys {
String NAME = "name";
String STATUS = "status";
String STATUS_NAME = "statusName";
String USERNAME = "username";
String TITLE = "title";
String VALUE = "value";
String LABEL = "label";
String STATUS = "status";
String STATUS_NAME = "statusName";
}

View File

@@ -0,0 +1,32 @@
package com.orion.ops.framework.biz.operator.log.core.enums;
import lombok.Getter;
/**
* 操作风险等级
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/10/12 14:19
*/
@Getter
public enum OperatorRiskLevel {
/**
* 低风险
*/
L,
/**
* 中风险
*/
M,
/**
* 高风险
*/
H,
;
}

View File

@@ -49,6 +49,11 @@ public class OperatorLogModel {
*/
private String logInfo;
/**
* 风险等级
*/
private String riskLevel;
/**
* 模块
*/

View File

@@ -1,5 +1,6 @@
package com.orion.ops.framework.biz.operator.log.core.model;
import com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -16,6 +17,11 @@ import lombok.Getter;
@AllArgsConstructor
public class OperatorType {
/**
* 风险等级
*/
private final OperatorRiskLevel riskLevel;
/**
* 模块
*/

View File

@@ -35,7 +35,7 @@ public class OperatorLogs implements OperatorLogKeys {
}
/**
* 添加参数
* 添加日志参数
*
* @param key key
* @param value value
@@ -45,7 +45,7 @@ public class OperatorLogs implements OperatorLogKeys {
}
/**
* 添加参数 json
* 添加日志参数 json
*
* @param key key
* @param value value
@@ -55,7 +55,7 @@ public class OperatorLogs implements OperatorLogKeys {
}
/**
* 添加参数
* 添加日志参数
*
* @param map map
*/
@@ -64,7 +64,7 @@ public class OperatorLogs implements OperatorLogKeys {
}
/**
* 添加参数
* 添加日志参数
*
* @param obj obj
*/