| | |
| | | "google.golang.org/grpc" |
| | | "google.golang.org/grpc/credentials/insecure" |
| | | "strconv" |
| | | "strings" |
| | | ) |
| | | |
| | | type SalesDetailsApi struct{} |
| | |
| | | client := product_inventory.NewProductInventoryServiceClient(ProductInventoryServiceConn) |
| | | info, err := client.GetInventoryProductInfo(ctx.GetCtx(), &product_inventory.GetInventoryProductInfoRequest{Number: number}) |
| | | if err != nil { |
| | | if strings.Contains(err.Error(), "record not found") { |
| | | ctx.Ok() |
| | | return |
| | | } |
| | | logx.Errorf("GetProductInfo err: %v", err.Error()) |
| | | ctx.FailWithMsg(ecode.UnknownErr, "grpc调用错误") |
| | | return |