From 359f2f3fd0da6d69474cce87353beb54bfdbf90c Mon Sep 17 00:00:00 2001
From: lishihai <dslsh@dscom>
Date: 星期四, 20 六月 2024 14:24:52 +0800
Subject: [PATCH] 概述->新建或编辑(出库/入库)信息,编辑的时候显示保存的成本单价和销售单价

---
 conf/config.go |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/conf/config.go b/conf/config.go
index acb3589..8f40e75 100644
--- a/conf/config.go
+++ b/conf/config.go
@@ -23,14 +23,15 @@
 
 type (
 	webConf struct {
-		Host       string // 鏈満ip鍦板潃
-		Port       string // 绔彛鍙�
-		NodeId     string // 涓昏处鎴风敤鎴峰悕
-		OssType    string // 瀵硅薄瀛樺偍绫诲瀷
-		JWTSecret  string
-		FileServer string //鏂囦欢鏈嶅姟鍣ㄥ湴鍧�
-		ServerId   string //鏈嶅姟ID
-		GrpcPort   string //grpc绔彛鍙�
+		Host        string // 鏈満ip鍦板潃
+		Port        string // 绔彛鍙�
+		NodeId      string // 涓昏处鎴风敤鎴峰悕
+		OssType     string // 瀵硅薄瀛樺偍绫诲瀷
+		JWTSecret   string
+		FileServer  string //鏂囦欢鏈嶅姟鍣ㄥ湴鍧�
+		ServerId    string //鏈嶅姟ID
+		GrpcPort    string //grpc绔彛鍙�
+		CompanyName string //鍏徃鍚�
 	}
 
 	localConf struct {
@@ -46,6 +47,11 @@
 	fileTemplateConf struct {
 		InputSelfmadeAddr string //鍏ュ簱鑷埗鍗曟ā鐗堝湴鍧�
 	}
+
+	dingTalkConf struct {
+		AlarmKey string
+		AlarmUrl string
+	}
 )
 
 var (
@@ -55,6 +61,7 @@
 	LocalConf      = &localConf{}
 	Viper          *viper.Viper
 	GrpcServerConf = &grpcServerConf{}
+	DingTalkConf   = &dingTalkConf{}
 )
 
 func Init() error {
@@ -75,6 +82,7 @@
 	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
 	}
@@ -92,6 +100,9 @@
 	}
 	if len(srmAddr) > 0 {
 		GrpcServerConf.SrmAddr = srmAddr
+	}
+	if len(companyName) > 0 {
+		WebConf.CompanyName = companyName
 	}
 
 	DBHost := os.Getenv("DB_HOST")
@@ -116,6 +127,7 @@
 	_ = v.UnmarshalKey("db", DbConf)
 	_ = v.UnmarshalKey("local", LocalConf)
 	_ = v.UnmarshalKey("grpcServer", GrpcServerConf)
+	_ = v.UnmarshalKey("dingTalk", DingTalkConf)
 	showConfig()
 }
 
@@ -126,5 +138,6 @@
 	log.Printf("   DbConf:                 %+v", DbConf)
 	log.Printf("   LocalConf:               %+v", LocalConf)
 	log.Printf("   GrpcServerConf:               %+v", GrpcServerConf)
+	log.Printf("   DingTalkConf:               %+v", DingTalkConf)
 	log.Println("......................................................")
 }

--
Gitblit v1.8.0