|
@@ -7,10 +7,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.SneakyThrows;
|
|
import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.hswebframework.web.authorization.annotation.Authorize;
|
|
|
|
|
-import org.hswebframework.web.authorization.annotation.CreateAction;
|
|
|
|
|
-import org.hswebframework.web.authorization.annotation.QueryAction;
|
|
|
|
|
-import org.hswebframework.web.authorization.annotation.Resource;
|
|
|
|
|
|
|
+import org.hswebframework.web.authorization.annotation.*;
|
|
|
import org.hswebframework.web.crud.service.ReactiveCrudService;
|
|
import org.hswebframework.web.crud.service.ReactiveCrudService;
|
|
|
import org.hswebframework.web.crud.web.reactive.ReactiveServiceCrudController;
|
|
import org.hswebframework.web.crud.web.reactive.ReactiveServiceCrudController;
|
|
|
import org.hswebframework.web.exception.BusinessException;
|
|
import org.hswebframework.web.exception.BusinessException;
|
|
@@ -76,6 +73,7 @@ public class DeviceDirectiveController implements
|
|
|
directive.getDownstream().addHeader(Headers.async,false);
|
|
directive.getDownstream().addHeader(Headers.async,false);
|
|
|
( (CommonDeviceMessage)directive.getDownstream()).setMessageId(IdUtils.newUUID());
|
|
( (CommonDeviceMessage)directive.getDownstream()).setMessageId(IdUtils.newUUID());
|
|
|
( (CommonDeviceMessage)directive.getDownstream()).setTimestamp(System.currentTimeMillis());
|
|
( (CommonDeviceMessage)directive.getDownstream()).setTimestamp(System.currentTimeMillis());
|
|
|
|
|
+ ( (CommonDeviceMessage)directive.getDownstream()).setDeviceId(directive.getDeviceId());
|
|
|
return sender.send(directive.getDownstream()).then();
|
|
return sender.send(directive.getDownstream()).then();
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
@@ -107,6 +105,15 @@ public class DeviceDirectiveController implements
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/delete")
|
|
|
|
|
+ @DeleteAction
|
|
|
|
|
+ @Operation(summary = "批量删除指令记录")
|
|
|
|
|
+ public Mono<Integer> batchDelete(@RequestBody Mono<List<String>> idList){
|
|
|
|
|
+ return directivesService.createDelete().in(DeviceDirectivesEntity::getId,idList).execute();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
private Mono<DeviceMessage> parseParamMsg(DirectiveParam param){
|
|
private Mono<DeviceMessage> parseParamMsg(DirectiveParam param){
|
|
|
Map<String, Object> message = param.getMessage();
|
|
Map<String, Object> message = param.getMessage();
|
|
|
Object msgType = message.get("messageType");
|
|
Object msgType = message.get("messageType");
|