mirror of https://github.com/elunez/eladmin
update
parent
a6e57e160f
commit
d32216d513
|
@ -1,7 +1,6 @@
|
||||||
package me.zhengjie.modules.system.rest;
|
package me.zhengjie.modules.system.rest;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import me.zhengjie.aop.log.Log;
|
import me.zhengjie.aop.log.Log;
|
||||||
|
@ -11,7 +10,6 @@ import me.zhengjie.modules.system.domain.Dept;
|
||||||
import me.zhengjie.modules.system.service.DeptService;
|
import me.zhengjie.modules.system.service.DeptService;
|
||||||
import me.zhengjie.modules.system.service.dto.DeptDto;
|
import me.zhengjie.modules.system.service.dto.DeptDto;
|
||||||
import me.zhengjie.modules.system.service.dto.DeptQueryCriteria;
|
import me.zhengjie.modules.system.service.dto.DeptQueryCriteria;
|
||||||
import me.zhengjie.utils.RedisUtils;
|
|
||||||
import me.zhengjie.utils.ThrowableUtil;
|
import me.zhengjie.utils.ThrowableUtil;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
|
|
@ -61,14 +61,6 @@ public class LocalStorageController {
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除文件")
|
|
||||||
@DeleteMapping(value = "/{id}")
|
|
||||||
@PreAuthorize("@el.check('storage:del')")
|
|
||||||
public ResponseEntity<Object> delete(@PathVariable Long id){
|
|
||||||
localStorageService.delete(id);
|
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log("多选删除")
|
@Log("多选删除")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
@ApiOperation("多选删除")
|
@ApiOperation("多选删除")
|
||||||
|
|
|
@ -15,8 +15,6 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 郑杰
|
* @author 郑杰
|
||||||
|
|
|
@ -51,12 +51,6 @@ public interface LocalStorageService {
|
||||||
*/
|
*/
|
||||||
void update(LocalStorage resources);
|
void update(LocalStorage resources);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID删除
|
|
||||||
* @param id /
|
|
||||||
*/
|
|
||||||
void delete(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多选删除
|
* 多选删除
|
||||||
* @param ids /
|
* @param ids /
|
||||||
|
|
|
@ -113,15 +113,6 @@ public class LocalStorageServiceImpl implements LocalStorageService {
|
||||||
localStorageRepository.save(localStorage);
|
localStorageRepository.save(localStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@CacheEvict(allEntries = true)
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void delete(Long id) {
|
|
||||||
LocalStorage storage = localStorageRepository.findById(id).orElseGet(LocalStorage::new);
|
|
||||||
FileUtil.del(storage.getPath());
|
|
||||||
localStorageRepository.delete(storage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(allEntries = true)
|
@CacheEvict(allEntries = true)
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
Loading…
Reference in New Issue