|
@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.eco.vip.core.constant.Constants;
|
|
|
import org.eco.vip.core.exception.BusinessException;
|
|
|
import org.eco.vip.core.pojo.PageResult;
|
|
|
+import org.eco.vip.core.utils.BeanUtils;
|
|
|
import org.eco.vip.core.utils.FileDownloadUtils;
|
|
|
import org.eco.vip.core.utils.FileLocalUtils;
|
|
|
import org.eco.vip.core.utils.FileUtils;
|
|
@@ -126,7 +127,7 @@ public class FilesService extends BaseService<FilesMapper, Files> implements IFi
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String upload(String engine, MultipartFile file) {
|
|
|
+ public FilesVO upload(String engine, MultipartFile file) {
|
|
|
return this.storageFile(engine, file);
|
|
|
}
|
|
|
|
|
@@ -147,7 +148,7 @@ public class FilesService extends BaseService<FilesMapper, Files> implements IFi
|
|
|
* @param file 文件
|
|
|
* @return 文件id/url
|
|
|
*/
|
|
|
- private String storageFile(String engine, MultipartFile file) {
|
|
|
+ private FilesVO storageFile(String engine, MultipartFile file) {
|
|
|
String key = Seqs.getId(Seqs.UPLOAD_SEQ_TYPE);
|
|
|
String path = FileUtils.genFilePath(key, file.getOriginalFilename());
|
|
|
String storageUrl = FileLocalUtils.storageFileWithReturnUrl(Constants.LOCAL_FILE_BUCKET_KEY, path, file);
|
|
@@ -174,7 +175,7 @@ public class FilesService extends BaseService<FilesMapper, Files> implements IFi
|
|
|
filesInfo.setDownloadUrl(downloadUrl);
|
|
|
filesInfo.setStorageUrl(storageUrl);
|
|
|
this.save(filesInfo);
|
|
|
- return filesInfo.getFileId();
|
|
|
+ return BeanUtils.toBean(filesInfo, FilesVO.class);
|
|
|
}
|
|
|
|
|
|
private void uniDownload(String id, HttpServletResponse response) {
|