From da154e5c758c3b67202390debdc5331a8f68c685 Mon Sep 17 00:00:00 2001
From: yinbentan <yinbentan@live.com>
Date: 星期六, 29 六月 2024 18:25:22 +0800
Subject: [PATCH] 库存结算时间点添加数据初始化任务

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

diff --git a/conf/config.go b/conf/config.go
index c521566..8e703e5 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 //鍏徃鍚�
 	}
@@ -47,6 +49,11 @@
 	fileTemplateConf struct {
 		InputSelfmadeAddr string //鍏ュ簱鑷埗鍗曟ā鐗堝湴鍧�
 	}
+
+	dingTalkConf struct {
+		AlarmKey string
+		AlarmUrl string
+	}
 )
 
 var (
@@ -56,6 +63,7 @@
 	LocalConf      = &localConf{}
 	Viper          *viper.Viper
 	GrpcServerConf = &grpcServerConf{}
+	DingTalkConf   = &dingTalkConf{}
 )
 
 func Init() error {
@@ -76,6 +84,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
 	}
@@ -93,6 +102,9 @@
 	}
 	if len(srmAddr) > 0 {
 		GrpcServerConf.SrmAddr = srmAddr
+	}
+	if len(companyName) > 0 {
+		WebConf.CompanyName = companyName
 	}
 
 	DBHost := os.Getenv("DB_HOST")
@@ -117,6 +129,7 @@
 	_ = v.UnmarshalKey("db", DbConf)
 	_ = v.UnmarshalKey("local", LocalConf)
 	_ = v.UnmarshalKey("grpcServer", GrpcServerConf)
+	_ = v.UnmarshalKey("dingTalk", DingTalkConf)
 	showConfig()
 }
 
@@ -127,5 +140,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