专题资源中的缓存代理设置;
This commit is contained in:
parent
cbe266392c
commit
245350d233
|
@ -103,4 +103,28 @@ public class SysOssPersonController extends BaseController {
|
||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(sysOssPersonService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(sysOssPersonService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复制
|
||||||
|
*
|
||||||
|
* @param bo 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("file:person:copy")
|
||||||
|
@Log(title = "【复制我的空间】", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/copy")
|
||||||
|
public R<Void> copy(@RequestBody SysOssPersonBo bo) {
|
||||||
|
return toAjax(sysOssPersonService.copyByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移动
|
||||||
|
*
|
||||||
|
* @param bo 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("file:person:move")
|
||||||
|
@Log(title = "【移动我的空间】", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/move")
|
||||||
|
public R<Void> move(@RequestBody SysOssPersonBo bo) {
|
||||||
|
return toAjax(sysOssPersonService.moveByBo(bo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,13 @@ package org.dromara.system.domain.vo;
|
||||||
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.system.domain.SysOssResource;
|
import org.dromara.system.domain.SysOssResource;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,6 +24,7 @@ public class SysOssResourceVo implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -43,5 +46,20 @@ public class SysOssResourceVo implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件后缀名
|
||||||
|
*/
|
||||||
|
private String fileSuffix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 容量
|
||||||
|
*/
|
||||||
|
private String volume;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Translation(type = TransConstant.USER_ID_TO_NAME)
|
||||||
|
private Long createBy;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package org.dromara.system.service;
|
package org.dromara.system.service;
|
||||||
|
|
||||||
import org.dromara.system.domain.vo.SysOssPersonVo;
|
|
||||||
import org.dromara.system.domain.bo.SysOssPersonBo;
|
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.system.domain.bo.SysOssPersonBo;
|
||||||
|
import org.dromara.system.domain.vo.SysOssPersonVo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -65,4 +65,7 @@ public interface ISysOssPersonService {
|
||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
Boolean copyByBo(SysOssPersonBo bo);
|
||||||
|
Boolean moveByBo(SysOssPersonBo bo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import org.dromara.system.domain.vo.SysCatalogResourceVo;
|
||||||
import org.dromara.system.mapper.SysCatalogResourceMapper;
|
import org.dromara.system.mapper.SysCatalogResourceMapper;
|
||||||
import org.dromara.system.mapper.SysOssResourceMapper;
|
import org.dromara.system.mapper.SysOssResourceMapper;
|
||||||
import org.dromara.system.service.ISysCatalogResourceService;
|
import org.dromara.system.service.ISysCatalogResourceService;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -107,9 +108,9 @@ public class SysCatalogResourceServiceImpl implements ISysCatalogResourceService
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateByBo(SysCatalogResourceBo bo) {
|
public Boolean updateByBo(SysCatalogResourceBo bo) {
|
||||||
SysCatalogResource update = MapstructUtils.convert(bo, SysCatalogResource.class);
|
SysCatalogResource update = MapstructUtils.convert(bo, SysCatalogResource.class);
|
||||||
SysCatalogResource old = baseMapper.selectById(update.getCatalogId());
|
SysCatalogResourceVo old = SpringUtils.getAopProxy(this).selectCatalogById(update.getCatalogId());
|
||||||
if (!old.getParentId().equals(update.getParentId())) {
|
if (!old.getParentId().equals(update.getParentId())) {
|
||||||
SysCatalogResource newParentDept = baseMapper.selectById(update.getParentId());
|
SysCatalogResourceVo newParentDept = SpringUtils.getAopProxy(this).selectCatalogById(update.getParentId());
|
||||||
if (ObjectUtil.isNotNull(newParentDept) && ObjectUtil.isNotNull(old)) {
|
if (ObjectUtil.isNotNull(newParentDept) && ObjectUtil.isNotNull(old)) {
|
||||||
String newAncestors = newParentDept.getAncestors() + StringUtils.SEPARATOR + newParentDept.getCatalogId();
|
String newAncestors = newParentDept.getAncestors() + StringUtils.SEPARATOR + newParentDept.getCatalogId();
|
||||||
String oldAncestors = old.getAncestors();
|
String oldAncestors = old.getAncestors();
|
||||||
|
@ -158,7 +159,7 @@ public class SysCatalogResourceServiceImpl implements ISysCatalogResourceService
|
||||||
return ossResourceMapper.exists(new LambdaQueryWrapper<SysOssResource>()
|
return ossResourceMapper.exists(new LambdaQueryWrapper<SysOssResource>()
|
||||||
.eq(SysOssResource::getCatalogId, catalogId));
|
.eq(SysOssResource::getCatalogId, catalogId));
|
||||||
}
|
}
|
||||||
|
@Cacheable(cacheNames = CacheNames.SYS_CATALOG_RESOURCE, key = "#catalogId")
|
||||||
@Override
|
@Override
|
||||||
public SysCatalogResourceVo selectCatalogById(Long catalogId) {
|
public SysCatalogResourceVo selectCatalogById(Long catalogId) {
|
||||||
return baseMapper.selectVoById(catalogId);
|
return baseMapper.selectVoById(catalogId);
|
||||||
|
|
|
@ -129,4 +129,14 @@ public class SysOssPersonServiceImpl implements ISysOssPersonService {
|
||||||
}
|
}
|
||||||
return baseMapper.deleteBatchIds(ids) > 0;
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean copyByBo(SysOssPersonBo bo) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean moveByBo(SysOssPersonBo bo) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue