前端添加、删除文件和反馈提示改为服务器回调信息,去除无用文件,前端版本信息改为由服务器获取,后台可批量插入版本日志

This commit is contained in:
F嘉阳
2018-02-27 09:23:38 +08:00
parent b652389d4e
commit a93f63280b
29 changed files with 230 additions and 329 deletions

View File

@@ -33,20 +33,25 @@ public class DeleteController {
*/
@RequestMapping("/home/filedelete")
@ResponseBody
public void delete(@RequestParam(value = "fileid") Integer fileid)throws Exception {
public boolean delete(@RequestParam(value = "fileid") Integer fileid)throws Exception {
TbFile tbFile = new TbFile();
tbFile.setColfileid(fileid);
TbFile resfile = fileService.findFileById(tbFile);
File filepath = new File(resfile.getColfilepath());
if (!filepath.exists()) {
log.error("删除文件失败:" + resfile.getColfilename() + "不存在!");
return false;
} else {
if (filepath.isFile()){
deleteFile(resfile.getColfilepath(),resfile.getColfileid());
new UserException(ResultEnum.SUCCESS);
return true;
}
else
else{
deleteDirectory(resfile.getColfilepath());
return true;
}
}
}