feat: 数据拓展服务.

This commit is contained in:
lijiahangmax
2023-12-20 01:42:12 +08:00
parent 5b40beb312
commit 29b3fa5a9c
21 changed files with 200 additions and 374 deletions

View File

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