feat:del PHDFile Cache
This commit is contained in:
parent
457bb8e5bb
commit
7beaa9a06a
|
@ -5,6 +5,7 @@ import com.google.common.cache.CacheBuilder;
|
|||
import org.jeecg.modules.entity.vo.PHDFile;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Component
|
||||
|
@ -30,4 +31,7 @@ public class LocalCache {
|
|||
this.phdCache = phdCache;
|
||||
}
|
||||
|
||||
public void deletePHDCache(String key){
|
||||
this.phdCache.invalidate(key);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package org.jeecg.modules.controller;
|
||||
|
||||
import com.google.common.cache.Cache;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.cache.LocalCache;
|
||||
import org.jeecg.modules.base.bizVo.GammaRLR;
|
||||
import org.jeecg.modules.entity.vo.*;
|
||||
import org.jeecg.modules.feignclient.SystemClient;
|
||||
|
@ -15,6 +17,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("gamma")
|
||||
|
@ -52,6 +55,13 @@ public class GammaController {
|
|||
public Result gammaByFile(String fileName, HttpServletRequest request) {
|
||||
return gammaService.gammaByFile(fileName, request);
|
||||
}
|
||||
|
||||
@DeleteMapping("delPHDCache")
|
||||
@ApiOperation(value = "删除PHD文件缓存", notes = "删除PHD文件缓存")
|
||||
public void delPHDCache(@RequestParam String fileName) {
|
||||
gammaService.delPHDCache(fileName);
|
||||
}
|
||||
|
||||
@GetMapping("Compare")
|
||||
public Result Compare(String fileName, String compareFileName, HttpServletRequest request) {
|
||||
return gammaService.Compare(fileName, compareFileName, request);
|
||||
|
|
|
@ -20,6 +20,8 @@ public interface IGammaService{
|
|||
|
||||
Result gammaByFile(String fileName, HttpServletRequest request);
|
||||
|
||||
void delPHDCache(String fileName);
|
||||
|
||||
Result Compare(String fileName, String compareFileName, HttpServletRequest request);
|
||||
|
||||
Result Strip(String fileName, String stripFileName, Double ratioRate, HttpServletRequest request);
|
||||
|
|
|
@ -807,6 +807,15 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delPHDCache(String fileName) {
|
||||
LoginUser loginUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
||||
String username = loginUser.getUsername();
|
||||
String key = fileName + StrUtil.DASHED + username;
|
||||
// 删除指定key的Cache
|
||||
localCache.deletePHDCache(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result Compare(String fileName, String compareFileName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
|
|
Loading…
Reference in New Issue
Block a user