zhanghaijun před 2 roky
rodič
revize
00a7a1add2

+ 38 - 0
train-server/src/main/java/top/haijunit/train/controller/DeviceController.java

@@ -0,0 +1,38 @@
+package top.haijunit.train.controller;
+
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import top.haijunit.common.domain.ResultData;
+
+/**
+ * @author zhang
+ * @date 2023/11/22 22:53
+ * @description 设备管理
+ */
+@RestController
+@RequestMapping("/device")
+@RequiredArgsConstructor
+public class DeviceController {
+
+    @GetMapping("/elevator")
+    public ResultData<String> elevator() {
+        return ResultData.success("");
+    }
+
+    @GetMapping("/platform/door")
+    public ResultData<String> door() {
+        return ResultData.success("");
+    }
+
+    @GetMapping("/water")
+    public ResultData<String> water() {
+        return ResultData.success("");
+    }
+
+    @GetMapping("/situation")
+    public ResultData<String> situation() {
+        return ResultData.success("");
+    }
+}

+ 8 - 0
train-server/src/main/java/top/haijunit/train/device/entity/SituationWaterEntity.java

@@ -21,6 +21,8 @@ public class SituationWaterEntity implements Serializable {
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Long id;
 
+    private Integer situationType;
+
     private Integer areaType;
 
     private String name;
@@ -28,4 +30,10 @@ public class SituationWaterEntity implements Serializable {
     private Long stationId;
 
     private Integer status;
+
+    enum situationType{
+        WATER_CRASH(1,"水灾"),
+
+        PASSENGER(2,"客流"),
+    }
 }

+ 1 - 0
train-server/src/main/resources/db/changelog/device/db-server-device.xml

@@ -136,6 +136,7 @@
                 <constraints nullable="false" primaryKey="true"/>
             </column>
             <column name="name" type="VARCHAR(128)" defaultValueNumeric="0" remarks="采样点名称"/>
+            <column name="situation_type" type="${number.type}" defaultValueNumeric="1" remarks="态势类型"/>
             <column name="area_type" type="${autoing.type}" defaultValueNumeric="0" remarks="所属区域类型"/>
             <column name="station_id" type="${autoing.type}" defaultValueNumeric="0" remarks="所属站台"/>
             <column name="status" type="${number.type}" defaultValueNumeric="1" remarks="状态"/>