perf:移除hutool-json,直接使用fastjson

This commit is contained in:
曾文豪
2024-08-23 15:04:20 +08:00
parent 9bab4cdb25
commit 4bcae2f8d1
23 changed files with 176 additions and 116 deletions

View File

@@ -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) {