提交 edf2d83c authored 作者: 朱旭欣's avatar 朱旭欣

第三次提交

上级 5bcc993e
...@@ -37,10 +37,10 @@ public class WeeklyController { ...@@ -37,10 +37,10 @@ public class WeeklyController {
} }
@DeleteMapping("/deleteFile") @DeleteMapping("/deleteFile/{fileId}")
@ApiOperation(value = "周报文件删除") @ApiOperation(value = "周报文件删除")
public ReturnPojo deleteFile(@PathVariable("id")Integer id){ public ReturnPojo deleteFile(@PathVariable("fileId")Integer fileId){
weeklyFileService.deleteFile(id); weeklyFileService.deleteFile(fileId);
return ReturnPojo.ok("删除成功"); return ReturnPojo.ok("删除成功");
} }
......
...@@ -32,4 +32,4 @@ public class ReturnPojo { ...@@ -32,4 +32,4 @@ public class ReturnPojo {
public static ReturnPojo error( Integer code, String message) { public static ReturnPojo error( Integer code, String message) {
return new ReturnPojo(code, message, ""); return new ReturnPojo(code, message, "");
} }
} }
\ No newline at end of file
...@@ -28,7 +28,6 @@ public class WeeklyUser { ...@@ -28,7 +28,6 @@ public class WeeklyUser {
@ApiModelProperty(value = "用户名称",example = "小明") @ApiModelProperty(value = "用户名称",example = "小明")
private String userName; private String userName;
@ApiModelProperty(value = "文件",example = "小明") @ApiModelProperty(value = "文件",example = "小明")
@Transient @Transient
private List<WeeklyFile> files; private List<WeeklyFile> files;
......
...@@ -79,7 +79,10 @@ public class WeeklyFileServiceImpl implements WeeklyFileService { ...@@ -79,7 +79,10 @@ public class WeeklyFileServiceImpl implements WeeklyFileService {
} }
@Override @Override
public void deleteFile(Integer id) { public void deleteFile(Integer id){
String fileUpload = weeklyFileDao.findById(id).get().getUploadAddress();
File file = new File(fileUpload);
file.delete();
weeklyFileDao.deleteById(id); weeklyFileDao.deleteById(id);
} }
...@@ -144,5 +147,4 @@ public class WeeklyFileServiceImpl implements WeeklyFileService { ...@@ -144,5 +147,4 @@ public class WeeklyFileServiceImpl implements WeeklyFileService {
TimedTask.toZip(fileList,fos2); TimedTask.toZip(fileList,fos2);
} }
} }
...@@ -8,6 +8,6 @@ spring.jpa.hibernate.ddl-auto=update ...@@ -8,6 +8,6 @@ spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.format_sql=true
file.path=/root/projects/weekly/download file.path=/root/projects/weekly/download/ty-weekly.zip
file.path1=/root/projects/weekly/save file.path1=/root/projects/weekly/save/
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论