Pavel Sinitsin
e14d4b188b
This commit introduces new API and client modules that provide functionality for managing categories and products. It includes the creation of `.gitignore`, necessary data models, API endpoints, and client authentication using go-resty. This forms the foundation for further enhancements to the category and product management features.
38 lines
890 B
Go
38 lines
890 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"`
|
|
}
|
|
|
|
type TreeCategoriesResponse struct {
|
|
Category
|
|
Children []Category `json:"children"`
|
|
}
|