wuweihao 3 years ago
parent
commit
5bc48de6d3

+ 2 - 2
720yun_local_manage/gis_pano/src/main/java/com/gis/cms/entity/po/FodderEntity.java

@@ -53,8 +53,8 @@ public class FodderEntity extends BaseEntity implements Serializable {
 //    @ApiModelProperty(value = "该作品下的场景是否已使用")
 //    private Integer isUse = 0;
 
-//    @ApiModelProperty(value = "上传临时用的id, 前端需要用")
-//    private String tempId;
+    @ApiModelProperty(value = "上传临时用的id, 前端需要用")
+    private String tempId;
 
 
 

+ 4 - 4
720yun_local_manage/gis_pano_producer/src/main/java/com/gis/cms/controller/ProducerController.java

@@ -25,10 +25,10 @@ public class ProducerController {
     ProducerService entityService;
 
     @WebControllerLog(description = "上传全景图")
-    @ApiOperation(value = "上传全景图", notes = "调用算法切图")
-    @PostMapping("upload")
-    public Result upload(MultipartFile file) throws IOException {
-        return entityService.upload(file);
+    @ApiOperation(value = "上传全景图", notes = "调用算法切图, tempId:前端提供")
+    @PostMapping("upload/{tempId}")
+    public Result upload(MultipartFile file,  @PathVariable String tempId) throws IOException {
+        return entityService.upload(file, tempId);
     }
 
 

+ 2 - 2
720yun_local_manage/gis_pano_producer/src/main/java/com/gis/cms/entity/po/FodderEntity.java

@@ -56,8 +56,8 @@ public class FodderEntity extends BaseEntity implements Serializable {
 //    @ApiModelProperty(value = "该作品下的场景是否已使用")
 //    private Integer isUse = 0;
 
-//    @ApiModelProperty(value = "上传临时用的id, 前端需要用")
-//    private String tempId;
+    @ApiModelProperty(value = "上传临时用的id, 前端需要用")
+    private String tempId;
 
 
 

+ 1 - 1
720yun_local_manage/gis_pano_producer/src/main/java/com/gis/cms/service/ProducerService.java

@@ -9,5 +9,5 @@ import java.io.IOException;
  * Created by owen on 2022/3/23 0023 16:45
  */
 public interface ProducerService {
-    Result upload(MultipartFile file) throws IOException;
+    Result upload(MultipartFile file, String tempId) throws IOException;
 }

+ 2 - 2
720yun_local_manage/gis_pano_producer/src/main/java/com/gis/cms/service/impl/ProduceServiceImpl.java

@@ -11,7 +11,6 @@ import com.gis.common.base.exception.BaseRuntimeException;
 import com.gis.common.constant.ConfigConstant;
 import com.gis.common.util.*;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.RandomUtils;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -44,7 +43,7 @@ public class ProduceServiceImpl implements ProducerService {
     FodderMapper fodderMapper;
 
     @Override
-    public Result upload(MultipartFile file) throws IOException {
+    public Result upload(MultipartFile file, String tempId) throws IOException {
         Long userId = JwtUtil.getUserId(request.getHeader("token"));
         long start = System.currentTimeMillis();
         // 全景图只支持jpg图片格式
@@ -71,6 +70,7 @@ public class ProduceServiceImpl implements ProducerService {
         entity.setSceneCode(sceneCode);
         entity.setCreatorId(userId);
         entity.setFilePath(basePath);
+        entity.setTempId(tempId);
 
 
         fodderMapper.insert(entity);