add models generation and josn print
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
package menuService
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"git.ma-al.com/goc_daniel/b2b/app/db"
|
||||
"git.ma-al.com/goc_daniel/b2b/app/model"
|
||||
"git.ma-al.com/goc_daniel/b2b/app/model/prestadb"
|
||||
"git.ma-al.com/goc_daniel/b2b/app/repos/categoriesRepo"
|
||||
routesRepo "git.ma-al.com/goc_daniel/b2b/app/repos/routesRepo"
|
||||
"git.ma-al.com/goc_daniel/b2b/app/utils/jsonprint"
|
||||
"git.ma-al.com/goc_daniel/b2b/app/utils/responseErrors"
|
||||
)
|
||||
|
||||
@@ -28,10 +30,6 @@ func (s *MenuService) GetMenu(id_lang uint) (*model.Category, error) {
|
||||
return &model.Category{}, err
|
||||
}
|
||||
|
||||
fmt.Printf("all_categories: %v\n", all_categories)
|
||||
|
||||
fmt.Printf("id_lang: %v\n", id_lang)
|
||||
|
||||
// find the root
|
||||
root_index := 0
|
||||
root_found := false
|
||||
@@ -80,6 +78,16 @@ func (s *MenuService) createTree(index int, all_categories *([]model.ScannedCate
|
||||
|
||||
func (s *MenuService) GetRoutes(id_lang uint) ([]model.Route, error) {
|
||||
|
||||
type XX struct {
|
||||
prestadb.PsProduct
|
||||
// PsProductLang prestadb.PsProductLang `gorm:"foreignKey:IDProduct;references:IDProduct"`
|
||||
// PSProductAttribute prestadb.PsProductAttribute `gorm:"foreignKey:IDProduct;references:IDProduct"`
|
||||
}
|
||||
product := XX{}
|
||||
db.Get().Debug().Find(&product, prestadb.PsCategoryProduct{IDProduct: 53})
|
||||
// fmt.Printf("%v\n nnnnnnnn", product)
|
||||
jsonprint.Print(product)
|
||||
|
||||
return s.routesRepo.GetRoutes(id_lang)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user