Encode title as JSON text so create/list work with pgx, and keep the table migration permission-free so rows are added from admin. Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
892 B
Go
41 lines
892 B
Go
package mini_slider
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type DataMiniSliderDTO struct {
|
|
MiniSliders []MiniSliderListItemDTO `json:"miniSliders"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
type Language struct {
|
|
Tm string `json:"tm"`
|
|
Ru string `json:"ru"`
|
|
En string `json:"en"`
|
|
}
|
|
|
|
type MiniSliderListItemDTO struct {
|
|
Id int `json:"Id"`
|
|
Title Language `json:"title"`
|
|
Image string `json:"imagePath"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type GetMiniSliderDTO struct {
|
|
Id int `json:"Id"`
|
|
Title Language `json:"title"`
|
|
Image string `json:"imagePath"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type AddMiniSliderDTO struct {
|
|
Title Language `json:"title" binding:"required"`
|
|
Image string `json:"imagePath"`
|
|
}
|
|
|
|
type UpdateMiniSliderDTO struct {
|
|
Title Language `json:"title" binding:"required"`
|
|
Image string `json:"imagePath"`
|
|
}
|