| | |
| | | "google.golang.org/grpc/credentials/insecure" |
| | | ) |
| | | |
| | | var CrmApsGrpcServiceConn *grpc.ClientConn |
| | | var ( |
| | | ProductInventoryServiceConn *grpc.ClientConn |
| | | CrmApsGrpcServiceConn *grpc.ClientConn |
| | | ) |
| | | |
| | | func InitCrmApsGrpcServiceConn() { |
| | | var err error |
| | |
| | | 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() |
| | | } |
| | | } |