Browse Source

Merge branch 'master' of http://192.168.0.115:3000/xiewenjie/fdkk_meta

# Conflicts:
#	src/main/java/com/fdkk/fdkkmeta/grpcService/sceneGrpcServer.java
xushiting 3 years ago
parent
commit
4f32dc745f
22 changed files with 411 additions and 92 deletions
  1. 10 39
      pom.xml
  2. 114 5
      src/main/java/com/fdkk/fdkkmeta/ctroller/DevController.java
  3. 7 4
      src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/BreakpointsEntity.java
  4. 19 4
      src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/MoveFrameEntity.java
  5. 1 1
      src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/RoomEntity.java
  6. 12 5
      src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/RotateFrameEntity.java
  7. 3 2
      src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/SceneEntity.java
  8. 5 5
      src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/UserEntity.java
  9. 14 0
      src/main/java/com/fdkk/fdkkmeta/domain/po/AnglePO.java
  10. 21 7
      src/main/java/com/fdkk/fdkkmeta/grpcService/sceneGrpcServer.java
  11. 1 1
      src/main/java/com/fdkk/fdkkmeta/service/BreakpointsService.java
  12. 1 1
      src/main/java/com/fdkk/fdkkmeta/service/MoveFrameService.java
  13. 1 1
      src/main/java/com/fdkk/fdkkmeta/service/RoomService.java
  14. 1 1
      src/main/java/com/fdkk/fdkkmeta/service/RotateFrameService.java
  15. 2 2
      src/main/java/com/fdkk/fdkkmeta/service/impl/BreakpointsServiceImpl.java
  16. 2 2
      src/main/java/com/fdkk/fdkkmeta/service/impl/MoveFrameServiceImpl.java
  17. 2 2
      src/main/java/com/fdkk/fdkkmeta/service/impl/RoomServiceImpl.java
  18. 2 2
      src/main/java/com/fdkk/fdkkmeta/service/impl/RotateFrameImpl.java
  19. 100 0
      src/main/java/com/fdkk/fdkkmeta/util/test.java
  20. 3 3
      src/main/proto/scene.proto
  21. 1 1
      src/main/resources/application-dev.yml
  22. 89 4
      src/main/resources/application-uat.yml

+ 10 - 39
pom.xml

@@ -47,11 +47,11 @@
             <artifactId>mybatis-plus-boot-starter</artifactId>
             <version>${mybatis-plus-boot-starter.version}</version>
         </dependency>
-            <dependency>
-                <groupId>com.github.tencentyun</groupId>
-                <artifactId>tls-sig-api-v2</artifactId>
-                <version>${tls.version}</version>
-            </dependency>
+        <dependency>
+            <groupId>com.github.tencentyun</groupId>
+            <artifactId>tls-sig-api-v2</artifactId>
+            <version>${tls.version}</version>
+        </dependency>
         <dependency>
             <groupId>com.corundumstudio.socketio</groupId>
             <artifactId>netty-socketio</artifactId>
@@ -124,11 +124,11 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-pool2</artifactId>
         </dependency>
-<!--        <dependency>-->
-<!--            <groupId>org.bytedeco</groupId>-->
-<!--            <artifactId>javacv-platform</artifactId>-->
-<!--            <version>1.5.7</version>-->
-<!--        </dependency>-->
+        <!--        <dependency>-->
+        <!--            <groupId>org.bytedeco</groupId>-->
+        <!--            <artifactId>javacv-platform</artifactId>-->
+        <!--            <version>1.5.7</version>-->
+        <!--        </dependency>-->
         <!--redis连接池 end-->
         <dependency>
             <groupId>net.devh</groupId>
@@ -165,35 +165,6 @@
             <artifactId>protobuf-java-format</artifactId>
             <version>1.4</version>
         </dependency>
