|
@@ -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;
|
|
|
}
|