|
@@ -2,6 +2,7 @@ package com.gis.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.img.ImgUtil;
|
|
import cn.hutool.core.img.ImgUtil;
|
|
|
|
+import cn.hutool.core.io.FileTypeUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import com.gis.common.config.RabbitConfig;
|
|
import com.gis.common.config.RabbitConfig;
|
|
import com.gis.common.constant.CmdConstant;
|
|
import com.gis.common.constant.CmdConstant;
|
|
@@ -106,6 +107,14 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
|
|
return Result.failure(MsgCode.e3004, "全景图文件不能超过120MB");
|
|
return Result.failure(MsgCode.e3004, "全景图文件不能超过120MB");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 次方法可以读取到图片内部结构, 可以检验非全景图
|
|
|
|
+ String imgType = FileTypeUtil.getType(file.getInputStream());
|
|
|
|
+ // 全景图只支持jpg图片格式
|
|
|
|
+ if (!imgType.equalsIgnoreCase("jpg")) {
|
|
|
|
+ log.error("图片格式错误,只支持jpg图片类型, type: " + imgType);
|
|
|
|
+ return Result.failure(MsgCode.e5003, "只支持jpg图片类型, 真实格式是:" + imgType);
|
|
|
|
+ }
|
|
|
|
+
|
|
String sceneCode = RandomUtils.getSceneCode("fd720_");
|
|
String sceneCode = RandomUtils.getSceneCode("fd720_");
|
|
newName = sceneCode+"." + suffix;
|
|
newName = sceneCode+"." + suffix;
|
|
savePath =savePath + sceneCode + "/" + newName;
|
|
savePath =savePath + sceneCode + "/" + newName;
|