-        
-        <!--集成grpc-->
-        <dependency>
-            <groupId>com.google.protobuf</groupId>
-            <artifactId>protobuf-java</artifactId>
-            <version>3.17.3</version>
-        </dependency>
-        <dependency>
-            <groupId>io.grpc</groupId>
-            <artifactId>grpc-netty-shaded</artifactId>
-            <version>1.41.0</version>
-        </dependency>
-        <dependency>
-            <groupId>io.grpc</groupId>
-            <artifactId>grpc-protobuf</artifactId>
-            <version>1.41.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>io.grpc</groupId>
-            <artifactId>grpc-stub</artifactId>
-            <version>1.41.0</version>
-        </dependency>
-        <dependency> <!-- necessary for Java 9+ -->
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>annotations-api</artifactId>
-            <version>6.0.53</version>
-            <scope>provided</scope>
-        </dependency>
     </dependencies>
 
 

+ 114 - 5
src/main/java/com/fdkk/fdkkmeta/ctroller/DevController.java

@@ -5,9 +5,20 @@ package com.fdkk.fdkkmeta.ctroller;
  * @date 2021/12/29
  */
 
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.fdkk.fdkkmeta.domain.entity.mysql.BreakpointsEntity;
+import com.fdkk.fdkkmeta.domain.entity.mysql.MoveFrameEntity;
 import com.fdkk.fdkkmeta.domain.entity.mysql.RoomEntity;
+import com.fdkk.fdkkmeta.domain.entity.mysql.RotateFrameEntity;
+import com.fdkk.fdkkmeta.domain.po.AnglePO;
+import com.fdkk.fdkkmeta.domain.po.PointPO;
+import com.fdkk.fdkkmeta.service.BreakpointsService;
+import com.fdkk.fdkkmeta.service.MoveFrameService;
 import com.fdkk.fdkkmeta.service.RoomService;
