Explorar el Código

删除停靠点

shiwn hace 3 meses
padre
commit
b5ffca966d

+ 11 - 0
src/main/java/com/sw/patroleditor/controller/LocationController.java

@@ -46,6 +46,17 @@ public class LocationController {
         }
     }
 
+    @ApiOperation(value = "删除停靠点")
+    @PostMapping("/deletePoint")
+    public ResultData deletePoint(@RequestBody Integer pointId) {
+        int flag = locationService.deletePoint(pointId);
+        if (flag > 0) {
+            return ResultData.success();
+        } else {
+            return ResultData.fail(ErrorCode.FAIL);
+        }
+    }
+
     @ApiOperation(value = "删除巡检点")
     @PostMapping("/deleteTarget")
     public ResultData deleteTarget(@RequestBody Long targetId) {

+ 2 - 0
src/main/java/com/sw/patroleditor/service/LocationService.java

@@ -11,5 +11,7 @@ public interface LocationService {
 
     int saveTarget(TargetVO vo);
 
+    int deletePoint(Integer pointId);
+
     int deleteTarget(Long targetId);
 }

+ 12 - 0
src/main/java/com/sw/patroleditor/service/impl/LocationServiceImpl.java

@@ -118,6 +118,18 @@ public class LocationServiceImpl implements LocationService {
     }
 
     /**
+     * @Description: 删除停靠点
+     * @Date: 2024/8/9 17:14
+     * @Author: shiwn
+     * @Param: pointId:
+     * @Return:
+     */
+    @Override
+    public int deletePoint(Integer pointId) {
+        return pointMapper.deleteById(pointId);
+    }
+
+    /**
      * @Description: 删除巡检点
      * @Date: 2024/8/9 17:09
      * @Author: shiwn