|
@@ -13,7 +13,6 @@ import com.sckw.core.utils.StringUtils;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
-import com.sckw.core.web.response.result.Result;
|
|
|
|
|
import com.sckw.core.web.response.result.Status;
|
|
import com.sckw.core.web.response.result.Status;
|
|
|
import com.sckw.file.api.dto.FileInfoDTO;
|
|
import com.sckw.file.api.dto.FileInfoDTO;
|
|
|
import com.sckw.file.config.FileListConfig;
|
|
import com.sckw.file.config.FileListConfig;
|
|
@@ -264,7 +263,7 @@ public class FileService {
|
|
|
return HttpResult.ok(fileInfoVO);
|
|
return HttpResult.ok(fileInfoVO);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void insertFile(FileInfo fileInfo) throws ParseException {
|
|
|
|
|
|
|
+ private void insertFile(FileInfo fileInfo){
|
|
|
kwfFileInfo kwfFileInfo = new kwfFileInfo();
|
|
kwfFileInfo kwfFileInfo = new kwfFileInfo();
|
|
|
kwfFileInfo.setOriginalName(fileInfo.getFileOriginalName());
|
|
kwfFileInfo.setOriginalName(fileInfo.getFileOriginalName());
|
|
|
kwfFileInfo.setFileSuffix(FilenameUtils.getExtension(fileInfo.getFileOriginalName()));
|
|
kwfFileInfo.setFileSuffix(FilenameUtils.getExtension(fileInfo.getFileOriginalName()));
|
|
@@ -284,10 +283,11 @@ public class FileService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public Result appUploadFileInfo(MultipartFile file) throws ParseException {
|
|
|
|
|
|
|
+ @Transactional
|
|
|
|
|
+ public HttpResult appUploadFileInfo(MultipartFile file){
|
|
|
boolean flag = checkFileFormat(file);
|
|
boolean flag = checkFileFormat(file);
|
|
|
if (!flag) {
|
|
if (!flag) {
|
|
|
- return Result.build(Status.FAILURE, "上传文件格式错误!");
|
|
|
|
|
|
|
+ return HttpResult.error(Status.FAILURE.getCode(), "上传文件格式错误!");
|
|
|
}
|
|
}
|
|
|
FileInfo fileInfo = FileUtils.getFileDataList(file);
|
|
FileInfo fileInfo = FileUtils.getFileDataList(file);
|
|
|
fileInfo.setType(FileEnum.FILE_STORE_TYPE_OSS.getFileType());
|
|
fileInfo.setType(FileEnum.FILE_STORE_TYPE_OSS.getFileType());
|
|
@@ -295,7 +295,7 @@ public class FileService {
|
|
|
FileInfoVO fileInfoVO = new FileInfoVO();
|
|
FileInfoVO fileInfoVO = new FileInfoVO();
|
|
|
BeanUtils.copyProperties(returnFileInfo, fileInfoVO);
|
|
BeanUtils.copyProperties(returnFileInfo, fileInfoVO);
|
|
|
insertFile(returnFileInfo);
|
|
insertFile(returnFileInfo);
|
|
|
- return Result.build(Status.SUCCESS, fileInfoVO);
|
|
|
|
|
|
|
+ return HttpResult.ok(Status.SUCCESS.getCode(),"", fileInfoVO);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|