|
@@ -2,13 +2,14 @@ package com.usky.iot.controller.web;
|
|
|
|
|
|
|
|
|
import com.usky.common.core.bean.ApiResult;
|
|
|
+import com.usky.iot.domain.VcDeviceGroup;
|
|
|
import com.usky.iot.service.VcDeviceGroupService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -30,7 +31,7 @@ public class VcDeviceGroupController {
|
|
|
* @param groupName 站点分组名称
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping("vcDeviceGroupAdd")
|
|
|
+ @GetMapping("vcDeviceGroupAdd")
|
|
|
public ApiResult<Void> vcDeviceGroupAdd(@RequestParam String groupName) {
|
|
|
vcDeviceGroupService.vcDeviceGroupAdd(groupName);
|
|
|
return ApiResult.success();
|
|
@@ -43,10 +44,31 @@ public class VcDeviceGroupController {
|
|
|
* @param id 站点分组ID
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping("vcDeviceGroupUpdate")
|
|
|
+ @GetMapping("vcDeviceGroupUpdate")
|
|
|
public ApiResult<Void> vcDeviceGroupUpdate(@RequestParam String groupName, @RequestParam Integer id) {
|
|
|
vcDeviceGroupService.vcDeviceGroupUpdate(groupName, id);
|
|
|
return ApiResult.success();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 站点分组-删除
|
|
|
+ */
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
+ public ApiResult<Void> remove(@PathVariable("id") Integer id)
|
|
|
+ {
|
|
|
+ vcDeviceGroupService.removeById(id);
|
|
|
+ return ApiResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 站点分组-列表
|
|
|
+ *
|
|
|
+ * @param groupName 站点分组名称
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("vcDeviceGroupList")
|
|
|
+ public ApiResult<List<VcDeviceGroup>> vcDeviceGroupList(@RequestParam(value = "groupName", required = false, defaultValue = "") String groupName) {
|
|
|
+ return ApiResult.success(vcDeviceGroupService.vcDeviceGroupList(groupName));
|
|
|
+ }
|
|
|
}
|
|
|
|