common.go 1.4 KB
package constant

import "os"

const SERVICE_NAME = "partnermg"

var LOG_LEVEL = "debug"
var LOG_File = "./logs/partnermg.log"
var IMPORT_EXCEL = "./download/订单数据模板.xlsx"
var Log_PREFIX = "[partnermg_dev]"
var APP_NAME = ""
var (
	UCENTER_HOST      = "https://suplus-ucenter-test.fjmaimaimai.com" //统一用户中心地址
	UCENTER_SECRET    = "cykbjnfqgctn"
	UCENTER_APP_KEY   = "39aefef9e22744a3b2d2d3791824ae7b"
	UCENTER_CHECK_ALT = "rsF0pL!6DwjBO735"
)

// 栏目常量设置
var ORDER_BASE = "order_base" // 订单管理栏目

var (
	BUSINESS_ADMIN_HOST = "https://suplus-business-admin-test.fjmaimaimai.com" //企业平台的地址
)

// 导入excel文件列总数
var EXCEL_COLUMN = 13

func init() {
	if os.Getenv("LOG_LEVEL") != "" {
		LOG_LEVEL = os.Getenv("LOG_LEVEL")
	}
	if os.Getenv("UCENTER_HOST") != "" {
		UCENTER_HOST = os.Getenv("UCENTER_HOST")
	}
	if os.Getenv("UCENTER_SECRET") != "" {
		UCENTER_SECRET = os.Getenv("UCENTER_SECRET")
	}
	if os.Getenv("UCENTER_APP_KEY") != "" {
		UCENTER_APP_KEY = os.Getenv("UCENTER_APP_KEY")
	}
	if os.Getenv("UCENTER_CHECK_ALT") != "" {
		UCENTER_CHECK_ALT = os.Getenv("UCENTER_CHECK_ALT")
	}
	if os.Getenv("BUSINESS_ADMIN_HOST") != "" {
		BUSINESS_ADMIN_HOST = os.Getenv("BUSINESS_ADMIN_HOST")
	}
	if os.Getenv("Log_PREFIX") != "" {
		Log_PREFIX = os.Getenv("Log_PREFIX")
	}
	if os.Getenv("APP_NAME") != "" {
		APP_NAME = os.Getenv("APP_NAME")
	}
}