package com.njcn.enums;

/**
 * @author hongawen
 * @date 2019/7/12 11:57
 * 系统项目的枚举
 */
public enum ProjectEnum {

    /**
     * 单点登录系统信息
     */
    SSO("sso", "3bba2471-7384-41de-800b-aed41c845b7b", "单点登录系统", "sso/login?item=", "", "sso/user/judgeLogin?item=sso"),
    /**
     * 灿能云系统信息
     */
    APP("app", "3bba2471-9654-41de-12bf-aed476545b43", "灿能云APP", "", "", "sso/user/judgeLogin?item=sso"),
    /**
     * 谐波系统信息
     */
    PQS9000("pqs9000", "983f9dfe-4f9a-4c96-89d8-7d425a1f1d6c", "谐波监测模块", "pqs9000/user/ssoRegister?token=", "sso/user/loginout?item=pqs9000", "sso/user/judgeLogin?item=pqs9000"),
    /**
     * 暂降系统信息
     */
    PQS9200("pqs9200", "1cfcd6e2-c5fe-4b15-988a-32b90f1170c1", "电压暂降模块", "pqs9200/user/ssoRegister?token=", "sso/user/loginout?item=pqs9200", "sso/user/judgeLogin?item=pqs9200"),
    /**
     * 技术监督系统信息
     */
    PQS9300("pqs9300", "2e5c5bda-f2c6-4b17-a73d-ee00f53401d5", "技术监督管理", "pqs9300/user/ssoRegister?token=", "sso/user/loginout?item=pqs9300", "sso/user/judgeLogin?item=pqs9300"),
    /**
     * 后台管理系统信息
     */
    PQS9900("pqs9900", "82d51b5f-e0a7-49b2-908d-9cbf2ce1f0b3", "后台管理系统", "pqs9900/user/ssoRegister?token=", "sso/user/loginout?item=pqs9900", "sso/user/judgeLogin?item=pqs9900");

    private String item;

    private String key;

    private String name;

    private String loginUrl;

    private String loginOut;

    private String judgeUrl;

    ProjectEnum(String item, String key, String name, String loginUrl, String loginOut, String judgeUrl) {
        this.item = item;
        this.key = key;
        this.name = name;
        this.loginUrl = loginUrl;
        this.loginOut = loginOut;
        this.judgeUrl = judgeUrl;
    }

    public String getItem() {
        return item;
    }

    public String getKey() {
        return key;
    }

    public String getName() {
        return name;
    }

    public String getLoginUrl() {
        return loginUrl;
    }

    public String getLoginOut() {
        return loginOut;
    }

    public String getJudgeUrl() {
        return judgeUrl;
    }

    static public String getKeyByItem(String item) {
        for (ProjectEnum projectEnum : ProjectEnum.values()) {
            if (projectEnum.item.equals(item)) {
                return projectEnum.key;
            }
        }

        return "";
    }
}
