From 73b6baf6af3d88cdcb0e2df7932a9bd96b0b85c5 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 01 七月 2024 22:32:34 +0800 Subject: [PATCH] 月度统计出入库按类型汇总报表定时任务和手动跑任务接口 --- conf/config.go | 46 +++++++++++++++++++++++++++++----------------- 1 files changed, 29 insertions(+), 17 deletions(-) diff --git a/conf/config.go b/conf/config.go index 24352f9..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" @@ -23,14 +24,16 @@ 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 + Env constvar.Env + GrpcPort string //grpc绔彛鍙� + CompanyName string //鍏徃鍚� } localConf struct { @@ -46,16 +49,21 @@ fileTemplateConf struct { InputSelfmadeAddr string //鍏ュ簱鑷埗鍗曟ā鐗堝湴鍧� } + + dingTalkConf struct { + AlarmKey string + AlarmUrl string + } ) var ( - WebConf = &webConf{} - LogConf = &logx.Conf{} - DbConf = &mysqlx.Conf{} - LocalConf = &localConf{} - Viper *viper.Viper - GrpcServerConf = &grpcServerConf{} - FileTemplateConf = &fileTemplateConf{} + WebConf = &webConf{} + LogConf = &logx.Conf{} + DbConf = &mysqlx.Conf{} + 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,7 +129,7 @@ _ = v.UnmarshalKey("db", DbConf) _ = v.UnmarshalKey("local", LocalConf) _ = v.UnmarshalKey("grpcServer", GrpcServerConf) - _ = v.UnmarshalKey("fileTemplate", FileTemplateConf) + _ = v.UnmarshalKey("dingTalk", DingTalkConf) showConfig() } @@ -128,6 +140,6 @@ log.Printf(" DbConf: %+v", DbConf) log.Printf(" LocalConf: %+v", LocalConf) log.Printf(" GrpcServerConf: %+v", GrpcServerConf) - log.Printf(" FileTemplateConf: %+v", FileTemplateConf) + log.Printf(" DingTalkConf: %+v", DingTalkConf) log.Println("......................................................") } -- Gitblit v1.8.0