common.go 1.2 KB
package constant

import (
	"os"
	"strconv"
)

const SERVICE_NAME = "allied-creation-gateway"

var LOG_LEVEL = "debug"

var HTTP_PORT int = 8083

//天联共创基础模块
var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080"

//天联共创用户模块
var ALLIED_CREATION_USER_HOST = "http://allied-creation-user-dev.fjmaimaimai.com"

//天联共创业务模块
var ALLIED_CREATION_COOPERATION_HOST = "http://allied-creation-cooperation-dev.fjmaimaimai.com"

//通用模块短信服务
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("ALLIED_CREATION_COOPERATION_HOST") != "" {
		ALLIED_CREATION_COOPERATION_HOST = os.Getenv("ALLIED_CREATION_COOPERATION_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"))
	}
}