REM:
1.修改DDoS攻击类型与迪普攻击类型的转换
2.删除多余注释
This commit is contained in:
chenlinghy 2020-09-22 18:59:11 +08:00
parent 3d50cdacb7
commit 5f35720c93
2 changed files with 9 additions and 7 deletions

View File

@ -6,7 +6,6 @@ package com.dispose.common;
* @author <huangxin@cmhi.chinamoblie.com> * @author <huangxin@cmhi.chinamoblie.com>
*/ */
public enum DisposeCapacityType implements BaseEnum { public enum DisposeCapacityType implements BaseEnum {
//1.清洗,2.压制,3.高防
/** /**
* The Cleanup. * The Cleanup.
*/ */

View File

@ -103,10 +103,13 @@ public enum DpTechAttackType implements BaseEnum {
* @return the long * @return the long
*/ */
public static Long formDdosAttackTypeMaks(Long ddosAttackMask) { public static Long formDdosAttackTypeMaks(Long ddosAttackMask) {
return getTypeMaskFromAttackType(DDoSAttackType.maskToDdosAttackType(ddosAttackMask) List<DpTechAttackType> dpTechAttackTypes = new ArrayList<>();
.stream()
.flatMap(DpTechAttackType::fromDdosAttackTypeValue) for(DDoSAttackType a : DDoSAttackType.maskToDdosAttackType(ddosAttackMask)) {
.distinct().toArray(DpTechAttackType[]::new)); dpTechAttackTypes.addAll(DpTechAttackType.fromDdosAttackTypeValue(a));
}
return getTypeMaskFromAttackType(dpTechAttackTypes.stream().distinct().toArray(DpTechAttackType[]::new));
} }
/** /**
@ -133,7 +136,7 @@ public enum DpTechAttackType implements BaseEnum {
* @param type the type * @param type the type
* @return the stream * @return the stream
*/ */
public static Stream<DpTechAttackType> fromDdosAttackTypeValue(DDoSAttackType type) { public static List<DpTechAttackType> fromDdosAttackTypeValue(DDoSAttackType type) {
List<DpTechAttackType> attackList = new ArrayList<>(); List<DpTechAttackType> attackList = new ArrayList<>();
switch (type) { switch (type) {
@ -219,7 +222,7 @@ public enum DpTechAttackType implements BaseEnum {
break; break;
} }
return attackList.stream(); return attackList;
} }
/** /**