Prechádzať zdrojové kódy

add 增加批量指令删除

18339543638 4 rokov pred
rodič
commit
418a057dc2

+ 11 - 4
jetlinks-manager/device-manager/src/main/java/org/jetlinks/community/device/web/DeviceDirectiveController.java

@@ -7,10 +7,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.AllArgsConstructor;
 import lombok.SneakyThrows;
 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.web.reactive.ReactiveServiceCrudController;
 import org.hswebframework.web.exception.BusinessException;
@@ -76,6 +73,7 @@ public class DeviceDirectiveController implements
                             directive.getDownstream().addHeader(Headers.async,false);
                             ( (CommonDeviceMessage)directive.getDownstream()).setMessageId(IdUtils.newUUID());
                             ( (CommonDeviceMessage)directive.getDownstream()).setTimestamp(System.currentTimeMillis());
+                            ( (CommonDeviceMessage)directive.getDownstream()).setDeviceId(directive.getDeviceId());
                             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){
         Map<String, Object> message = param.getMessage();
         Object msgType = message.get("messageType");

+ 1 - 0
jetlinks-manager/pom.xml

@@ -19,6 +19,7 @@
         <module>logging-manager</module>
         <module>rule-engine-manager</module>
         <module>visualization-manager</module>
+        <module>brige-manager</module>
     </modules>
 
 </project>