bpiek/model/category.go
Pavel Sinitsin 8c3541a892
Add tree structure to categories API
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.
2024-09-07 21:18:36 +03:00

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"`
}