package org.nest.springwrap.launcher;

import org.nest.springwrap.core.launch.constant.AppConstant;


public interface LauncherConstant {


    String NACOS_DEV_ADDR = "127.0.0.1:8848";
    //String NACOS_DEV_ADDR = "192.168.0.175:8848";

    String NACOS_PROD_ADDR = "192.168.0.230:8112";

    String NACOS_PRE_ADDR = "192.168.0.120:18848";

    String NACOS_TEST_ADDR = "192.168.0.25:8848";


    String SENTINEL_DEV_ADDR = "127.0.0.1:8858";


    String SENTINEL_PROD_ADDR = "127.0.0.1:8858";


    String SENTINEL_TEST_ADDR = "127.0.0.1:8858";


    String SEATA_DEV_ADDR = "127.0.0.1:8091";


    String SEATA_PROD_ADDR = "127.0.0.1:8091";


    String SEATA_TEST_ADDR = "127.0.0.1:8091";


    String ZIPKIN_DEV_ADDR = "http://127.0.0.1:9411";


    String ZIPKIN_PROD_ADDR = "http://127.0.0.1:9411";


    String ZIPKIN_TEST_ADDR = "http://127.0.0.1:9411";


    String ELK_DEV_ADDR = "127.0.0.1:9000";


    String ELK_PROD_ADDR = "127.0.0.1:9000";


    String ELK_TEST_ADDR = "127.0.0.1:9000";


    String FILE_MODE = "file";


    String NACOS_MODE = "nacos";


    String DEFAULT_MODE = "default";


    String GROUP_NAME = "-group";


    static String seataServiceGroup(String appName) {
        return appName.concat(GROUP_NAME);
    }


    static String nacosAddr(String profile) {
        switch (profile) {
            case (AppConstant.PROD_CODE):
                return NACOS_PROD_ADDR;
            case (AppConstant.TEST_CODE):
                return NACOS_TEST_ADDR;
            case (AppConstant.PRE_CODE):
                return NACOS_PRE_ADDR;
            default:
                return NACOS_DEV_ADDR;
        }
    }


    static String sentinelAddr(String profile) {
        switch (profile) {
            case (AppConstant.PROD_CODE):
                return SENTINEL_PROD_ADDR;
            case (AppConstant.TEST_CODE):
                return SENTINEL_TEST_ADDR;
            default:
                return SENTINEL_DEV_ADDR;
        }
    }


    static String seataAddr(String profile) {
        switch (profile) {
            case (AppConstant.PROD_CODE):
                return SEATA_PROD_ADDR;
            case (AppConstant.TEST_CODE):
                return SEATA_TEST_ADDR;
            default:
                return SEATA_DEV_ADDR;
        }
    }


    static String zipkinAddr(String profile) {
        switch (profile) {
            case (AppConstant.PROD_CODE):
                return ZIPKIN_PROD_ADDR;
            case (AppConstant.TEST_CODE):
                return ZIPKIN_TEST_ADDR;
            default:
                return ZIPKIN_DEV_ADDR;
        }
    }


    static String elkAddr(String profile) {
        switch (profile) {
            case (AppConstant.PROD_CODE):
                return ELK_PROD_ADDR;
            case (AppConstant.TEST_CODE):
                return ELK_TEST_ADDR;
            default:
                return ELK_DEV_ADDR;
        }
    }

}
