|
|
@@ -0,0 +1,38 @@
|
|
|
+package com.zswl.dataservice.controller.free;
|
|
|
+
|
|
|
+import com.zswl.dataservice.model.mqtt.GateWayBindDeviceParam;
|
|
|
+import com.zswl.dataservice.service.mqtt.GateWayInfoService;
|
|
|
+import com.zswl.dataservice.utils.result.ResultContent;
|
|
|
+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.util.Assert;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 网关管理 服务
|
|
|
+ *
|
|
|
+ * @author TRX
|
|
|
+ * @date 2024/3/21
|
|
|
+ */
|
|
|
+@RequestMapping("/gateWayInfo/free")
|
|
|
+@RestController
|
|
|
+@Validated
|
|
|
+@Tag(name = "网关开发接口")
|
|
|
+public class GateWayFreeController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ GateWayInfoService gateWayInfoService;
|
|
|
+
|
|
|
+ @Operation(summary = "网关绑定设备、连接账号")
|
|
|
+ @RequestMapping(value = "gateWayBindDevice", method = {RequestMethod.POST})
|
|
|
+ public ResultContent gateWayBindDevice(@RequestBody GateWayBindDeviceParam param) {
|
|
|
+ Assert.hasText(param.getGateWayId(), "网关ID不能为空");
|
|
|
+ Assert.hasText(param.getUserName(), "连接账号不能为空");
|
|
|
+ return gateWayInfoService.gateWayBindDevice(param);
|
|
|
+ }
|
|
|
+}
|