common.go 1.5 KB
package constant

import (
	"os"
	"strconv"
)

const SERVICE_NAME = "partner"

var LOG_LEVEL = "debug"
var LOG_File = "logs/app.log"
var LOG_PREFIX = "[partner_dev]"

var MMM_SMS_SERVICE_HOST = "https://sms.fjmaimaimai.com:9897"
var UCENTER_SERVICE_HOST = "https://suplus-ucenter-test.fjmaimaimai.com"
var UCENTER_APP_KEY = "0c2c2a23dfc64ae230f5c54ab243ab52"

var BUSINESS_ADMIN_SERVICE_HOST = "http://suplus-business-admin-test.fjmaimaimai.com"
var BUSINESS_ADMIN_PLATFORM_ID = "25" //合伙人模块

var DEFAULT_GUEST_COMPANY int = 358

var SHARE_SHOP_PREVIEW_IMADGE = "https://media.fjmaimaimai.com/image/default/3E0C7050C13147CE8C7AF86C75F904E9-6-2.jpg" //分享店铺预览图
var WEHAT_MINI_PROGRAM_VERSION_TYPE = 2                                                                                //0:正式版  1:开发版  2:体验版

var DISENABLE_MULTI_DEVICE_LOGIN = false //不允许多端登录 (注:正式环境需要为true 测试环境设为false,方便多个设备测试)

func init() {
	if os.Getenv("LOG_LEVEL") != "" {
		LOG_LEVEL = os.Getenv("LOG_LEVEL")
	}
	if os.Getenv("LOG_PREFIX") != "" {
		LOG_PREFIX = os.Getenv("LOG_PREFIX")
	}
	if os.Getenv("UCENTER_SERVICE_HOST") != "" {
		UCENTER_SERVICE_HOST = os.Getenv("UCENTER_SERVICE_HOST")
	}
	if os.Getenv("BUSINESS_ADMIN_SERVICE_HOST") != "" {
		BUSINESS_ADMIN_SERVICE_HOST = os.Getenv("BUSINESS_ADMIN_SERVICE_HOST")
	}
	if v := os.Getenv("DEFAULT_GUEST_COMPANY"); v != "" {
		DEFAULT_GUEST_COMPANY, _ = strconv.Atoi(v)
	}
}