common.go 801 字节
package constant

import "os"

const SERVICE_NAME = "mmm-worth"

var ABILITY_SERVICE_HOST = "https://suplus-worth-app-gateway-dev.fjmaimaimai.com"
var MMM_OPEN_API_SERVICE_HOST = "https://mmm-open-api-dev.fjmaimaimai.com"
var WORTH_SERVICE_GATEWAY_HOST = "https://suplus-worth-app-gateway-dev.fjmaimaimai.com"

var LOG_LEVEL = "debug"
var LOG_File = "logs/app.log"
var LOG_PREFIX = "[mmm-worth_dev]"

func init() {
	if os.Getenv("LOG_LEVEL") != "" {
		LOG_LEVEL = os.Getenv("LOG_LEVEL")
	}
	if os.Getenv("ABILITY_SERVICE_HOST") != "" {
		ABILITY_SERVICE_HOST = os.Getenv("ABILITY_SERVICE_HOST")
	}
	if os.Getenv("MMM_OPEN_API_SERVICE_HOST") != "" {
		MMM_OPEN_API_SERVICE_HOST = os.Getenv("MMM_OPEN_API_SERVICE_HOST")
	}
	if os.Getenv("LOG_PREFIX") != "" {
		LOG_PREFIX = os.Getenv("LOG_PREFIX")
	}
}