|
|
@ -196,7 +196,7 @@ public class SysFilesServiceImpl extends ServiceImpl<SysFilesMapper, SysFilesEnt |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
// 缓存预览结果,使用id作为缓存键
|
|
|
|
// 缓存预览结果,使用id作为缓存键
|
|
|
|
@Cacheable(value = "preview", key = "#id") |
|
|
|
// @Cacheable(value = "preview", key = "#id")
|
|
|
|
public void preview(String id, HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { |
|
|
|
public void preview(String id, HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { |
|
|
|
if (id != null) { |
|
|
|
if (id != null) { |
|
|
|
SysFilesEntity entity = this.getById(id); |
|
|
|
SysFilesEntity entity = this.getById(id); |
|
|
@ -306,7 +306,7 @@ public class SysFilesServiceImpl extends ServiceImpl<SysFilesMapper, SysFilesEnt |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// 删除预览结果的缓存,同样使用id作为键
|
|
|
|
// 删除预览结果的缓存,同样使用id作为键
|
|
|
|
@CacheEvict(value = "preview", key = "#id") |
|
|
|
// @CacheEvict(value = "preview", key = "#id")
|
|
|
|
public void removePreview(String id) { |
|
|
|
public void removePreview(String id) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|