wuweihao 4 lat temu
rodzic
commit
5f2cda810e

+ 3 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/FodderEntity.java

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

+ 1 - 1
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/provider/WorkProvider.java

@@ -22,7 +22,7 @@ public class WorkProvider {
             sql.append(" and ( name like '%").append(searchKey).append("%' )");
         }
 
-        sql.append(" order by create_time asc");
+        sql.append(" order by create_time desc");
 
         log.info("sql: {}", sql.toString());
         return sql.toString();

+ 1 - 4
720yun_fd_manage/gis_service/src/main/java/com/gis/service/FodderService.java

@@ -7,9 +7,6 @@ import com.gis.domain.dto.PageDto;
 import com.gis.domain.entity.FodderEntity;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.io.IOException;
-import java.util.List;
-
 
 /**
  * Created by owen on 2020/3/11 0011 16:14
@@ -20,7 +17,7 @@ public interface FodderService extends IBaseService<FodderEntity, Long> {
 
     Result upload2(MultipartFile file, String type) ;
 
-    Result upload(MultipartFile file, String type) ;
+    Result upload(MultipartFile file, String type, String tempId) ;
 
     Result search(FodderPageDto param);
 

+ 2 - 1
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/FodderServiceImpl.java

@@ -199,7 +199,7 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
 
 
     @Override
-    public Result upload(MultipartFile file, String type)  {
+    public Result upload(MultipartFile file, String type, String tempId)  {
 
         long start = System.currentTimeMillis();
         // 检查非法文件上传
@@ -299,6 +299,7 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
             entity.setFileSize(size+"");
             entity.setDpi(dpi);
             entity.setPreviewIcon(ossPreviewIcon);
+            entity.setTempId(tempId);
 
             save(entity);
 

+ 4 - 4
720yun_fd_manage/gis_web/src/main/java/com/gis/web/controller/FodderController.java

@@ -42,15 +42,15 @@ public class FodderController extends BaseController {
     @Autowired
     SceneService sceneService;
 
-    @ApiOperation(value = "上传素材", notes = "type:类型, 全景图:pano, 图片:image, 音频:audio, 视频:video")
-    @PostMapping("upload/{type}")
-    public Result upload(MultipartFile file, @PathVariable String type) {
+    @ApiOperation(value = "上传素材", notes = "type:类型, 全景图:pano, 图片:image, 音频:audio, 视频:video, temId: 前端临时Id")
+    @PostMapping("upload/{type}/{tempId}")
+    public Result upload(MultipartFile file, @PathVariable String type, @PathVariable String tempId) {
 
         if (file == null) {
             log.error("文件不能为空");
             return Result.failure("文件不能为空");
         }
-        return fodderService.upload(file, type);
+        return fodderService.upload(file, type, tempId);
     }
 
     @ApiOperation(value = "列表", position = 1)