| | |
| | | |
| | | type ( |
| | | webConf struct { |
| | | Host string // 本机ip地址 |
| | | Port string // 端口号 |
| | | NodeId string // 主账户用户名 |
| | | OssType string // 对象存储类型 |
| | | JWTSecret string |
| | | GrpcPort string //grpc端口号 |
| | | Host string // 本机ip地址 |
| | | Port string // 端口号 |
| | | NodeId string // 主账户用户名 |
| | | OssType string // 对象存储类型 |
| | | JWTSecret string |
| | | FileServer string //文件服务器地址 |
| | | ServerId string //服务ID |
| | | GrpcPort string //grpc端口号 |
| | | } |
| | | |
| | | localConf struct { |
| | |
| | | |
| | | grpcServerConf struct { |
| | | ApsAddr string //aps服务grpc地址 |
| | | CrmAddr string //crm服务grpc地址 |
| | | SrmAddr string //srm服务grpc地址 |
| | | } |
| | | |
| | | fileTemplateConf struct { |
| | | InputSelfmadeAddr string //入库自制单模版地址 |
| | | } |
| | | ) |
| | | |
| | |
| | | host := os.Getenv("HOST") // 本机IP地址 |
| | | GrpcPort := os.Getenv("WMS_GRPC") // 只对外提供grpc服务,本服务不用 |
| | | apsAddr := os.Getenv("APS_GRPC") |
| | | crmAddr := os.Getenv("CRM_GRPC") |
| | | srmAddr := os.Getenv("SRM_GRPC") |
| | | if len(GrpcPort) > 0 { |
| | | WebConf.GrpcPort = GrpcPort |
| | | } |
| | |
| | | if len(apsAddr) > 0 { |
| | | GrpcServerConf.ApsAddr = apsAddr |
| | | } |
| | | if len(crmAddr) > 0 { |
| | | GrpcServerConf.CrmAddr = crmAddr |
| | | } |
| | | if len(srmAddr) > 0 { |
| | | GrpcServerConf.SrmAddr = srmAddr |
| | | } |
| | | |
| | | DBHost := os.Getenv("DB_HOST") |
| | | DBName := os.Getenv("DB_NAME") |