From f0786e779666d67a50cd57d82cfe1e278b47d397 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期四, 04 七月 2024 11:54:11 +0800
Subject: [PATCH] fix

---
 conf/config.go |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/conf/config.go b/conf/config.go
index c9887c0..da9d1d8 100644
--- a/conf/config.go
+++ b/conf/config.go
@@ -3,6 +3,7 @@
 import (
 	"log"
 	"os"
+	"wms/constvar"
 	"wms/pkg/logx"
 	"wms/pkg/mysqlx"
 
@@ -30,6 +31,7 @@
 		JWTSecret   string
 		FileServer  string //鏂囦欢鏈嶅姟鍣ㄥ湴鍧�
 		ServerId    string //鏈嶅姟ID
+		Env         constvar.Env
 		GrpcPort    string //grpc绔彛鍙�
 		CompanyName string //鍏徃鍚�
 	}
@@ -39,9 +41,10 @@
 	}
 
 	grpcServerConf struct {
-		ApsAddr string //aps鏈嶅姟grpc鍦板潃
-		CrmAddr string //crm鏈嶅姟grpc鍦板潃
-		SrmAddr string //srm鏈嶅姟grpc鍦板潃
+		AdminAddr string //admin鏈嶅姟grpc鍦板潃
+		ApsAddr   string //aps鏈嶅姟grpc鍦板潃
+		CrmAddr   string //crm鏈嶅姟grpc鍦板潃
+		SrmAddr   string //srm鏈嶅姟grpc鍦板潃
 	}
 
 	fileTemplateConf struct {
@@ -79,9 +82,11 @@
 	nodeId := os.Getenv("NODE_ID")    // 涓昏处鎴风敤鎴峰悕
 	host := os.Getenv("HOST")         // 鏈満IP鍦板潃
 	GrpcPort := os.Getenv("WMS_GRPC") // 鍙澶栨彁渚沢rpc鏈嶅姟锛屾湰鏈嶅姟涓嶇敤
+	adminAddr := os.Getenv("ADMIN_GRPC")
 	apsAddr := os.Getenv("APS_GRPC")
 	crmAddr := os.Getenv("CRM_GRPC")
 	srmAddr := os.Getenv("SRM_GRPC")
+	companyName := os.Getenv("COMPANY_NAME")
 	if len(GrpcPort) > 0 {
 		WebConf.GrpcPort = GrpcPort
 	}
@@ -91,6 +96,9 @@
 	if len(host) > 0 {
 		WebConf.Host = host
 	}
+	if len(adminAddr) > 0 {
+		GrpcServerConf.AdminAddr = adminAddr
+	}
 	if len(apsAddr) > 0 {
 		GrpcServerConf.ApsAddr = apsAddr
 	}
@@ -100,6 +108,9 @@
 	if len(srmAddr) > 0 {
 		GrpcServerConf.SrmAddr = srmAddr
 	}
+	if len(companyName) > 0 {
+		WebConf.CompanyName = companyName
+	}
 
 	DBHost := os.Getenv("DB_HOST")
 	DBName := os.Getenv("DB_NAME")

--
Gitblit v1.8.0