+import com.fdkk.fdkkmeta.service.RotateFrameService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -16,7 +27,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.awt.geom.AffineTransform;
+import java.io.File;
 import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -27,6 +41,12 @@ import java.util.Map;
 public class DevController   {
     @Autowired
     RoomService roomService;
+    @Autowired
+    BreakpointsService breakpointsService;
+    @Autowired
+    RotateFrameService rotateFrameService;
+    @Autowired
+    MoveFrameService moveFrameService;
 
     /**
      * test
@@ -35,10 +55,99 @@ public class DevController   {
      */
     @PostMapping("/test")
     public String test() {
-        RoomEntity a=new RoomEntity();
-        a.setSceneId("1");
-        roomService.save(a);
-        List<RoomEntity> bySceneId = roomService.findBySceneId("1");
-        return bySceneId.toString();
+
+
+        String path="/home/webrtc/creatJson/outputjson/";
+
+        if (FileUtil.exist(path.replaceAll("outputjson",""))){
+            String s = FileUtil.readString(path.replaceAll("outputjson","") + "points.json", "utf8");
+            JSONArray points= JSON.parseArray(s);
+            for (Object point : points) {
+                JSONObject a = JSON.parseObject(JSONObject.toJSON(point).toString());
+                BreakpointsEntity breakpointsEntity=new BreakpointsEntity();
+                breakpointsEntity.setAppId("0000000001");
+                PointPO po=new PointPO();
+                po.setX(a.getJSONObject("position").getDoubleValue("x"));
+                po.setY(a.getJSONObject("position").getDoubleValue("y"));
+                po.setZ(a.getJSONObject("position").getDoubleValue("z"));
+                breakpointsEntity.setPosition(po);
+                breakpointsEntity.setBreakPointId(a.getString("id"));
+                breakpointsService.save(breakpointsEntity);
+            }
+        }
+
+        File[] ls = FileUtil.ls(path);
+        for (File l : ls) {
+            List<File> files = FileUtil.loopFiles(l);
+            for (File file : files) {
+                if (!file.getName().contains("_")){
+                    String s = FileUtil.readString(file, "utf8");
+                    JSONArray rotate= JSON.parseArray(s);
+                    List<RotateFrameEntity> rotateFrameEntityList = new ArrayList<>();
+                    for (int i = 0; i < rotate.size(); i++) {
+                        if (i!=360){
+                        DecimalFormat decimalFormat = new DecimalFormat("0000");
+                        String numFormat= decimalFormat .format(i);
+                        JSONObject a = JSON.parseObject(JSONObject.toJSON(rotate.get(i)).toString());
+                        RotateFrameEntity rotateFrameEntity=new RotateFrameEntity();
+                        rotateFrameEntity.setFrameIndex(a.getInteger("frame"));
+                        rotateFrameEntity.setFileName(l.getName()+"."+numFormat+".h264");
+                        rotateFrameEntity.setDirectory(l.getName());
+                        AnglePO anglePO=new AnglePO();
+                        anglePO.setPitch(a.getJSONObject("angle").getDoubleValue("pitch"));
+                        anglePO.setRoll(a.getJSONObject("angle").getDoubleValue("roll"));
+                        anglePO.setYaw(a.getJSONObject("angle").getDoubleValue("yaw"));
+                        rotateFrameEntity.setCameraAngle(anglePO);
+                        PointPO po=new PointPO();
+                        po.setX(a.getJSONObject("position").getDoubleValue("x"));
+                        po.setY(a.getJSONObject("position").getDoubleValue("y"));
+                        po.setZ(a.getJSONObject("position").getDoubleValue("z"));
+                        rotateFrameEntity.setCameraPosition(po);
+                        rotateFrameEntity.setBreakPointId(l.getName());
+                        rotateFrameEntity.setAppId("0000000001");
+                        rotateFrameEntityList.add(rotateFrameEntity);
+                        }
+                    }
+                    boolean b = rotateFrameService.saveBatch(rotateFrameEntityList);
+                    System.out.println("saverotateFrameEntityList-"+b );
+
+                }else {
+                    String s = FileUtil.readString(file, "utf8");
+                    JSONArray moveFrame= JSON.parseArray(s);
+                    List<MoveFrameEntity> moveFrameEntityList=new ArrayList<>();
+                    for (int i = 0; i < moveFrame.size(); i++) {
+                        DecimalFormat decimalFormat = new DecimalFormat("0000");
+                        String numFormat= decimalFormat .format(i);
+                        JSONObject a = JSON.parseObject(JSONObject.toJSON(moveFrame.get(i)).toString());
+                        MoveFrameEntity moveFrameEntity=new MoveFrameEntity();
+                        AnglePO anglePO=new AnglePO();
+                        anglePO.setPitch(a.getJSONObject("angle").getDoubleValue("pitch"));
+                        anglePO.setRoll(a.getJSONObject("angle").getDoubleValue("roll"));
+                        anglePO.setYaw(a.getJSONObject("angle").getDoubleValue("yaw"));
+                        moveFrameEntity.setCameraAngle(anglePO);
+                        PointPO po=new PointPO();
+                        po.setX(a.getJSONObject("position").getDoubleValue("x"));
+                        po.setY(a.getJSONObject("position").getDoubleValue("y"));
+                        po.setZ(a.getJSONObject("position").getDoubleValue("z"));
+                        moveFrameEntity.setCameraPosition(po);
+                        String name = file.getName().replace(".json", "");
+                        String[] s1 = name.split("_");
+                        moveFrameEntity.setStartBreakPointId(Integer.parseInt(s1[0]));
+                        moveFrameEntity.setEndBreakPointId(Integer.parseInt(s1[1]));
+                        moveFrameEntity.setAngle(Integer.parseInt(s1[2]));
+                        moveFrameEntity.setFrameIndex(a.getInteger("frame"));
+                        moveFrameEntity.setDirectory(file.getName().replace(".json",""));
+                        System.out.println(JSON.toJSONString(moveFrameEntity));
+                        moveFrameEntity.setAppId("0000000001");
+                        moveFrameEntity.setFileName(file.getName().replace(".json","")+"."+numFormat+".h264");
+                        moveFrameEntityList.add(moveFrameEntity);
+                    }
+                    boolean b = moveFrameService.saveBatch(moveFrameEntityList);
+                    System.out.println("savemoveFrameEntityList-"+b );
+                }
+            }
+            System.out.println(FileUtil.isFile(l));
+        }
+        return "";
     }
 }

+ 7 - 4
src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/BreakpointsEntity.java

@@ -1,7 +1,10 @@
 package com.fdkk.fdkkmeta.domain.entity.mysql;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import com.fdkk.fdkkmeta.base.BaseEntity;
+import com.fdkk.fdkkmeta.domain.po.PointPO;
 import lombok.Data;
 
 /**
@@ -11,8 +14,8 @@ import lombok.Data;
 @Data
 @TableName("breakpoints")
 public class BreakpointsEntity extends BaseEntity {
-    private String sceneId;
-    private String pointId;
-    private String position;
-
+    @TableField(value = "position", typeHandler = JacksonTypeHandler.class)
+    private PointPO position;
+    private String breakPointId;
+    private String appId;
 }

+ 19 - 4
src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/MoveFrameEntity.java

@@ -1,23 +1,38 @@
 package com.fdkk.fdkkmeta.domain.entity.mysql;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import com.fdkk.fdkkmeta.base.BaseEntity;
+import com.fdkk.fdkkmeta.domain.po.AnglePO;
+import com.fdkk.fdkkmeta.domain.po.PointPO;
 import lombok.Data;
 
+import java.io.Serializable;
+import java.util.List;
+
 /**
  * @author Xiewj
  * @date 2022/5/9
  */
 @Data
-@TableName("moveframe")
+@TableName(value = "moveframe",autoResultMap = true)
 public class MoveFrameEntity extends BaseEntity {
-    private String frameId;
     private Integer frameIndex;
     private String directory;
     private String fileName;
     private Integer startBreakPointId;
     private Integer endBreakPointId;
-    private String angle;
-    private String sceneId;
+
+    @TableField(value = "camera_position", typeHandler = JacksonTypeHandler.class)
+    private PointPO cameraPosition;
+
+    @TableField(value = "camera_angle", typeHandler = JacksonTypeHandler.class)
+    private AnglePO cameraAngle;
+
+    @TableField(value = "angle", typeHandler = JacksonTypeHandler.class)
+    private Integer angle;
+
+    private String appId;
 
 }

+ 1 - 1
src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/RoomEntity.java

@@ -12,5 +12,5 @@ import lombok.Data;
 @TableName("room")
 public class RoomEntity extends BaseEntity {
     private String roomId;
-    private String sceneId;
+    private String appId;
 }

+ 12 - 5
src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/RotateFrameEntity.java

@@ -1,7 +1,11 @@
 package com.fdkk.fdkkmeta.domain.entity.mysql;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import com.fdkk.fdkkmeta.base.BaseEntity;
+import com.fdkk.fdkkmeta.domain.po.AnglePO;
+import com.fdkk.fdkkmeta.domain.po.PointPO;
 import lombok.Data;
 
 /**
@@ -11,12 +15,15 @@ import lombok.Data;
 @Data
 @TableName("rotateframe")
 public class RotateFrameEntity extends BaseEntity {
-    private String frameId;
-    private String frameIndex;
-    private String sceneId;
+    private Integer frameIndex;
     private String directory;
     private String fileName;
-    private String cameraPosition;
-    private String cameraAngle;
     private String breakPointId;
+    private String appId;
+    @TableField(value = "camera_position", typeHandler = JacksonTypeHandler.class)
+    private PointPO cameraPosition;
+
+    @TableField(value = "camera_angle", typeHandler = JacksonTypeHandler.class)
+    private AnglePO cameraAngle;
+
 }

+ 3 - 2
src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/SceneEntity.java

@@ -11,7 +11,8 @@ import lombok.Data;
 @Data
 @TableName("scene")
 public class SceneEntity extends BaseEntity {
-    private String sceneId;
-    private String low_model_src;
+    private String AppId;
+    private String appId;
+    private String lowModelSrc;
     private String name;
 }

+ 5 - 5
src/main/java/com/fdkk/fdkkmeta/domain/entity/mysql/UserEntity.java

@@ -11,14 +11,14 @@ import lombok.Data;
 @Data
 @TableName("user")
 public class UserEntity extends BaseEntity {
-    private String nick_name;
+    private String nickName;
     private String skinId;
     private String avatarId;
-    private String onlineTime;
-    private String offlineTime;
+    private String roomId;
+    private String appId;
+    private String frameId;
     private String breakPointId;
+    private String offlineTime;
     private String playerAngle;
-    private String sceneId;
     private String sessionId;
-    private String frameId;
 }

+ 14 - 0
src/main/java/com/fdkk/fdkkmeta/domain/po/AnglePO.java

@@ -0,0 +1,14 @@
+package com.fdkk.fdkkmeta.domain.po;
+
+import lombok.Data;
+
+/**
+ * @author Xiewj
+ * @date 2022/5/11
+ */
+@Data
+public class AnglePO {
+    private Double pitch;
+    private Double roll;
+    private Double yaw;
+}

