feat: 数据拓展信息服务.

This commit is contained in:
lijiahang
2023-12-19 19:27:00 +08:00
parent bb83fe447b
commit 5b40beb312
24 changed files with 784 additions and 48 deletions

View File

@@ -0,0 +1,42 @@
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();
}
}

View File

@@ -3,7 +3,6 @@ package com.orion.ops.framework.biz.operator.log.core.aspect;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializeFilter;
import com.orion.lang.define.thread.ExecutorBuilder;
import com.orion.lang.define.wrapper.Ref;
import com.orion.lang.utils.Arrays1;
import com.orion.lang.utils.Strings;
import com.orion.lang.utils.json.matcher.ReplacementFormatters;
@@ -20,6 +19,7 @@ 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(JSON.toJSONString(Ref.of(Objects.toString(ret))));
model.setReturnValue(Refs.toJson(Objects.toString(ret)));
}
}
} else {

View File

@@ -45,11 +45,9 @@ public class CodeGenerators {
// .color("blue", "gray", "red", "green", "white")
// .valueUseFields()
// .build(),
Template.create("data_alias", "数据别名", "data")
Template.create("data_extra", "数据拓展信息", "data")
.disableUnitTest()
.enableProviderApi()
.cache("data:alias:{}:{}", "数据别名 ${userId} ${type}")
.expire(1, TimeUnit.DAYS)
.build(),
};
// jdbc 配置 - 使用配置文件