hasan 2 years ago
parent
commit
809949a68d

+ 14 - 4
src/main/java/com/szls/nstths/controller/DataController.java

@@ -5,9 +5,7 @@ import com.szls.nstths.service.TeDataService;
5 5
 import org.slf4j.Logger;
6 6
 import org.slf4j.LoggerFactory;
7 7
 import org.springframework.beans.factory.annotation.Autowired;
8
-import org.springframework.web.bind.annotation.PostMapping;
9
-import org.springframework.web.bind.annotation.RequestBody;
10
-import org.springframework.web.bind.annotation.RestController;
8
+import org.springframework.web.bind.annotation.*;
11 9
 
12 10
 
13 11
 @RestController
@@ -23,7 +21,8 @@ public class DataController {
23 21
     }
24 22
 
25 23
     /**
26
-     * 检测数据
24
+     * 检测后数据
25
+     *
27 26
      * @param teData
28 27
      * @return
29 28
      */
@@ -37,5 +36,16 @@ public class DataController {
37 36
         return "success";
38 37
     }
39 38
 
39
+    /**
40
+     *
41
+     * @param height
42
+     * @param radius
43
+     */
44
+    @GetMapping("/scanning")
45
+    public void scanning(@RequestParam(value = "height", defaultValue = "12") String height,
46
+                         @RequestParam(value = "radius", defaultValue = "12") String radius) {
40 47
 
48
+        logger.info("{},{}",height,radius);
49
+        teDataService.scanTask();
50
+    }
41 51
 }

+ 2 - 1
src/main/java/com/szls/nstths/controller/UserController.java

@@ -2,6 +2,7 @@ package com.szls.nstths.controller;
2 2
 
3 3
 
4 4
 import com.szls.nstths.mapper.UserMapper;
5
+import com.szls.nstths.service.TeDataService;
5 6
 import org.slf4j.Logger;
6 7
 import org.slf4j.LoggerFactory;
7 8
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,7 +18,6 @@ public class UserController {
17 18
     private static final Logger logger = LoggerFactory.getLogger(UserController.class);
18 19
 
19 20
     private UserMapper userMapper;
20
-
21 21
     @Autowired
22 22
     public void setUserMapper(UserMapper userMapper) {
23 23
         this.userMapper = userMapper;
@@ -30,4 +30,5 @@ public class UserController {
30 30
 
31 31
         return String.format("Hello %s!", name);
32 32
     }
33
+
33 34
 }