common.go
2.6 KB
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
package constant
import (
"os"
"strconv"
)
const SERVICE_NAME = "allied-creation-gateway"
var LOG_LEVEL = "debug"
var LOG_TYPE = "console" // file, console, es
var LOG_FRAMEWORK = "beego" // beego logrus
var LOG_FILE = "app.log"
var LOG_PREFIX = "[allied-creation-gateway]"
var FileStatic = "./static"
var HTTP_PORT int = 8083
var ALLIED_CREATION_GATEWAY_HOST = "http://localhost:8080"
//天联共创基础模块
var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080" //"http://allied-creation-basic-dev.fjmaimaimai.com"
//天联共创用户模块
var ALLIED_CREATION_USER_HOST = "http://localhost:8081" //"http://allied-creation-user-dev.fjmaimaimai.com"
//天联共创业务模块
var ALLIED_CREATION_COOPERATION_HOST = "http://localhost:8082" // "http://allied-creation-cooperation-dev.fjmaimaimai.com"
// 天联共创 生产制造模块
var ALLIED_CREATION_MANUFACTURE_HOST = "http://localhost:8083"
// 版本更新模块
var SUPLUS_ADMIN_BASE_HOST = "http://suplus-admin-base-dev.fjmaimaimai.com"
//通用模块短信服务
var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897"
//素加销售导航服务
var SUPLUS_SALE_APP = "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
// TODO:特殊短信验证码,不验证,正式环境注入空
var SMSCODE_ALL_POWER = "999512"
var EnableBlockChain = true
func init() {
if os.Getenv("LOG_LEVEL") != "" {
LOG_LEVEL = os.Getenv("LOG_LEVEL")
}
if os.Getenv("LOG_TYPE") != "" {
LOG_TYPE = os.Getenv("LOG_TYPE")
}
if os.Getenv("SUPLUS_ADMIN_BASE_HOST") != "" {
SUPLUS_ADMIN_BASE_HOST = os.Getenv("SUPLUS_ADMIN_BASE_HOST")
}
if os.Getenv("ALLIED_CREATION_GATEWAY_HOST") != "" {
ALLIED_CREATION_GATEWAY_HOST = os.Getenv("ALLIED_CREATION_GATEWAY_HOST")
}
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("ALLIED_CREATION_COOPERATION_HOST") != "" {
ALLIED_CREATION_COOPERATION_HOST = os.Getenv("ALLIED_CREATION_COOPERATION_HOST")
}
if os.Getenv("ALLIED_CREATION_MANUFACTURE_HOST") != "" {
ALLIED_CREATION_MANUFACTURE_HOST = os.Getenv("ALLIED_CREATION_MANUFACTURE_HOST")
}
if os.Getenv("SMS_SERVE_HOST") != "" {
SMS_SERVE_HOST = os.Getenv("SMS_SERVE_HOST")
}
if os.Getenv("HTTP_PORT") != "" {
HTTP_PORT, _ = strconv.Atoi(os.Getenv("HTTP_PORT"))
}
if os.Getenv("SMSCODE_ALL_POWER") != "" {
SMSCODE_ALL_POWER = os.Getenv("SMSCODE_ALL_POWER")
}
if os.Getenv("SUPLUS_SALE_APP") != "" {
SUPLUS_SALE_APP = os.Getenv("SUPLUS_SALE_APP")
}
}