|
@@ -0,0 +1,30 @@
|
|
|
|
+package vip.xiaonuo.coldchain.modular.app.controller;
|
|
|
|
+
|
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+import vip.xiaonuo.coldchain.core.bean.influxdb.SensorData;
|
|
|
|
+import vip.xiaonuo.coldchain.modular.app.service.SimsService;
|
|
|
|
+import vip.xiaonuo.common.pojo.CommonResult;
|
|
|
|
+
|
|
|
|
+@Tag(name = "APP移动端控制器")
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/coldchain/api/sims/{deviceCode}")
|
|
|
|
+@Validated
|
|
|
|
+public class SimsController {
|
|
|
|
+ @Autowired
|
|
|
|
+ private SimsService simsService;
|
|
|
|
+
|
|
|
|
+ @Operation(summary = "获取设备的最新的温湿度")
|
|
|
|
+ @GetMapping("/{roads}")
|
|
|
|
+ public CommonResult<SensorData> status(@PathVariable String deviceCode, @PathVariable Integer roads) {
|
|
|
|
+ return CommonResult.data(simsService.status(deviceCode,roads));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|