feat(deps): Add support for more departments

This commit is contained in:
pakintada@gmail.com 2024-06-19 13:56:56 +07:00
parent bdf2fac1ad
commit 4369ebb2a5
19 changed files with 296 additions and 169 deletions

View file

@ -183,6 +183,22 @@ var (
CountryID: "aus",
CountryName: "Australia",
},
{
CountryID: "dubai",
CountryName: "UAE Dubai",
},
{
CountryID: "counter01",
CountryName: "Counter Cafe",
},
{
CountryID: "sgp",
CountryName: "Singapore",
},
{
CountryID: "cocktail_tha",
CountryName: "Cocktail",
},
}
)
@ -304,6 +320,8 @@ func NewData(taoLogger *logger.TaoLogger, redisClient *RedisCli) *Data {
// log.Panic("Error when read default recipe file:", err)
// }
fmt.Println(CurrentCountryIDMap)
return &Data{
CurrentFile: currentFileMap,
CurrentCountryID: CurrentCountryIDMap,
@ -1178,9 +1196,11 @@ func (d *Data) GetSubmenusOfRecipe(countryID, filename, productCode string) ([]m
func (d *Data) GetCountryNameByID(countryID string) (string, error) {
for _, country := range d.Countries {
if country.CountryID == countryID {
fmt.Println("Found " + countryID)
return country.CountryName, nil
}
}
fmt.Println("Not found " + countryID)
return "", fmt.Errorf("country ID: %s not found", countryID)
}

Binary file not shown.