Explorar el Código

素材库, 上传image图片 处理thumb-1

wuweihao hace 2 años
padre
commit
27e21d973c

+ 4 - 0
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/FodderServiceImpl.java

@@ -165,8 +165,12 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
                 if (type.equals("image")) {
                     // 2022-10-27,图片大于1MB生成缩略图, 小于1MB使用原图作为缩略图
                     if (size > 1024){
+                        savePath = savePath  + "/fodder/image/" + newName;
+                        log.info("savePath: {}", savePath);
+                        FileUtil.writeFromStream(file.getInputStream(), savePath);
                         iconPath = convertAndUploadOss(
                                 savePath, configConstant.ossBasePath + "fodder", configConstant.ossDomain, 300, 150, "/thumb_" + newName);
+                        log.info("图片压缩完成");
                     } else {
                         iconPath = ossUrl;
                     }