Sfoglia il codice sorgente

加入普通上传

wuweihao 3 anni fa
parent
commit
59893ce7c0

+ 6 - 0
720yun_local_manage/gis_pano/src/main/java/com/gis/cms/controller/WorkController.java

@@ -80,6 +80,12 @@ public class WorkController  {
         return workService.uploadFix(file, sceneCode);
     }
 
+    @ApiOperation(value = "普通上传-文件(后端时间戳命名)", notes = "场景码:必传")
+    @PostMapping(value = "uploadFix/{sceneCode}")
+    public Result upload(@RequestParam("file") MultipartFile file, @PathVariable String sceneCode) {
+        return workService.upload(file, sceneCode);
+    }
+
 
     @ApiOperation(value = "检查作品token是否有效" , position = 3)
     @GetMapping("checkToken/{workId}")

+ 1 - 0
720yun_local_manage/gis_pano/src/main/java/com/gis/cms/service/WorkService.java

@@ -46,4 +46,5 @@ public interface WorkService extends IService<WorkEntity> {
     boolean existBySceneCode(String sceneCode);
 
 
+    Result upload(MultipartFile file, String sceneCode);
 }

+ 12 - 0
720yun_local_manage/gis_pano/src/main/java/com/gis/cms/service/impl/WorkServiceImpl.java

@@ -179,6 +179,8 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
     }
 
 
+
+
 //    @Override
 //    public WorkEntity findByIdForUpdate(String id) {
 //        // 查询数据之前先清理分页缓存
@@ -338,6 +340,7 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
         log.info("");
 
     }
+
 //
 //    @Override
 //    public Result select4dkk(PageDto param, String workId) {
@@ -402,6 +405,15 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
         return Result.success(uploadMap);
     }
 
+
+    @Override
+    public Result upload(MultipartFile file, String sceneCode) {
+        // 检查非法文件上传
+        BaseRuntimeException.isHas(!fileUtils.checkFile(file), null, "上传文件格式有误, 请重新上传");
+        Map<String, Object> uploadMap = fileUtils.uploadMap(file, "/" + sceneCode, false);
+        return Result.success(uploadMap);
+    }
+
 //    @Override
 //    public List<WorkEntity> likeSceneCode(String sceneCode) {
 //        sceneCode = "%" + sceneCode + "%";

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

@@ -74,11 +74,11 @@ public class ProduceServiceImpl implements ProducerService {
 
 
         fodderMapper.insert(entity);
-        log.info("对象保存完成: {}" + entity.getId());
+        log.info("对象保存完成: {}",  entity.getId());
 
         //发消息到mq
         rabbitTemplate.convertAndSend(RabbitConfig.PANO_EXCHANGE, RabbitConfig.PANO_QUEUE_ROUTING, sceneCode);
-        log.info("发送消息到队列完成: " + sceneCode);
+        log.info("发送消息到队列完成: {}", sceneCode);
 
         long end = System.currentTimeMillis();
         long time = (end - start) / 1000;

+ 5 - 1
README.md

@@ -1,3 +1,7 @@
 # 720yun_local
 
-720yun 资料本地化
+720yun 资料本地化
+
+# sit 
+http://project.4dage.com:8021/doc.html
+