diff --git a/src/main/java/com/dispose/controller/DisposeTaskController.java b/src/main/java/com/dispose/controller/DisposeTaskController.java index a21267f9..f0591291 100644 --- a/src/main/java/com/dispose/controller/DisposeTaskController.java +++ b/src/main/java/com/dispose/controller/DisposeTaskController.java @@ -104,7 +104,8 @@ public class DisposeTaskController { String endTime = String.valueOf(req.getDisposeTime() == -1 ? 5256000: req.getDisposeTime()); NetflowDirection netDir = CommonEnumHandler.codeOf(NetflowDirection.class, Optional.ofNullable(req.getFlowDirection()).orElse(2)); - Long attackType = DDoSAttackType.getTypeMaskFromAttackType(new Integer[]{DDoSAttackType.RST_FLOOD.getValue()}); + Long attackType = DDoSAttackType.getTypeMaskFromAttackType(Optional.ofNullable(req.getAttackType()) + .orElse(new Integer[]{DDoSAttackType.NONE_ATTACKS.getValue()})); Integer flowBand = Optional.ofNullable(req.getFlowBandwidth()) .orElse(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH); @@ -184,7 +185,8 @@ public class DisposeTaskController { Optional.ofNullable(req.getFlowDirection()) .orElse(2))) .attackType(DDoSAttackType.getTypeMaskFromAttackType( - new Integer[]{DDoSAttackType.RST_FLOOD.getValue()})) + Optional.ofNullable(req.getAttackType()) + .orElse(new Integer[]{DDoSAttackType.NONE_ATTACKS.getValue()}))) .flowBandWidth(Optional.ofNullable(req.getFlowBandwidth()) .orElse(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH)) .build(); @@ -234,7 +236,8 @@ public class DisposeTaskController { String endTime = String.valueOf(req.getDisposeTime()); NetflowDirection netDir = CommonEnumHandler.codeOf(NetflowDirection.class, Optional.ofNullable(req.getFlowDirection()).orElse(2)); - Long attackType = DDoSAttackType.getTypeMaskFromAttackType(new Integer[]{DDoSAttackType.RST_FLOOD.getValue()}); + Long attackType = DDoSAttackType.getTypeMaskFromAttackType(Optional.ofNullable(req.getAttackType()) + .orElse(new Integer[]{DDoSAttackType.NONE_ATTACKS.getValue()})); Integer flowBand = Optional.ofNullable(req.getFlowBandwidth()) .orElse(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH);