IpRuleItemEnum.java 1.31 KB
package com.ui.common;

import com.google.common.collect.Lists;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by meiling.ge on 2017/8/21.
 * 恶意Ip管理---规则项
 */
public enum IpRuleItemEnum {
    QPS("qps","qps"),
    DIFMETHODCOUNT("difMethodCount","访问接口次数"),
    IMPCOUNT("impCount","敏感接口访问次数"),
    IMPAPIPRECENT("impApiPrecent","敏感接口占比"),
    UIDCOUNT("uidCount","uid个数"),
    UDIDCOUNT("udidCount","udid个数"),
    NOTEXSITUDIDCOUNT("notExsitUdidCount","不存在的udid个数"),
    NOTEXISTUDIDPERCENT("notExistUdidPercent","不存在的udid占比"),
    DEVICETYPECOUNT("deviceTypeCount","设备类型总数");

    private String item;
    private String desc;
    IpRuleItemEnum(String item, String desc){
        this.item = item;
        this.desc = desc;
    }

    public static List<Map<String,String>> getAll(){
        IpRuleItemEnum[] values = IpRuleItemEnum.values();
        List<Map<String,String>> list = Lists.newArrayListWithCapacity(values.length);
        for(IpRuleItemEnum val : values){//前端 select的数据格式
            Map<String,String> map = new HashMap<>();
            map.put("value",val.item);
            map.put("text",val.desc);
            list.add(map);
        }
        return list;

    }


}