|
|
package com.monitor.cloudtools.model;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by meiling.ge on 2018/3/6.
|
|
|
*/
|
|
|
//风控zk配置管理列表
|
|
|
public enum RiskCtrolZkNodeEnum {
|
|
|
//登录相关
|
|
|
gateway_degrade_users_checkUdid_enable("gateway.degrade.users.checkUdid.enable", "登录相关", "根据设备校验点击流降级开关(默认不降级)"),
|
|
|
uic_login_ip_limit_times("uic.login.ip.limit.times", "登录相关", "登录失败次数配置"),
|
|
|
users_loginip_limit_time("users.loginip.limit.time", "登录相关", "封的时间配置"),
|
|
|
uic_login_fail_limit_times("uic.login.fail.limit.times", "登录相关", "登录失败次数配置" ),
|
|
|
//图形验证码风控规则配置
|
|
|
gateway_degrade_uic_verifiedGraphic_enable("gateway.degrade.uic.verifiedGraphic.enable", "图形验证码风控规则配置", "开启或关闭图形验证码"),
|
|
|
gateway_degrade_uic_verifiedGraphic_h5web_enable("gateway.degrade.uic.verifiedGraphic.h5web.enable", "图形验证码风控规则配置","图形验证码/极验证"),
|
|
|
gateway_degrade_uic_verifiedGraphic_innerOutIp_ignore("gateway.degrade.uic.verifiedGraphic.innerOutIp.ignore", "图形验证码风控规则配置", "公司网络是否展示图形验证码 true-不展示 false-展示" ),
|
|
|
graphic_access_exceed_max_times("graphic.access.exceed.max.times", "图形验证码风控规则配置", "一个ip10分钟内请求次数"),
|
|
|
graphic_access_exceed_forbid_ip_time("graphic.access.exceed.forbid.ip.time", "图形验证码风控规则配置", "一个ip请求超限之后禁止请求图形时间"),
|
|
|
login_safe_times("login.safe.times", "图形验证码风控规则配置", "登录超过次数(短信登录,普通登录,第三方登录),展示图形验证码"),
|
|
|
smsSend_safe_times("smsSend.safe.times", "图形验证码风控规则配置", "短信发送超过次数(短信登录,注册,绑定,找回密码),展示图形验证码"),
|
|
|
//短信风控
|
|
|
message_iplimit_times_in_oneMin("message.iplimit.times.in.oneMin", "短信风控", "同一个ip一分钟限制发送条数"),
|
|
|
message_iplimit_times_in_tenMin("message.iplimit.times.in.tenMin", "短信风控", "同一个ip10分钟限制号码维度"),
|
|
|
message_mobile_limit_in_oneMin("message.mobile.limit.in.oneMin", "短信风控", "同一个号码一分钟发送次数"),
|
|
|
message_mobile_limit_in_tenMin("message.mobile.limit.in.tenMin", "短信风控", "同一个号码10分钟发送次数"),
|
|
|
message_mobile_limit_in_tweFour("message.mobile.limit.in.tweFour", "短信风控", "同一个号码24h发送次数");
|
|
|
|
|
|
private String nodeName;//节点名称
|
|
|
private String type;//所属类型
|
|
|
private String desc;//备注
|
|
|
|
|
|
RiskCtrolZkNodeEnum(String nodeName, String type, String desc) {
|
|
|
this.nodeName = nodeName;
|
|
|
this.type = type;
|
|
|
this.desc = desc;
|
|
|
}
|
|
|
|
|
|
public static List<String> getAllNodeNames(){
|
|
|
RiskCtrolZkNodeEnum[] allValues = RiskCtrolZkNodeEnum.values();
|
|
|
List<String> nodeNames = Lists.newArrayListWithCapacity(allValues.length);
|
|
|
for(RiskCtrolZkNodeEnum item : allValues){
|
|
|
nodeNames.add(item.nodeName);
|
|
|
}
|
|
|
return nodeNames;
|
|
|
}
|
|
|
|
|
|
|
|
|
//根据名称获取 类型
|
|
|
public static String getTypeByNodeName(String nodeName){
|
|
|
RiskCtrolZkNodeEnum[] allValues = RiskCtrolZkNodeEnum.values();
|
|
|
for(RiskCtrolZkNodeEnum item : allValues){
|
|
|
if(StringUtils.equals(nodeName, item.nodeName)){
|
|
|
return item.type;
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|