50 lines
1.1 KiB
Go
Executable File
50 lines
1.1 KiB
Go
Executable File
package category
|
|
|
|
import "time"
|
|
|
|
type DataCategoryDTO struct {
|
|
Categories []CategoryDTO `json:"categories"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
type Language struct {
|
|
Tm string `json:"tm"`
|
|
Ru string `json:"ru"`
|
|
En string `json:"en"`
|
|
}
|
|
|
|
type CategoryDTO struct {
|
|
Id int `json:"Id"`
|
|
Name Language `json:"name"`
|
|
SubName []Language `json:"subCategories"`
|
|
Status bool `json:"status"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type AddCategoryDTO struct {
|
|
Name Language `json:"name" binding:"required"`
|
|
}
|
|
|
|
type UpdateCategoryDTO struct {
|
|
Name Language `json:"name" binding:"required"`
|
|
// Status intentionally has no "required" binding: the validator treats
|
|
// false as a missing value, which would make it impossible to update a
|
|
// disabled category.
|
|
Status bool `json:"status"`
|
|
}
|
|
|
|
type CategoryIdDTO struct {
|
|
Id int `json:"Id"`
|
|
Name Language `json:"name"`
|
|
Status bool `json:"status"`
|
|
}
|
|
|
|
type PaginationDTO struct {
|
|
Limit int `json:"limit"`
|
|
Page int `json:"page"`
|
|
}
|
|
|
|
type ReqIdDTO struct {
|
|
Id int `json:"Id"`
|
|
}
|