bpiek/model/response.go
Pavel Sinitsin cea1f96bb4
Refactor credential handling and improve parsing logic
Deleted client/credential.go and moved the Credentials struct to the api package for better modularity. Enhanced type safety in api by checking type assertions and added detailed comments in model structs.
2024-09-08 13:50:05 +03:00

33 lines
1.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
type CategoryResponse struct {
Categories []Category `json:"categories"` // Массив категорий 1-го уровня
}
type CategoriesAndProductsBySlugParentCategoryResponse struct {
Date string `json:"date"` // Дата формирования файла
Slug string `json:"slug"` // Слаг категории 1-го уровня
Name string `json:"name"` // Название категории 1-го уровня
Url string `json:"url"` // Относительный адрес категории 1-го уровня
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"` // Массив остатков по товарам
}