|
@@ -0,0 +1,37 @@
|
|
|
+package com.bz.zoneiot.water.web.controller;
|
|
|
+
|
|
|
+import com.bz.zoneiot.core.common.pojo.AjaxMessage;
|
|
|
+import com.bz.zoneiot.water.api.enums.WaterErrorEnum;
|
|
|
+import com.bz.zoneiot.water.web.service.impl.DeviceAttributeService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+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.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author Andy
|
|
|
+ * @version V1.0
|
|
|
+ * @description: TODO
|
|
|
+ * @date 2021/10/28
|
|
|
+ **/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/attributes")
|
|
|
+@Api(tags = "属性管理")
|
|
|
+public class AttributesController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DeviceAttributeService deviceAttributeService;
|
|
|
+
|
|
|
+ @RequestMapping(value = "selectAttributes", method = RequestMethod.GET)
|
|
|
+ @ApiOperation(value = "根据设备id查询属性信息")
|
|
|
+ public AjaxMessage selectAttributes(@ApiParam(value = "设备id", required = true)@RequestParam Integer deviceId) {
|
|
|
+ if (deviceId == null) {
|
|
|
+ return AjaxMessage.fail(WaterErrorEnum.PARAM_ERROR);
|
|
|
+ }
|
|
|
+ return AjaxMessage.success(deviceAttributeService.selectAttributes(deviceId));
|
|
|
+ }
|
|
|
+}
|