mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-06-28 13:34:18 +08:00
refactor: 重构 sa-token-fastjson 插件
This commit is contained in:
parent
ca787ec240
commit
03ad51ef7b
@ -120,11 +120,8 @@ public interface SaGetValueInterface {
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
default <T> T getModel(String key, Class<T> cs, Object defaultValue) {
|
default <T> T getModel(String key, Class<T> cs, Object defaultValue) {
|
||||||
Object value = get(key);
|
T model = getModel(key, cs);
|
||||||
if(valueIsNull(value)) {
|
return valueIsNull(model) ? (T)defaultValue : model;
|
||||||
return (T)defaultValue;
|
|
||||||
}
|
|
||||||
return SaFoxUtil.getValueByType(value, cs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,6 +96,14 @@ public interface SaTokenDao {
|
|||||||
*/
|
*/
|
||||||
Object getObject(String key);
|
Object getObject(String key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 Object (指定反序列化类型),如无返空
|
||||||
|
*
|
||||||
|
* @param key 键名称
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
<T> T getObject(String key, Class<T> classType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 写入 Object,并设定存活时间 (单位: 秒)
|
* 写入 Object,并设定存活时间 (单位: 秒)
|
||||||
*
|
*
|
||||||
|
@ -39,6 +39,12 @@ public class SaTokenDaoDefaultImpl implements SaTokenDaoByStringFollowObject {
|
|||||||
return timedCache.getObject(key);
|
return timedCache.getObject(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public <T> T getObject(String key, Class<T> classType){
|
||||||
|
return (T) getObject(key);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setObject(String key, Object object, long timeout) {
|
public void setObject(String key, Object object, long timeout) {
|
||||||
timedCache.setObject(key, object, timeout);
|
timedCache.setObject(key, object, timeout);
|
||||||
|
@ -39,6 +39,17 @@ public interface SaTokenDaoByObjectFollowString extends SaTokenDaoBySessionFollo
|
|||||||
return SaManager.getSaSerializerTemplate().stringToObject(jsonString);
|
return SaManager.getSaSerializerTemplate().stringToObject(jsonString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 Object (指定反序列化类型),如无返空
|
||||||
|
*
|
||||||
|
* @param key 键名称
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
default <T> T getObject(String key, Class<T> classType) {
|
||||||
|
String jsonString = get(key);
|
||||||
|
return SaManager.getSaSerializerTemplate().stringToObject(jsonString, classType);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 写入 Object,并设定存活时间 (单位: 秒)
|
* 写入 Object,并设定存活时间 (单位: 秒)
|
||||||
*
|
*
|
||||||
|
@ -17,6 +17,7 @@ package cn.dev33.satoken.dao.auto;
|
|||||||
|
|
||||||
import cn.dev33.satoken.dao.SaTokenDao;
|
import cn.dev33.satoken.dao.SaTokenDao;
|
||||||
import cn.dev33.satoken.session.SaSession;
|
import cn.dev33.satoken.session.SaSession;
|
||||||
|
import cn.dev33.satoken.strategy.SaStrategy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SaTokenDao 次级实现:SaSession 读写跟随 Object 读写
|
* SaTokenDao 次级实现:SaSession 读写跟随 Object 读写
|
||||||
@ -34,7 +35,7 @@ public interface SaTokenDaoBySessionFollowObject extends SaTokenDao {
|
|||||||
* @return SaSession
|
* @return SaSession
|
||||||
*/
|
*/
|
||||||
default SaSession getSession(String sessionId) {
|
default SaSession getSession(String sessionId) {
|
||||||
return (SaSession)getObject(sessionId);
|
return getObject(sessionId, SaStrategy.instance.sessionClassType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,9 +37,21 @@ public interface SaJsonTemplate {
|
|||||||
* 反序列化:json 字符串 → 对象
|
* 反序列化:json 字符串 → 对象
|
||||||
*
|
*
|
||||||
* @param jsonStr /
|
* @param jsonStr /
|
||||||
|
* @param type /
|
||||||
|
* @return /
|
||||||
|
* @param <T> /
|
||||||
|
*/
|
||||||
|
<T>T jsonToObject(String jsonStr, Class<T> type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反序列化:json 字符串 → 对象 (自动判断类型)
|
||||||
|
*
|
||||||
|
* @param jsonStr /
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
Object jsonToObject(String jsonStr);
|
default Object jsonToObject(String jsonStr) {
|
||||||
|
return jsonToObject(jsonStr, Object.class);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 反序列化:json 字符串 → Map
|
* 反序列化:json 字符串 → Map
|
||||||
@ -47,6 +59,8 @@ public interface SaJsonTemplate {
|
|||||||
* @param jsonStr /
|
* @param jsonStr /
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
Map<String, Object> jsonToMap(String jsonStr);
|
default Map<String, Object> jsonToMap(String jsonStr) {
|
||||||
|
return jsonToObject(jsonStr, Map.class);
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,11 @@ public class SaJsonTemplateDefaultImpl implements SaJsonTemplate {
|
|||||||
throw new NotImplException(ERROR_MESSAGE).setCode(SaErrorCode.CODE_10003);
|
throw new NotImplException(ERROR_MESSAGE).setCode(SaErrorCode.CODE_10003);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> T jsonToObject(String jsonStr, Class<T> type) {
|
||||||
|
throw new NotImplException(ERROR_MESSAGE).setCode(SaErrorCode.CODE_10003);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> jsonToMap(String jsonStr) {
|
public Map<String, Object> jsonToMap(String jsonStr) {
|
||||||
throw new NotImplException(ERROR_MESSAGE).setCode(SaErrorCode.CODE_10003);
|
throw new NotImplException(ERROR_MESSAGE).setCode(SaErrorCode.CODE_10003);
|
||||||
|
@ -39,6 +39,21 @@ public interface SaSerializerTemplate {
|
|||||||
*/
|
*/
|
||||||
Object stringToObject(String str);
|
Object stringToObject(String str);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反序列化:字符串 → 对象 (指定类型)
|
||||||
|
* <p>
|
||||||
|
* 此方法目前仅为 json 序列化实现类 在 反序列化对象 传递类型信息
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param str /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
default <T> T stringToObject(String str, Class<T> type) {
|
||||||
|
return (T)stringToObject(str);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 序列化:对象 -> 字节数组
|
* 序列化:对象 -> 字节数组
|
||||||
*
|
*
|
||||||
|
@ -37,6 +37,11 @@ public class SaSerializerTemplateForJson implements SaSerializerTemplate {
|
|||||||
return SaManager.getSaJsonTemplate().jsonToObject(str);
|
return SaManager.getSaJsonTemplate().jsonToObject(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T>T stringToObject(String str, Class<T> type) {
|
||||||
|
return SaManager.getSaJsonTemplate().jsonToObject(str, type);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] objectToBytes(Object obj) {
|
public byte[] objectToBytes(Object obj) {
|
||||||
throw new ApiDisabledException("json 序列化器不支持 Object -> byte[]");
|
throw new ApiDisabledException("json 序列化器不支持 Object -> byte[]");
|
||||||
|
@ -101,6 +101,11 @@ public final class SaStrategy {
|
|||||||
return new SaSession(sessionId);
|
return new SaSession(sessionId);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反序列化 SaSession 时默认指定的类型
|
||||||
|
*/
|
||||||
|
public volatile Class<? extends SaSession> sessionClassType = SaSession.class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断:集合中是否包含指定元素(模糊匹配)
|
* 判断:集合中是否包含指定元素(模糊匹配)
|
||||||
*/
|
*/
|
||||||
|
@ -20,6 +20,7 @@ import cn.dev33.satoken.exception.SaTokenException;
|
|||||||
|
|
||||||
import java.io.Console;
|
import java.io.Console;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -376,6 +377,36 @@ public class SaFoxUtil {
|
|||||||
return (T)obj3;
|
return (T)obj3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 Map 转化为 Object
|
||||||
|
* @param map /
|
||||||
|
* @param clazz /
|
||||||
|
* @return /
|
||||||
|
* @param <T> /
|
||||||
|
*/
|
||||||
|
public static <T> T mapToObject(Map<String, Object> map, Class<T> clazz) {
|
||||||
|
if(map == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if(clazz == Map.class) {
|
||||||
|
return (T) map;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
T obj = clazz.getDeclaredConstructor().newInstance();
|
||||||
|
for (Field field : clazz.getDeclaredFields()) {
|
||||||
|
String fieldName = field.getName();
|
||||||
|
if (map.containsKey(fieldName)) {
|
||||||
|
field.setAccessible(true);
|
||||||
|
field.set(obj, map.get(fieldName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("转换失败: " + e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在url上拼接上kv参数并返回
|
* 在url上拼接上kv参数并返回
|
||||||
* @param url url
|
* @param url url
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.dev33</groupId>
|
<groupId>cn.dev33</groupId>
|
||||||
<artifactId>sa-token-serializer-features</artifactId>
|
<artifactId>sa-token-fastjson</artifactId>
|
||||||
<version>${sa-token.version}</version>
|
<version>${sa-token.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -94,17 +94,17 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
|||||||
System.out.println("自定义插件安装钩子函数...");
|
System.out.println("自定义插件安装钩子函数...");
|
||||||
|
|
||||||
return SaTokenPluginHolder.instance
|
return SaTokenPluginHolder.instance
|
||||||
.onBeforeInstall(SaTokenPluginForJackson.class, plugin -> {
|
// .onBeforeInstall(SaTokenPluginForJackson.class, plugin -> {
|
||||||
System.out.println("SaTokenPluginForJackson 插件安装前置钩子...");
|
// System.out.println("SaTokenPluginForJackson 插件安装前置钩子...");
|
||||||
})
|
// })
|
||||||
|
//
|
||||||
.onAfterInstall(SaTokenPluginForJackson.class, plugin -> {
|
// .onAfterInstall(SaTokenPluginForJackson.class, plugin -> {
|
||||||
System.out.println("SaTokenPluginForJackson 插件安装后置钩子...");
|
// System.out.println("SaTokenPluginForJackson 插件安装后置钩子...");
|
||||||
})
|
// })
|
||||||
|
//
|
||||||
.onAfterInstall(SaTokenPluginForJackson.class, plugin -> {
|
// .onAfterInstall(SaTokenPluginForJackson.class, plugin -> {
|
||||||
System.out.println("SaTokenPluginForJackson 插件安装后置钩子2...");
|
// System.out.println("SaTokenPluginForJackson 插件安装后置钩子2...");
|
||||||
})
|
// })
|
||||||
|
|
||||||
// .onInstall(SaTokenPluginForJackson.class, plugin -> {
|
// .onInstall(SaTokenPluginForJackson.class, plugin -> {
|
||||||
// System.out.println("注册 install 钩子函数后,插件的默认安装行为将不再执行 ...");
|
// System.out.println("注册 install 钩子函数后,插件的默认安装行为将不再执行 ...");
|
||||||
|
@ -15,11 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package cn.dev33.satoken.json;
|
package cn.dev33.satoken.json;
|
||||||
|
|
||||||
import cn.dev33.satoken.session.SaSessionForFastjsonCustomized;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSON 转换器, Fastjson 版实现
|
* JSON 转换器, Fastjson 版实现
|
||||||
*
|
*
|
||||||
@ -40,17 +37,8 @@ public class SaJsonTemplateForFastjson implements SaJsonTemplate {
|
|||||||
* 反序列化:json 字符串 → 对象
|
* 反序列化:json 字符串 → 对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object jsonToObject(String jsonStr) {
|
public<T> T jsonToObject(String jsonStr, Class<T> type) {
|
||||||
// TODO: 此处待更改,需要让其自动识别类型
|
return JSON.parseObject(jsonStr, type);
|
||||||
return JSON.parseObject(jsonStr, SaSessionForFastjsonCustomized.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 反序列化:json 字符串 → Map
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> jsonToMap(String jsonStr) {
|
|
||||||
return JSON.parseObject(jsonStr, Map.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,9 @@ public class SaTokenPluginForFastjson implements SaTokenPlugin {
|
|||||||
// 重写 SaSession 生成策略
|
// 重写 SaSession 生成策略
|
||||||
SaStrategy.instance.createSession = SaSessionForFastjsonCustomized::new;
|
SaStrategy.instance.createSession = SaSessionForFastjsonCustomized::new;
|
||||||
|
|
||||||
|
// 指定 SaSession 类型
|
||||||
|
SaStrategy.instance.sessionClassType = SaSessionForFastjsonCustomized.class;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -17,6 +17,7 @@ package cn.dev33.satoken.session;
|
|||||||
|
|
||||||
import cn.dev33.satoken.util.SaFoxUtil;
|
import cn.dev33.satoken.util.SaFoxUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fastjson 定制版 SaSession,重写类型转换API
|
* Fastjson 定制版 SaSession,重写类型转换API
|
||||||
@ -52,31 +53,22 @@ public class SaSessionForFastjsonCustomized extends SaSession {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public <T> T getModel(String key, Class<T> cs) {
|
public <T> T getModel(String key, Class<T> cs) {
|
||||||
if(SaFoxUtil.isBasicType(cs)) {
|
// 如果是想取出为基础类型
|
||||||
return SaFoxUtil.getValueByType(get(key), cs);
|
|
||||||
}
|
|
||||||
return JSON.parseObject(getString(key), cs);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取值 (指定转换类型, 并指定值为Null时返回的默认值)
|
|
||||||
* @param <T> 泛型
|
|
||||||
* @param key key
|
|
||||||
* @param cs 指定转换类型
|
|
||||||
* @param defaultValue 值为Null时返回的默认值
|
|
||||||
* @return 值
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public <T> T getModel(String key, Class<T> cs, Object defaultValue) {
|
|
||||||
Object value = get(key);
|
Object value = get(key);
|
||||||
if(valueIsNull(value)) {
|
|
||||||
return (T)defaultValue;
|
|
||||||
}
|
|
||||||
if(SaFoxUtil.isBasicType(cs)) {
|
if(SaFoxUtil.isBasicType(cs)) {
|
||||||
return SaFoxUtil.getValueByType(get(key), cs);
|
return SaFoxUtil.getValueByType(value, cs);
|
||||||
|
}
|
||||||
|
// 为空提前返回
|
||||||
|
if(valueIsNull(value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// 如果是 JSONObject 类型直接转,否则先转为 String 再转
|
||||||
|
if(value instanceof JSONObject) {
|
||||||
|
JSONObject jo = (JSONObject) value;
|
||||||
|
return jo.toJavaObject(cs);
|
||||||
|
} else {
|
||||||
|
return JSON.parseObject(value.toString(), cs);
|
||||||
}
|
}
|
||||||
return JSON.parseObject(getString(key), cs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@ import java.time.LocalDate;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSON 转换器, Jackson 版实现
|
* JSON 转换器, Jackson 版实现
|
||||||
@ -110,7 +109,6 @@ public class SaJsonTemplateForJackson implements SaJsonTemplate {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
System.out.println("序列化的啥:" + objectMapper.writeValueAsString(obj));
|
|
||||||
return objectMapper.writeValueAsString(obj);
|
return objectMapper.writeValueAsString(obj);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
throw new SaJsonConvertException(e);
|
throw new SaJsonConvertException(e);
|
||||||
@ -121,30 +119,12 @@ public class SaJsonTemplateForJackson implements SaJsonTemplate {
|
|||||||
* 反序列化:json 字符串 → 对象
|
* 反序列化:json 字符串 → 对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object jsonToObject(String jsonStr) {
|
public <T> T jsonToObject(String jsonStr, Class<T> type) {
|
||||||
if(SaFoxUtil.isEmpty(jsonStr)) {
|
if(SaFoxUtil.isEmpty(jsonStr)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Object value = objectMapper.readValue(jsonStr, Object.class);
|
return objectMapper.readValue(jsonStr, type);
|
||||||
return value;
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
throw new SaJsonConvertException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 反序列化:json 字符串 → Map
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> jsonToMap(String jsonStr) {
|
|
||||||
if(SaFoxUtil.isEmpty(jsonStr)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Map<String, Object> map = objectMapper.readValue(jsonStr, Map.class);
|
|
||||||
return map;
|
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
throw new SaJsonConvertException(e);
|
throw new SaJsonConvertException(e);
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,6 @@ package cn.dev33.satoken.solon.json;
|
|||||||
import cn.dev33.satoken.json.SaJsonTemplate;
|
import cn.dev33.satoken.json.SaJsonTemplate;
|
||||||
import org.noear.snack.ONode;
|
import org.noear.snack.ONode;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author noear
|
* @author noear
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
@ -37,6 +35,14 @@ public class SaJsonTemplateForSnack3 implements SaJsonTemplate {
|
|||||||
return ONode.stringify(obj);
|
return ONode.stringify(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反序列化:json 字符串 → 对象
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public <T> T jsonToObject(String jsonStr, Class<T> type) {
|
||||||
|
return ONode.deserialize(jsonStr, type);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 反序列化:json 字符串 → 对象
|
* 反序列化:json 字符串 → 对象
|
||||||
*
|
*
|
||||||
@ -48,15 +54,4 @@ public class SaJsonTemplateForSnack3 implements SaJsonTemplate {
|
|||||||
return ONode.deserialize(jsonStr);
|
return ONode.deserialize(jsonStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 反序列化:json 字符串 → Map
|
|
||||||
*
|
|
||||||
* @param jsonStr /
|
|
||||||
* @return /
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> jsonToMap(String jsonStr) {
|
|
||||||
return ONode.deserialize(jsonStr, Map.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user