修改批量删除接口
This commit is contained in:
parent
5f95eb8c2e
commit
ac31382d55
@ -100,15 +100,15 @@ public class FileController {
|
||||
*/
|
||||
@RequestMapping(value = "/batchdeletefile", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public RestResult<String> deleteImageByIds(@RequestBody String files) {
|
||||
public RestResult<String> deleteImageByIds(@RequestBody FileBean fileBean) {
|
||||
RestResult<String> result = new RestResult<String>();
|
||||
if (!operationCheck().isSuccess()) {
|
||||
return operationCheck();
|
||||
}
|
||||
|
||||
List<FileBean> fileList = JSON.parseArray(files, FileBean.class);
|
||||
List<FileBean> fileList = JSON.parseArray(fileBean.getFiles(), FileBean.class);
|
||||
|
||||
for (FileBean fileBean : fileList) {
|
||||
for (FileBean file : fileList) {
|
||||
fileService.deleteFile(fileBean);
|
||||
}
|
||||
|
||||
@ -270,14 +270,14 @@ public class FileController {
|
||||
*/
|
||||
@RequestMapping(value = "/selectfilebyfiletype", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public RestResult<List<FileBean>> selectFileByFileType(@RequestParam int fileType) {
|
||||
public RestResult<List<FileBean>> selectFileByFileType(FileBean fileBean) {
|
||||
RestResult<List<FileBean>> result = new RestResult<List<FileBean>>();
|
||||
UserBean sessionUserBean = (UserBean) SecurityUtils.getSubject().getPrincipal();
|
||||
long userid = sessionUserBean.getUserId();
|
||||
if (isShareFile){
|
||||
userid = 2;
|
||||
}
|
||||
List<FileBean> file = fileService.selectFileByExtendName(getFileExtendsByType(fileType), userid);
|
||||
List<FileBean> file = fileService.selectFileByExtendName(getFileExtendsByType(fileBean.getFiletype()), userid);
|
||||
result.setData(file);
|
||||
result.setSuccess(true);
|
||||
return result;
|
||||
|
@ -79,6 +79,16 @@ public class FileBean {
|
||||
private String newfilepath;
|
||||
@Transient
|
||||
private String files;
|
||||
@Transient
|
||||
private int filetype;
|
||||
|
||||
public int getFiletype() {
|
||||
return filetype;
|
||||
}
|
||||
|
||||
public void setFiletype(int filetype) {
|
||||
this.filetype = filetype;
|
||||
}
|
||||
|
||||
public String getOldfilepath() {
|
||||
return oldfilepath;
|
||||
|
@ -22,7 +22,7 @@ mybatis.mapper-locations=classpath:mybatis/mapper/*.xml
|
||||
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url = jdbc:mysql://localhost:3306/file?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=macpassword123
|
||||
spring.datasource.password=ma123456
|
||||
|
||||
#数据库初始化
|
||||
spring.datasource.data=classpath:database/data.sql
|
||||
|
Loading…
Reference in New Issue
Block a user