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();
}
}