+ 21 - 7
src/main/java/com/fdkk/fdkkmeta/grpcService/sceneGrpcServer.java

@@ -30,7 +30,11 @@ import java.io.IOException;
 public class sceneGrpcServer extends SceneGrpcServiceGrpc.SceneGrpcServiceImplBase {
     @Autowired
     MetaConfig metaConfig;
-    /*
+    /***
+     *     回复 案例
+     *    SceneReply res = SceneReply.newBuilder().setRes(id+","+name).build();
+     *         responseObserver.onNext(res);
+     */
     @Override
     public void testMethod(SceneRequest request, StreamObserver<SceneReply> responseObserver) {
         // grpc服务端获取调用端请求参数
@@ -75,7 +79,7 @@ public class sceneGrpcServer extends SceneGrpcServiceGrpc.SceneGrpcServiceImplBa
         responseObserver.onNext(builder.build());
         responseObserver.onCompleted();
     }
-    
+
     @Override
     public void init(InitRequest request, StreamObserver<NormalReply> responseObserver)   {
     	try {
@@ -135,7 +139,8 @@ public class sceneGrpcServer extends SceneGrpcServiceGrpc.SceneGrpcServiceImplBa
     		e.printStackTrace();
     	}
     }
-    
+
+
     @Override
     public void moveStart(StartMoveRequest request, StreamObserver<NormalReply> responseObserver)   {
      	try {
@@ -151,7 +156,7 @@ public class sceneGrpcServer extends SceneGrpcServiceGrpc.SceneGrpcServiceImplBa
     		e.printStackTrace();
     	}
     }
-    
+
     @Override
     public void moveProcess(MoveNextNeighborRequest request, StreamObserver<MoveReply> responseObserver)   {
      	try {
@@ -171,18 +176,27 @@ public class sceneGrpcServer extends SceneGrpcServiceGrpc.SceneGrpcServiceImplBa
     @Override
     public void getBreakPoint(BreakPointRequest request, StreamObserver<BreakPointReply> responseObserver)   {
      	try {
-        	
+            log.info("进入{}",request);
+
+
+//            responseObserver.onNext(res);
+//            responseObserver.onCompleted();
+//            log.info("回复{}",res);
     	}
     	catch(Exception e) {
     		e.printStackTrace();
     	}
     }
-    
+
     //操作杆
     @Override
     public void joystick(JoystickRequest request, StreamObserver<NormalReply> responseObserver)   {
      	try {
-        	
+            log.info("进入{}",request);
+
+//            responseObserver.onNext(res);
+//            responseObserver.onCompleted();
+//            log.info("回复{}",res);
     	}
     	catch(Exception e) {
     		e.printStackTrace();

+ 1 - 1
src/main/java/com/fdkk/fdkkmeta/service/BreakpointsService.java

@@ -9,5 +9,5 @@ import java.util.List;
  * Created by Xiewj on 2021/11/23 0026 10:14
  */
 public interface BreakpointsService extends IBaseService<BreakpointsEntity> {
-    List<BreakpointsEntity>     findBySceneId(String sceneId);
+    List<BreakpointsEntity>     findByAppId(String AppId);
 }

+ 1 - 1
src/main/java/com/fdkk/fdkkmeta/service/MoveFrameService.java

@@ -9,5 +9,5 @@ import java.util.List;
  * Created by Xiewj on 2021/11/23 0026 10:14
  */
 public interface MoveFrameService extends IBaseService<MoveFrameEntity> {
-    List<MoveFrameEntity> findBySceneId(String sceneId);
+    List<MoveFrameEntity> findByAppId(String AppId);
 }

+ 1 - 1
src/main/java/com/fdkk/fdkkmeta/service/RoomService.java

@@ -10,7 +10,7 @@ import java.util.List;
  * Created by Xiewj on 2021/11/23 0026 10:14
  */
 public interface RoomService extends IBaseService<RoomEntity> {
-    List<RoomEntity> findBySceneId(String sceneId);
+    List<RoomEntity> findByAppId(String AppId);
     List<RoomEntity> findByRoomId(String roomId);
 
 }

+ 1 - 1
src/main/java/com/fdkk/fdkkmeta/service/RotateFrameService.java

@@ -11,6 +11,6 @@ import java.util.List;
  * Created by Xiewj on 2021/11/23 0026 10:14
  */
 public interface RotateFrameService extends IBaseService<RotateFrameEntity> {
-    List<RotateFrameEntity> findBySceneId(String sceneId);
+    List<RotateFrameEntity> findByAppId(String AppId);
     JSONObject getInitFrameInfo(String app_id);
 }

+ 2 - 2
src/main/java/com/fdkk/fdkkmeta/service/impl/BreakpointsServiceImpl.java

@@ -19,9 +19,9 @@ import java.util.List;
 @Service
 public class BreakpointsServiceImpl extends BaseServiceImpl<BreakpointsMapper, BreakpointsEntity> implements BreakpointsService {
     @Override
-    public List<BreakpointsEntity> findBySceneId(String sceneId) {
+    public List<BreakpointsEntity> findByAppId(String AppId) {
         LambdaQueryWrapper<BreakpointsEntity> wrapper = Wrappers.lambdaQuery();
-        wrapper.eq(BreakpointsEntity::getSceneId, sceneId);
+        wrapper.eq(BreakpointsEntity::getAppId, AppId);
         return list(wrapper);
     }
 }

+ 2 - 2
src/main/java/com/fdkk/fdkkmeta/service/impl/MoveFrameServiceImpl.java

@@ -19,9 +19,9 @@ import java.util.List;
 @Service
 public class MoveFrameServiceImpl extends BaseServiceImpl<MoveFramesMapper, MoveFrameEntity> implements MoveFrameService {
     @Override
-    public List<MoveFrameEntity> findBySceneId(String sceneId) {
+    public List<MoveFrameEntity> findByAppId(String AppId) {
         LambdaQueryWrapper<MoveFrameEntity> wrapper = Wrappers.lambdaQuery();
-        wrapper.eq(MoveFrameEntity::getSceneId, sceneId);
+        wrapper.eq(MoveFrameEntity::getAppId, AppId);
         return list(wrapper);
     }
 }

+ 2 - 2
src/main/java/com/fdkk/fdkkmeta/service/impl/RoomServiceImpl.java

@@ -19,9 +19,9 @@ import java.util.List;
 @Service
 public class RoomServiceImpl extends BaseServiceImpl<RoomMapper, RoomEntity> implements RoomService {
     @Override
-    public List<RoomEntity> findBySceneId(String sceneId) {
+    public List<RoomEntity> findByAppId(String AppId) {
         LambdaQueryWrapper<RoomEntity> wrapper = Wrappers.lambdaQuery();
-        wrapper.eq(RoomEntity::getSceneId, sceneId);
+        wrapper.eq(RoomEntity::getAppId, AppId);
         return list(wrapper);
     }
 

+ 2 - 2
src/main/java/com/fdkk/fdkkmeta/service/impl/RotateFrameImpl.java

@@ -20,9 +20,9 @@ import java.util.List;
 @Service
 public class RotateFrameImpl extends BaseServiceImpl<RotateFrameMapper, RotateFrameEntity> implements RotateFrameService {
     @Override
-    public List<RotateFrameEntity> findBySceneId(String sceneId) {
+    public List<RotateFrameEntity> findByAppId(String AppId) {
         LambdaQueryWrapper<RotateFrameEntity> wrapper = Wrappers.lambdaQuery();
-        wrapper.eq(RotateFrameEntity::getSceneId, sceneId);
+        wrapper.eq(RotateFrameEntity::getAppId, AppId);
         return list(wrapper);
     }
     

+ 100 - 0
src/main/java/com/fdkk/fdkkmeta/util/test.java

@@ -0,0 +1,100 @@
+package com.fdkk.fdkkmeta.util;
+
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkk.fdkkmeta.domain.entity.mysql.BreakpointsEntity;
+import com.fdkk.fdkkmeta.domain.entity.mysql.MoveFrameEntity;
+import com.fdkk.fdkkmeta.domain.entity.mysql.RotateFrameEntity;
+import com.fdkk.fdkkmeta.domain.po.AnglePO;
+import com.fdkk.fdkkmeta.domain.po.PointPO;
+
+import java.awt.*;
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author Xiewj
+ * @date 2022/5/11
+ */
+public class test {
+    public static void main(String[] args) {
+        String path="H:\\workfile\\100-150点json数据\\100-150点json数据\\outputjson\\";
+
+        if (FileUtil.exist(path.replaceAll("outputjson",""))){
+            String s = FileUtil.readString(path.replaceAll("outputjson","") + "points.json", "utf8");
+            JSONArray points= JSON.parseArray(s);
+            for (Object point : points) {
+                JSONObject a = JSON.parseObject(JSONObject.toJSON(point).toString());
+                BreakpointsEntity breakpointsEntity=new BreakpointsEntity();
+                breakpointsEntity.setAppId("0000000001");
+                PointPO po=new PointPO();
+                po.setX(a.getJSONObject("position").getDoubleValue("x"));
+                po.setY(a.getJSONObject("position").getDoubleValue("y"));
+                po.setZ(a.getJSONObject("position").getDoubleValue("z"));
+                breakpointsEntity.setPosition(po);
+                breakpointsEntity.setBreakPointId(a.getString("id"));
+            }
+        }
+
+        File[] ls = FileUtil.ls(path);
+        for (File l : ls) {
+            List<File> files = FileUtil.loopFiles(l);
+            for (File file : files) {
+                if (!file.getName().contains("_")){
+                    String s = FileUtil.readString(file, "utf8");
+                    JSONArray rotate= JSON.parseArray(s);
+                    for (Object o : rotate) {
+                        JSONObject a = JSON.parseObject(JSONObject.toJSON(o).toString());
+                        RotateFrameEntity rotateFrameEntity=new RotateFrameEntity();
+                        rotateFrameEntity.setFrameIndex(a.getInteger("frame"));
+                        rotateFrameEntity.setFileName(l.getName()+".h64");
+                        rotateFrameEntity.setDirectory(l.getName());
+                        AnglePO anglePO=new AnglePO();
+                        anglePO.setPitch(a.getJSONObject("angle").getDoubleValue("pitch"));
+                        anglePO.setRoll(a.getJSONObject("angle").getDoubleValue("roll"));
+                        anglePO.setYaw(a.getJSONObject("angle").getDoubleValue("yaw"));
+                        rotateFrameEntity.setCameraAngle(anglePO);
+                        PointPO po=new PointPO();
+                        po.setX(a.getJSONObject("position").getDoubleValue("x"));
+                        po.setY(a.getJSONObject("position").getDoubleValue("y"));
+                        po.setZ(a.getJSONObject("position").getDoubleValue("z"));
+                        rotateFrameEntity.setCameraPosition(po);
+                        rotateFrameEntity.setBreakPointId(l.getName());
+                        System.out.println(JSON.toJSONString(rotateFrameEntity));
+
+                    }
+
+                }else {
+                    String s = FileUtil.readString(file, "utf8");
+                    JSONArray moveFrame= JSON.parseArray(s);
+                    for (Object o : moveFrame) {
+                        JSONObject a = JSON.parseObject(JSONObject.toJSON(o).toString());
+                        MoveFrameEntity moveFrameEntity=new MoveFrameEntity();
+                        AnglePO anglePO=new AnglePO();
+                        anglePO.setPitch(a.getJSONObject("angle").getDoubleValue("pitch"));
+                        anglePO.setRoll(a.getJSONObject("angle").getDoubleValue("roll"));
+                        anglePO.setYaw(a.getJSONObject("angle").getDoubleValue("yaw"));
+                        moveFrameEntity.setCameraAngle(anglePO);
+                        PointPO po=new PointPO();
+                        po.setX(a.getJSONObject("position").getDoubleValue("x"));
+                        po.setY(a.getJSONObject("position").getDoubleValue("y"));
+                        po.setZ(a.getJSONObject("position").getDoubleValue("z"));
+                        moveFrameEntity.setCameraPosition(po);
+                        String name = file.getName().replace(".json", "");
+                        String[] s1 = name.split("_");
+                        moveFrameEntity.setStartBreakPointId(Integer.parseInt(s1[0]));
+                        moveFrameEntity.setEndBreakPointId(Integer.parseInt(s1[1]));
+                        moveFrameEntity.setAngle(Integer.parseInt(s1[2]));
+                        moveFrameEntity.setFrameIndex(a.getInteger("frame"));
+                        moveFrameEntity.setDirectory(l.getName());
+                        System.out.println(JSON.toJSONString(moveFrameEntity));
+                    }
+
+                }
+            }
+            System.out.println(FileUtil.isFile(l));
+        }
+    }
+}

+ 3 - 3
src/main/proto/scene.proto

@@ -17,7 +17,7 @@ service SceneGrpcService {
 }
 // 全局对象
 message Point {
-  string x=1;     //应该换成double
+  string x=1;
   string y=2;
   string z=3;
 }
@@ -132,7 +132,7 @@ message InitRequest {
 
 /**********************************************************/
 //全局对象,旋转的参数
-message rotation_action{
+message RotationAction{
   int32 vertical_move=1;
   double horizontal_move=2;
 }
@@ -140,7 +140,7 @@ message rotation_action{
 // rotate入参对象
 message RotateRequest {
   int32 action_type=1;
-  string rotation_action=2;
+  RotationAction rotation_action=2;
   string trace_id=3;
   string user_id=4;
 }

+ 1 - 1
src/main/resources/application-dev.yml

@@ -38,7 +38,7 @@ spring:
     druid:
       # 主库数据源
       master:
-        url: jdbc:mysql://120.24.252.95:13306/fdkk_meta?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://120.24.252.95:3306/fdkk_meta?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         username: root
         password: 4dyjkz%
       # 从库数据源

+ 89 - 4
src/main/resources/application-uat.yml

@@ -9,10 +9,10 @@ socketio:
   port: 9099
   upgradeTimeout: 1000000
   workCount: 100
-trtc:
-  rtmpHost: "rtmp://rtmp.rtc.qq.com/push/"
+fdkk:
+  freespacePath: H:\workfile
 server:
-  port: 9010
+  port: 9011
   servlet:
     context-path: /
   tomcat:
@@ -24,7 +24,7 @@ spring:
     host: 127.0.0.1
     port: 6379
     database: 4
-    password: sxz123321SxZ@
+    password: 1234
     timeout: 60s
     lettuce:
       pool:
@@ -32,3 +32,88 @@ spring:
         max-idle: 8
         max-active: 8
         max-wait: 10000
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 主库数据源
+      master:
+        url: jdbc:mysql://127.0.0.1:3306/fdkk_meta?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: 4dyjkz%
+      # 从库数据源
+      slave:
+        # 从数据源开关/默认关闭
+        enabled: false
+        url:
+        username:
+        password:
+      # 初始连接数
+      initialSize: 5
+      # 最小连接池数量
+      minIdle: 10
+      # 最大连接池数量
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      # 配置一个连接在池中最大生存的时间,单位是毫秒
+      maxEvictableIdleTimeMillis: 900000
+      # 配置检测连接是否有效
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 设置白名单,不填则允许所有访问
+        allow:
+        url-pattern: /druid/*
+        # 控制台管理用户名和密码
+        login-username: fdkk
+        login-password: 123456
+      filter:
+        stat:
+          enabled: true
+          # 慢SQL记录
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+# MyBatis配置
+mybatis-plus:
+  configuration:
+    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+    call-setters-on-nulls: true
+    jdbc-type-for-null: 'null'
+  global-config:
+    db-config:
+      db-type: mysql
+      field-strategy: not_null
+      id-type: auto
+      logic-delete-value: 1 # 逻辑已删除值(默认为 1)
+      logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
+      table-underline: true
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  typeAliasesPackage: com.fdkk.**.domain
+# PageHelper分页插件
+pagehelper:
+  helperDialect: mysql
+  supportMethodsArguments: true
+  params: count=countSql
+  page-size-zero: true
+grpc:
+  # grpc server相关配置
+  server:
+    # 启动端口
+    port: 3000
+    address: 0.0.0.0