Bladeren bron

保存机器人ros传输数据

shiwn 3 maanden geleden
bovenliggende
commit
d41ca7a3be

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

@@ -0,0 +1,29 @@
+package com.sw.patroleditor.controller;
+
+import com.sw.patroleditor.common.ResultData;
+import com.sw.patroleditor.service.LocationService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * Created by shiwn on 2024/7/26 15:07
+ */
+@Api(tags = {"标点接口"})
+@RestController
+
+@RequestMapping("location")
+public class LocationController {
+    @Resource
+    private LocationService locationService;
+
+    @ApiOperation(value = "保存点位")
+    @PostMapping("/save")
+    public ResultData save() {
+        return ResultData.success(locationService.save());
+    }
+}

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

@@ -0,0 +1,8 @@
+package com.sw.patroleditor.service;
+
+/**
+ * Created by shiwn on 2024/7/26 15:07
+ */
+public interface LocationService {
+    int save();
+}

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

@@ -0,0 +1,28 @@
+package com.sw.patroleditor.service.impl;
+
+import com.sw.patroleditor.component.rosBridge.RobotDataCallBack;
+import com.sw.patroleditor.component.rosBridge.RobotDataModel;
+import com.sw.patroleditor.service.LocationService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * Created by shiwn on 2024/7/26 15:08
+ */
+@Service
+public class LocationServiceImpl implements LocationService {
+    @Resource
+    private RobotDataCallBack robotDataCallBack;
+
+    /**
+     * @Description: 保存点位
+     * @Date: 2024/7/26 15:09
+     * @Author: shiwn
+     */
+    @Override
+    public int save() {
+        RobotDataModel robotDataModel = robotDataCallBack.getRobotDataModel();
+        return 1;
+    }
+}