Commit f4dd47a7 authored by 以墨为白's avatar 以墨为白 🎧

图片上传-bug优化

parent bd47a5be
...@@ -39,7 +39,7 @@ public class ImageUploadService { ...@@ -39,7 +39,7 @@ public class ImageUploadService {
}) })
.onErrorResume(Exception.class, ex -> { .onErrorResume(Exception.class, ex -> {
System.err.println("General Exception: " + ex.getMessage()); System.err.println("General Exception: " + ex.getMessage());
return Mono.error(new NotificationException(uploadImageDTO.getImagePath() + ",An error occurred while downloading the file")); return Mono.error(new NotificationException(ex.getMessage()));
}); });
XxImgfile xxImgfile = new XxImgfile(); XxImgfile xxImgfile = new XxImgfile();
...@@ -54,7 +54,7 @@ public class ImageUploadService { ...@@ -54,7 +54,7 @@ public class ImageUploadService {
xxImgfile.setData(fileContent); xxImgfile.setData(fileContent);
return xxImgfileMapper.insert(xxImgfile); return xxImgfileMapper.insert(xxImgfile);
} catch (Exception e) { } catch (Exception e) {
throw new NotificationException(uploadImageDTO.getImagePath() + ",An error occurred while downloading the file"); throw new NotificationException(e.getCause().getMessage());
} }
// 将文件内容插入数据库 // 将文件内容插入数据库
// fileContentMono.flatMap(fileContent -> { // fileContentMono.flatMap(fileContent -> {
......
...@@ -94,7 +94,7 @@ public class MainTest { ...@@ -94,7 +94,7 @@ public class MainTest {
Assertions.assertNotNull(secretKey, "appId不存在");//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率 Assertions.assertNotNull(secretKey, "appId不存在");//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数 //请求参数
UploadImageDTO uploadImageDTO = new UploadImageDTO(); UploadImageDTO uploadImageDTO = new UploadImageDTO();
uploadImageDTO.setImagePath("http://192.168.168.211/guoqing1.jpg"); uploadImageDTO.setImagePath("");
uploadImageDTO.setImageType(ListImageType.FACE); uploadImageDTO.setImageType(ListImageType.FACE);
String json = null; String json = null;
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment