47 lines
1.4 KiB
Go
47 lines
1.4 KiB
Go
package menuService
|
|
|
|
import "git.ma-al.com/goc_daniel/b2b/repository/categoriesRepo"
|
|
|
|
type MenuService struct {
|
|
categoriesRepo categoriesRepo.UICategoriesRepo
|
|
}
|
|
|
|
func New() *MenuService {
|
|
return &MenuService{
|
|
categoriesRepo: categoriesRepo.New(),
|
|
}
|
|
}
|
|
|
|
func (s *MenuService) GetMenu() (string, error) {
|
|
// var menu_json string
|
|
|
|
// products, err := s.listProductsRepo.GetListing(id_shop, id_lang, p, filters)
|
|
// if err != nil {
|
|
// return products, err
|
|
// }
|
|
|
|
// var loopErr error
|
|
// parallel.ForEach(products.Items, func(t model.Product, i int) {
|
|
// // products.Items[i].PriceTaxed *= currRate.Rate.InexactFloat64()
|
|
// // products.Items[i].PriceTaxed = tiny_util.RoundUpMonetary(products.Items[i].PriceTaxed)
|
|
|
|
// if products.Items[i].Name.IsNull() {
|
|
// translation, err := s.listProductsRepo.GetTranslation(ctx, products.Items[i].ID, defaults.DefaultLanguageID)
|
|
// if err != nil {
|
|
// loopErr = err
|
|
// return
|
|
// }
|
|
// products.Items[i].Name = nullable.FromPrimitiveString(translation.Name)
|
|
// products.Items[i].DescriptionShort = nullable.FromPrimitiveString(translation.DescriptionShort)
|
|
// products.Items[i].LinkRewrite = nullable.FromPrimitiveString(translation.LinkRewrite)
|
|
// }
|
|
// })
|
|
// if loopErr != nil {
|
|
// return products, errs.Handled(span, loopErr, errs.InternalError, errs.ERR_TODO)
|
|
// }
|
|
|
|
// return products, nil
|
|
|
|
return "", nil
|
|
}
|