add carousel & test submenu
This commit is contained in:
parent
edcccaaab9
commit
7102f644d4
7 changed files with 242 additions and 314 deletions
|
|
@ -426,6 +426,24 @@ func (d *Data) GetToppingsOfRecipe(countryID, filename string, productCode strin
|
|||
return recipe.ToppingSet, nil
|
||||
}
|
||||
|
||||
func (d *Data) GetSubmenusOfRecipe(countryID, filename, productCode string) ([]models.Recipe01, error) {
|
||||
recipe, err := d.GetRecipe01ByProductCode(filename, countryID, productCode)
|
||||
|
||||
if err != nil {
|
||||
d.taoLogger.Log.Error("Error when read recipe file, Return default recipe", zap.Error(err))
|
||||
return []models.Recipe01{}, err
|
||||
}
|
||||
|
||||
submenu := recipe.SubMenu
|
||||
|
||||
if submenu == nil {
|
||||
return []models.Recipe01{}, fmt.Errorf("no submenu")
|
||||
}
|
||||
|
||||
return submenu, nil
|
||||
|
||||
}
|
||||
|
||||
func (d *Data) GetCountryNameByID(countryID string) (string, error) {
|
||||
for _, country := range d.Countries {
|
||||
if country.CountryID == countryID {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue