zrj
2024-07-03 0b1e9e70818f0e3eb32dd6c029d42d93236ecdc6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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;
        }
    }
 
}