@@ -1,11 +1,12 @@
|
||||
package cart
|
||||
|
||||
import (
|
||||
"cake_crm/internal/modules/storage"
|
||||
"cake_crm/proto"
|
||||
"context"
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"cake_crm/internal/modules/storage"
|
||||
"cake_crm/proto"
|
||||
)
|
||||
|
||||
type ProductAndCount struct {
|
||||
@@ -54,6 +55,7 @@ func (s *Service) GetCart(ctx context.Context, items []*proto.OrderItem) (*proto
|
||||
Count: item.Count,
|
||||
Amount: amount,
|
||||
AmountOld: amountOld,
|
||||
Discount: amountOld - amount,
|
||||
Variants: product.Variants,
|
||||
Labels: product.Labels,
|
||||
},
|
||||
@@ -65,6 +67,7 @@ func (s *Service) GetCart(ctx context.Context, items []*proto.OrderItem) (*proto
|
||||
Items: res,
|
||||
Amount: cartAmount,
|
||||
AmountOld: cartAmountOld,
|
||||
Discount: cartAmountOld - cartAmount,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
POST http://0.0.0.0:8090/cart
|
||||
User-Agent: crabs/1.0.0
|
||||
|
||||
[
|
||||
{
|
||||
"productId": 1,
|
||||
"count": 20
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user