From 1d5cb2f03c706c4b1cc36f50fd431f98fdbe7101 Mon Sep 17 00:00:00 2001
From: jiangshuai <291802688@qq.com>
Date: 星期三, 13 十二月 2023 15:23:33 +0800
Subject: [PATCH] 对number的验证及不重复
---
main.go | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/main.go b/main.go
index c6017aa..1801bbf 100644
--- a/main.go
+++ b/main.go
@@ -11,11 +11,14 @@
"syscall"
"time"
"wms/conf"
- "wms/controllers"
"wms/models"
"wms/pkg/logx"
+ "wms/proto/init_client"
+ "wms/proto/inventory_order"
"wms/proto/product_inventory"
+ "wms/proto/purchase_wms"
"wms/router"
+ "wms/service"
)
func main() {
@@ -44,8 +47,12 @@
}
go shutdown(server)
//鍚姩grpc瀹㈡埛绔�
- go controllers.InitInventoryOrderServiceConn()
- go controllers.InitProductInventoryServiceConn()
+ //go controllers.InitInventoryOrderServiceConn()
+ //go controllers.InitProductInventoryServiceConn()
+ //go controllers.InitCodeServiceConn()
+ //go supplier.InitConn()
+ //go client.InitConn()
+ go init_client.InitClient()
//鍚姩grpc鏈嶅姟
go func() {
ln, err := net.Listen("tcp", ":"+conf.WebConf.GrpcPort)
@@ -57,12 +64,18 @@
s := grpc.NewServer()
//todo 娣诲姞鍏蜂綋鏈嶅姟
product_inventory.RegisterProductInventoryServiceServer(s, &product_inventory.Server{})
+ purchase_wms.RegisterPurchaseServiceServer(s, &purchase_wms.Server{})
+ inventory_order.RegisterInventoryOrderServiceServer(s, &inventory_order.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())
}
@@ -76,8 +89,12 @@
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
- controllers.CloseInventoryOrderServiceConn()
- controllers.CloseProductInventoryServiceConn()
+ //controllers.CloseInventoryOrderServiceConn()
+ //controllers.CloseProductInventoryServiceConn()
+ //controllers.CloseCodeServiceConn()
+ //supplier.CloseConn()
+ //client.CloseConn()
+ init_client.CloseClient()
// 鍏抽棴HTTP鏈嶅姟鍣�
if err := server.Shutdown(ctx); err != nil {
logx.Infof("鏈嶅姟浼橀泤閫�鍑哄け璐�: %v", err)
--
Gitblit v1.8.0