update
This commit is contained in:
parent
79e60fc242
commit
de5b8ddad7
@ -2,7 +2,6 @@ package ui
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@ -22,17 +21,16 @@ func GetProductPrice(srv *service.PriceService, prodID int) (*def.ProductPriceRe
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
res.Price = price
|
||||
// CalculateProductPrice(srv, prodID, res.Price)
|
||||
fmt.Printf("SAving to cache: %s", key)
|
||||
srv.SaveToCache(ctx, key, res.Price, 30*time.Second) // FIXME refactor as cache service sth
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// CalculateProductPrice mock
|
||||
func CalculateProductPrice(srv *service.PriceService, prodID int, price float64) (float64, error) {
|
||||
|
||||
// customer := srv.GetCustomer(customerID)
|
||||
// customerPromo := srv.GetCustomerPromotions(customer)
|
||||
// customerDiscount := srv.GetCustomerDiscounts(customer)
|
||||
|
Loading…
Reference in New Issue
Block a user