perf:移除hutool-json,直接使用fastjson
This commit is contained in:
@@ -3,7 +3,7 @@ package com.tiesheng.util.service;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.service.cache.TsCacheHandler;
|
||||
@@ -36,7 +36,7 @@ public class TsCacheService {
|
||||
}
|
||||
|
||||
public void putObj(String key, Object value, long seconds) {
|
||||
tsCacheHandler.put(key, JSONUtil.toJsonStr(value), seconds);
|
||||
tsCacheHandler.put(key, JSON.toJSONString(value), seconds);
|
||||
}
|
||||
|
||||
public String get(String key) {
|
||||
@@ -58,7 +58,7 @@ public class TsCacheService {
|
||||
* @return
|
||||
*/
|
||||
public <T> T getObj(String key, Class<T> tClass, long seconds) {
|
||||
return JSONUtil.toBean(get(key, seconds), tClass, true);
|
||||
return JSON.parseObject(get(key, seconds), tClass);
|
||||
}
|
||||
|
||||
public void remove(String key) {
|
||||
|
||||
Reference in New Issue
Block a user