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

图片上传-bug优化

parent bd47a5be
......@@ -39,7 +39,7 @@ public class ImageUploadService {
})
.onErrorResume(Exception.class, ex -> {
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();
......@@ -54,7 +54,7 @@ public class ImageUploadService {
xxImgfile.setData(fileContent);
return xxImgfileMapper.insert(xxImgfile);
} catch (Exception e) {
throw new NotificationException(uploadImageDTO.getImagePath() + ",An error occurred while downloading the file");
throw new NotificationException(e.getCause().getMessage());
}
// 将文件内容插入数据库
// fileContentMono.flatMap(fileContent -> {
......
......@@ -94,7 +94,7 @@ public class MainTest {
Assertions.assertNotNull(secretKey, "appId不存在");//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
UploadImageDTO uploadImageDTO = new UploadImageDTO();
uploadImageDTO.setImagePath("http://192.168.168.211/guoqing1.jpg");
uploadImageDTO.setImagePath("");
uploadImageDTO.setImageType(ListImageType.FACE);
String json = null;
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