perf:移除TimedCacheService、TimedCacheHelper,新增TsCacheService,同时实现了内存缓存、Redis缓存
This commit is contained in:
@@ -5,12 +5,12 @@ import cn.hutool.captcha.LineCaptcha;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.util.service.TsCacheService;
|
||||
import com.tiesheng.web.config.template.ToolTemplateHandler;
|
||||
import com.tiesheng.web.pojos.dto.*;
|
||||
import com.tiesheng.web.pojos.vo.TemplateInfoVO;
|
||||
import com.tiesheng.web.pojos.vo.PicVerifyVo;
|
||||
import com.tiesheng.web.service.FileUploadService;
|
||||
import com.tiesheng.web.service.TimedCacheService;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
|
||||
public class ToolController {
|
||||
|
||||
@Autowired
|
||||
TimedCacheService timedCacheService;
|
||||
TsCacheService tsCacheService;
|
||||
@Autowired
|
||||
FileUploadService fileUploadService;
|
||||
@Autowired
|
||||
@@ -51,7 +51,7 @@ public class ToolController {
|
||||
PicVerifyVo vo = new PicVerifyVo();
|
||||
vo.setBase64(lineCaptcha.getImageBase64Data());
|
||||
vo.setKey(IdUtil.simpleUUID());
|
||||
timedCacheService.setImageCode(vo.getKey(), lineCaptcha.getCode());
|
||||
tsCacheService.put(vo.getKey(), lineCaptcha.getCode());
|
||||
|
||||
return ApiResp.respOK(vo);
|
||||
}
|
||||
@@ -113,7 +113,7 @@ public class ToolController {
|
||||
/**
|
||||
* 合并文件
|
||||
*
|
||||
* @param fileMd5
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@TokenIgnore
|
||||
|
||||
Reference in New Issue
Block a user