From 313617ceb05dd5194d2091c717a25cbf33ef39b9 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期五, 24 十一月 2023 14:39:25 +0800 Subject: [PATCH] 新增history加入索引 --- main.go | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/main.go b/main.go index 0fb90de..91c2eeb 100644 --- a/main.go +++ b/main.go @@ -14,8 +14,12 @@ "wms/controllers" "wms/models" "wms/pkg/logx" + "wms/proto/client" "wms/proto/product_inventory" + "wms/proto/purchase_wms" + "wms/proto/supplier" "wms/router" + "wms/service" ) func main() { @@ -47,6 +51,8 @@ go controllers.InitInventoryOrderServiceConn() go controllers.InitProductInventoryServiceConn() go controllers.InitCodeServiceConn() + go supplier.InitConn() + go client.InitConn() //鍚姩grpc鏈嶅姟 go func() { ln, err := net.Listen("tcp", ":"+conf.WebConf.GrpcPort) @@ -58,12 +64,17 @@ s := grpc.NewServer() //todo 娣诲姞鍏蜂綋鏈嶅姟 product_inventory.RegisterProductInventoryServiceServer(s, &product_inventory.Server{}) + purchase_wms.RegisterPurchaseServiceServer(s, &purchase_wms.Server{}) err = s.Serve(ln) if err != nil { logx.Errorf("grpc server init error: %v", err.Error()) panic(fmt.Sprintf("grpc server init error: %v", err.Error())) } }() + + go service.InitLocationReportData() + go service.InitHistoryReportData() + logx.Error(server.ListenAndServe().Error()) } @@ -80,6 +91,8 @@ controllers.CloseInventoryOrderServiceConn() controllers.CloseProductInventoryServiceConn() controllers.CloseCodeServiceConn() + supplier.CloseConn() + client.CloseConn() // 鍏抽棴HTTP鏈嶅姟鍣� if err := server.Shutdown(ctx); err != nil { logx.Infof("鏈嶅姟浼橀泤閫�鍑哄け璐�: %v", err) -- Gitblit v1.8.0