bpiek/model/response.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

33 lines
801 B
Go

package model
type CategoryResponse struct {
Categories []Category `json:"categories"`
}
type CategoriesAndProductsBySlugParentCategoryResponse struct {
Date string `json:"date"`
Slug string `json:"slug"`
Name string `json:"name"`
Url string `json:"url"`
Categories []Category `json:"categories"`
Products []Product `json:"products"`
}
type NewProductsResponse struct {
Data struct {
Products []Product `json:"products"`
} `json:"data"`
Meta struct {
Page int `json:"page"`
TotalPages int `json:"totalPages"`
TotalCount int `json:"totalCount"`
PageSize int `json:"pageSize"`
} `json:"_meta"`
}
type RemainsAndPlanresiduesResponse struct {
Date string `json:"date"`
Products []ShortProduct `json:"products"`
}