feat: 数据拓展服务.
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
package com.orion.ops.framework.common.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orion.lang.define.wrapper.Ref;
|
||||
|
||||
/**
|
||||
* ref 工具类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/12/19 18:07
|
||||
*/
|
||||
public class Refs {
|
||||
|
||||
private Refs() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 转为 ref json
|
||||
*
|
||||
* @param o o
|
||||
* @return json
|
||||
*/
|
||||
public static String toJson(Object o) {
|
||||
return JSON.toJSONString(Ref.of(o));
|
||||
}
|
||||
|
||||
/**
|
||||
* ref json 转为 ref value
|
||||
*
|
||||
* @param json json
|
||||
* @return value
|
||||
*/
|
||||
public static Object parseObject(String json) {
|
||||
Ref<?> ref = JSON.parseObject(json, Ref.class);
|
||||
if (ref == null) {
|
||||
return null;
|
||||
}
|
||||
return ref.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializeFilter;
|
||||
import com.orion.lang.define.thread.ExecutorBuilder;
|
||||
import com.orion.lang.utils.Arrays1;
|
||||
import com.orion.lang.utils.Refs;
|
||||
import com.orion.lang.utils.Strings;
|
||||
import com.orion.lang.utils.json.matcher.ReplacementFormatters;
|
||||
import com.orion.ops.framework.biz.operator.log.core.annotation.IgnoreParameter;
|
||||
@@ -19,7 +20,6 @@ import com.orion.ops.framework.common.enums.BooleanBit;
|
||||
import com.orion.ops.framework.common.meta.TraceIdHolder;
|
||||
import com.orion.ops.framework.common.security.LoginUser;
|
||||
import com.orion.ops.framework.common.security.SecurityHolder;
|
||||
import com.orion.ops.framework.common.utils.Refs;
|
||||
import com.orion.ops.framework.common.utils.Requests;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
@@ -270,7 +270,7 @@ public class OperatorLogAspect {
|
||||
// 脱敏
|
||||
model.setReturnValue(JSON.toJSONString(ret, serializeFilters));
|
||||
} else if (ReturnType.TO_STRING.equals(retType)) {
|
||||
model.setReturnValue(Refs.toJson(Objects.toString(ret)));
|
||||
model.setReturnValue(Refs.json(Objects.toString(ret)));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user