fix: 修正问题

dev
huangfeng 1 year ago
parent 85dc63d918
commit b245a7e71b

@ -45,9 +45,9 @@ public class MntnUploadController extends BaseController {
@PostMapping("uploadLog")
@ApiOperation("上传日志")
public ResponseReult uploadLog(@RequestParam("file") MultipartFile file,
@RequestParam(value = "termId", required = true) Integer termId) throws Exception {
if (file == null) {
throw new ApiException("缺少上传的文件");
@RequestParam(value = "termId", required = false) Integer termId) throws Exception {
if (termId == null) {
termId = 0;
}
service.uploadLog(termId, file);
ResponseReult result = new ResponseReult();

@ -19,7 +19,7 @@ public class MultipartConfig {
String os = System.getProperty("os.name");
// 兼容windows
if (os.toLowerCase().startsWith("win")) {
fileTempDir = "D:" + fileTempDir;
fileTempDir = fileTempDir;
}
log.info("fileTempDir:{}", fileTempDir);
MultipartConfigFactory factory = new MultipartConfigFactory();

@ -59,7 +59,9 @@ public class MntnUploadServiceImpl implements MntnUploadService {
@Override
public void delete(Integer id) throws Exception {
MntnUploads record = mapper.selectByPrimaryKey(id);
mapper.deleteByPrimaryKey(id);
new File(termlog + record.getPath()).delete();
}
@Override

Loading…
Cancel
Save