|
|
@@ -3,6 +3,8 @@ package com.zhongshu.iot.server.core.controller.iot;
|
|
|
import com.github.microservice.auth.security.annotations.ResourceAuth;
|
|
|
import com.github.microservice.auth.security.type.AuthType;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
+import com.zhongshu.card.client.model.base.IDParam;
|
|
|
+import com.zhongshu.card.client.model.base.IDsParam;
|
|
|
import com.zhongshu.iot.client.model.iot.IotTemplate2DeviceModel;
|
|
|
import com.zhongshu.iot.client.model.iot.IotTemplate2DeviceParam;
|
|
|
import com.zhongshu.iot.client.model.iot.IotTemplate2DeviceSearch;
|
|
|
@@ -15,7 +17,10 @@ import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.web.PageableDefault;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+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;
|
|
|
|
|
|
/**
|
|
|
* 模版绑定的 设备管理
|
|
|
@@ -33,7 +38,7 @@ public class IotTemplate2DeviceController {
|
|
|
private IotTemplate2DeviceService iotTemplate2DeviceService;
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "模版绑定设备")
|
|
|
+ @Operation(summary = "模版绑定设备(多个)")
|
|
|
@RequestMapping(value = "templateBindDevices", method = {RequestMethod.POST})
|
|
|
public ResultContent templateBindDevices(@RequestBody IotTemplate2DeviceParam param) {
|
|
|
return iotTemplate2DeviceService.templateBindDevices(param);
|
|
|
@@ -49,10 +54,17 @@ public class IotTemplate2DeviceController {
|
|
|
}
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "删除模版绑定设备")
|
|
|
- @RequestMapping(value = "delete", method = {RequestMethod.GET})
|
|
|
- public ResultContent delete(@RequestParam(name = "id") @Parameter(name = "id", description = "数据id") String id) {
|
|
|
- return iotTemplate2DeviceService.delete(id);
|
|
|
+ @Operation(summary = "删除模版绑定设备(单个)")
|
|
|
+ @RequestMapping(value = "delete", method = {RequestMethod.POST})
|
|
|
+ public ResultContent delete(@RequestBody IDParam param) {
|
|
|
+ return iotTemplate2DeviceService.delete(param.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @Operation(summary = "删除模版绑定设备(多个)")
|
|
|
+ @RequestMapping(value = "deletes", method = {RequestMethod.POST})
|
|
|
+ public ResultContent deletes(@RequestBody IDsParam param) {
|
|
|
+ return iotTemplate2DeviceService.deletes(param);
|
|
|
}
|
|
|
|
|
|
}
|