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

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

import java.util.*;

/**
 * <p>Title: EnvTypeEnum</p>
 * <p>Description: 环境类型</p>
 *
 * @Author chenjianfeng
 * @Version V1.0
 * @Date 2022/10/17
 * <p>Copyright: NorthKing@RPA（C）2020 版权</p>
 */

public enum EnvTypeEnum implements EnumClass {
    /**
     * BS环境
     */
    bs("BS环境",1),
    /**
     * CS环境
     */
    cs("CS环境",2);

    private String key;

    private Integer value;

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

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