|
@@ -1,10 +1,12 @@
|
|
package com.huimv.location.controller;
|
|
package com.huimv.location.controller;
|
|
|
|
|
|
|
|
+import com.huimv.location.dao.entity.BeaconEntity;
|
|
|
|
+import com.huimv.location.service.BeaconService;
|
|
import com.huimv.location.utils.HttpClient;
|
|
import com.huimv.location.utils.HttpClient;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Project : huimv.shiwan
|
|
* @Project : huimv.shiwan
|
|
@@ -16,16 +18,23 @@ import org.springframework.web.bind.annotation.RestController;
|
|
**/
|
|
**/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping(value = "/beacon")
|
|
@RequestMapping(value = "/beacon")
|
|
|
|
+@CrossOrigin
|
|
public class BeaconController {
|
|
public class BeaconController {
|
|
@Autowired
|
|
@Autowired
|
|
private HttpClient httpClient;
|
|
private HttpClient httpClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BeaconService beaconService;
|
|
|
|
|
|
|
|
+// @RequestMapping(value = "/getOneBeaconInfo",method = RequestMethod.GET)
|
|
|
|
+// public void getOneBeaconInfo(){
|
|
|
|
+// httpClient.doGet("http://192.168.1.17:44444/beacons/32b00ae08dfc");
|
|
|
|
+// }
|
|
|
|
|
|
- @RequestMapping(value = "/getOneBeaconInfo",method = RequestMethod.GET)
|
|
|
|
- public void getOneBeaconInfo(){
|
|
|
|
-
|
|
|
|
- httpClient.doGet("http://192.168.1.17:44444/beacons/32b00ae08dfc");
|
|
|
|
|
|
+ @RequestMapping(value = "/getOneBeacon",method = RequestMethod.GET)
|
|
|
|
+ public List<BeaconEntity> getOneBeaconInfo(@RequestParam(name = "id") String mac, @RequestParam(name = "startTime") String startTime, @RequestParam(name = "endTime") String endTime){
|
|
|
|
+ return beaconService.getOneBeacons(mac,startTime,endTime);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
}
|
|
}
|