From 4f526b034a6e13a521ad71dcbdbea97043d6ea19 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 20 三月 2024 19:21:20 +0800 Subject: [PATCH] 发货信息字段完善 --- model/grpc_init/crm_aps_init.go | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/model/grpc_init/crm_aps_init.go b/model/grpc_init/crm_aps_init.go index 6e82ec6..233b851 100644 --- a/model/grpc_init/crm_aps_init.go +++ b/model/grpc_init/crm_aps_init.go @@ -7,7 +7,10 @@ "google.golang.org/grpc/credentials/insecure" ) -var CrmApsGrpcServiceConn *grpc.ClientConn +var ( + ProductInventoryServiceConn *grpc.ClientConn + CrmApsGrpcServiceConn *grpc.ClientConn +) func InitCrmApsGrpcServiceConn() { var err error @@ -23,3 +26,18 @@ CrmApsGrpcServiceConn.Close() } } + +func InitProductInventoryServiceConn() { + var err error + ProductInventoryServiceConn, err = grpc.Dial(conf.Conf.GrpcServiceAddr.WMS, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + logx.Errorf("grpc dial product service error: %v", err.Error()) + return + } +} + +func CloseProductInventoryServiceConn() { + if ProductInventoryServiceConn != nil { + ProductInventoryServiceConn.Close() + } +} -- Gitblit v1.8.0