liujiandao
2024-03-15 605b2f00d71ecd25660553b0be45b9b122fe8d65
model/grpc_init/crm_aps_init.go
@@ -10,6 +10,7 @@
var (
   ProductInventoryServiceConn *grpc.ClientConn
   CrmApsGrpcServiceConn       *grpc.ClientConn
   CrmSrmGrpcServiceConn       *grpc.ClientConn
)
func InitCrmApsGrpcServiceConn() {
@@ -41,3 +42,18 @@
      ProductInventoryServiceConn.Close()
   }
}
func InitCrmSrmGrpcServiceConn() {
   var err error
   CrmSrmGrpcServiceConn, err = grpc.Dial(conf.Conf.GrpcServiceAddr.SRM, grpc.WithTransportCredentials(insecure.NewCredentials()))
   if err != nil {
      logx.Errorf("grpc dial product service error: %v", err.Error())
      return
   }
}
func CloseCrmSrmGrpcServiceConn() {
   if CrmSrmGrpcServiceConn != nil {
      CrmSrmGrpcServiceConn.Close()
   }
}