common.go
906 字节
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
package constant
import (
"os"
"strconv"
)
const SERVICE_NAME = "project"
var LOG_LEVEL = "debug"
var HTTP_PORT int = 8081
//天联共创基础模块
var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080"
//天联共创用户模块
var ALLIED_CREATION_USER_HOST = "http://localhost:8081"
//天联共创业务模块
var ALLIED_CREATION_COOPERATION_HOST = "http://localhost:8082"
//通用模块短信服务
var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897"
func init() {
if os.Getenv("LOG_LEVEL") != "" {
LOG_LEVEL = os.Getenv("LOG_LEVEL")
}
if os.Getenv("ALLIED_CREATION_BASIC_HOST") != "" {
ALLIED_CREATION_BASIC_HOST = os.Getenv("ALLIED_CREATION_BASIC_HOST")
}
if os.Getenv("ALLIED_CREATION_USER_HOST") != "" {
ALLIED_CREATION_USER_HOST = os.Getenv("ALLIED_CREATION_USER_HOST")
}
if os.Getenv("HTTP_PORT") != "" {
HTTP_PORT, _ = strconv.Atoi(os.Getenv("HTTP_PORT"))
}
}