common.go 906 字节
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"))
	}
}