common.go 2.2 KB
package constant

import (
	"fmt"

	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"
)

// var Configurator utils.Configurator = utils.NewConfig("ini","config/app_test.conf")
var Configurator utils.Configurator = utils.EnvConfigurator{}

var SERVICE_NAME = "allied-creation-manufacture"
var SERVICE_ENV = "dev"
var HTTP_PORT int = 8081
var CACHE_PREFIX = "allied-creation-manufacture-dev"
var LOG_LEVEL = "debug"
var LOG_FILE = "app.log"
var PPROF_ON = true

// 天联共创基础模块
var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080" //"http://allied-creation-basic-dev.fjmaimaimai.com"

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

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

var MMM_BYTE_BANK_HOST = "http://220.250.41.79:8301"

//数控
var ALLIED_CREATION_STANDARD = "http://digitization-server-dev.fjmaimaimai.com"

var CUSTOMER_ACCOUNT = []int64{3129687560814592, 3129687690100739, 3492238958608384}

const CUSTOMER_ACCOUNT_DELIMITER = ","

/*****   1.数据传输  *****/
const HeaderCompanyId = "companyId"
const HeaderUserId = "userId"
const HeaderOrgId = "orgId"
const HeaderOrgIds = "orgIds"

func init() {
	LOG_LEVEL = Configurator.DefaultString("LOG_LEVEL", LOG_LEVEL)
	ALLIED_CREATION_BASIC_HOST = Configurator.DefaultString("ALLIED_CREATION_BASIC_HOST", ALLIED_CREATION_BASIC_HOST)
	ALLIED_CREATION_USER_HOST = Configurator.DefaultString("ALLIED_CREATION_USER_HOST", ALLIED_CREATION_USER_HOST)
	ALLIED_CREATION_COOPERATION_HOST = Configurator.DefaultString("ALLIED_CREATION_COOPERATION_HOST", ALLIED_CREATION_COOPERATION_HOST)
	MMM_BYTE_BANK_HOST = Configurator.DefaultString("MMM_BYTE_BANK_HOST", MMM_BYTE_BANK_HOST)
	SERVICE_ENV = Configurator.DefaultString("SERVICE_ENV", SERVICE_ENV)
	HTTP_PORT = Configurator.DefaultInt("HTTP_PORT", HTTP_PORT)
	SERVICE_NAME = fmt.Sprintf("%v-%v", SERVICE_NAME, SERVICE_ENV)
	PPROF_ON = Configurator.DefaultBool("PPROF_ON", PPROF_ON)
	CACHE_PREFIX = SERVICE_NAME
}