package org.springblade.binlog.constant; import org.springblade.core.launch.constant.AppConstant; /** * 监听配置信息 * * @author zrj * @since 2024/07/03 **/ public interface FromConstants { /** * URL dev 地址 */ String URL_DEV_ADDR = "jdbc:mysql://127.0.0.1:3308/srjw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true"; /** * URL prod 地址 */ String URL_PROD_ADDR = "jdbc:mysql://czfw_wx_web.xzga.top:13005/ewm_shangrao?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true"; /** * URL test 地址 */ String URL_TEST_ADDR = "jdbc:mysql://127.0.0.1:3308/srjw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true"; /** * username dev 地址 */ String USERNAME_DEV_ADDR = "root"; /** * username prod 地址 */ String USERNAME_PROD_ADDR = "ewm_user"; /** * username test 地址 */ String USERNAME_TEST_ADDR = "root"; /** * password dev 地址 */ String PASSWORD_DEV_ADDR = "root"; /** * username prod 地址 */ String PASSWORD_PROD_ADDR = "ft@135246"; /** * username test 地址 */ String PASSWORD_TEST_ADDR = "root"; /** * 动态获取url * * @param profile 环境变量 * @return */ static String setUrl(String profile) { switch (profile) { case (AppConstant.PROD_CODE): return URL_PROD_ADDR; case (AppConstant.TEST_CODE): return URL_TEST_ADDR; default: return URL_DEV_ADDR; } } /** * 动态获取 USERNAME * * @param profile 环境变量 * @return */ static String setUsername(String profile) { switch (profile) { case (AppConstant.PROD_CODE): return USERNAME_PROD_ADDR; case (AppConstant.TEST_CODE): return USERNAME_TEST_ADDR; default: return USERNAME_DEV_ADDR; } } /** * 动态获取 password * * @param profile 环境变量 * @return */ static String setPassword(String profile) { switch (profile) { case (AppConstant.PROD_CODE): return PASSWORD_PROD_ADDR; case (AppConstant.TEST_CODE): return PASSWORD_TEST_ADDR; default: return PASSWORD_DEV_ADDR; } } }