Pavel Sinitsin
8c3541a892
Introduced a new method `GetTreeCategories` to provide a hierarchical structure for categories. Fixed typos in variable names and integrated utility functions for converting flat lists to nested dictionaries and vice versa. Added `TreeCategories` model for representing nested category structures.
16 lines
356 B
Go
16 lines
356 B
Go
package model
|
|
|
|
type Category struct {
|
|
Slug string `json:"slug"`
|
|
Name string `json:"name"`
|
|
Url string `json:"url"`
|
|
ApiUrl string `json:"apiUrl"`
|
|
}
|
|
|
|
type TreeCategories struct {
|
|
Slug string `json:"slug"`
|
|
Name string `json:"name"`
|
|
Url string `json:"url"`
|
|
Children []TreeCategories `json:"children"`
|
|
}
|