package net.northking.cctp.element.mobile.enums;

import com.alibaba.fastjson.JSON;
import net.northking.cctp.element.core.type.EnumClass;

import java.util.*;

public enum  ParamTypeEnum implements EnumClass {

    STRING("字符串","string"),
    NUMBER("数字","number"),
    BOOLEAN("布尔","boolean"),
    OBJECT("对象","object");
    private String key;
    private String value;

    ParamTypeEnum(String key, String value){
        this.key = key;
        this.value = value;
    }

    @Override
    public String getEnumData() {
        List<Map<String,Object>> result = new ArrayList<>();
        for (ParamTypeEnum nullEnum : EnumSet.allOf(ParamTypeEnum.class)) {
            Map<String,Object> one = new HashMap();
            one.put("label",nullEnum.key);
            one.put("value",nullEnum.value);
            result.add(one);
        }
        return JSON.toJSONString(result);
    }
}
