This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"kontor-api-gin/internal/helpers"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -28,16 +29,16 @@ func (comic *Comic) TableName() string {
|
||||
}
|
||||
|
||||
type ComicDTO struct {
|
||||
ID string `json:"id" binding:"required"`
|
||||
CreatedAt time.Time `json:"created_date"`
|
||||
UpdatedAt time.Time `json:"last_modified_date"`
|
||||
DeletedAt *time.Time `json:"deleted_date,omitempty"`
|
||||
Version int `json:"version"`
|
||||
Title string `json:"title"`
|
||||
PublisherID *string `json:"publisher_id"`
|
||||
CurrentOrder bool `json:"current_order"`
|
||||
Completed bool `json:"completed"`
|
||||
WebLink string `json:"weblink"`
|
||||
ID string `json:"id" binding:"required"`
|
||||
CreatedAt helpers.KontorTime `json:"created_date"`
|
||||
UpdatedAt helpers.KontorTime `json:"last_modified_date"`
|
||||
DeletedAt *time.Time `json:"deleted_date,omitempty"`
|
||||
Version int `json:"version"`
|
||||
Title string `json:"title"`
|
||||
PublisherID *string `json:"publisher_id"`
|
||||
CurrentOrder bool `json:"current_order"`
|
||||
Completed bool `json:"completed"`
|
||||
WebLink string `json:"weblink"`
|
||||
}
|
||||
|
||||
func ConvertComicsToDtos(comics []Comic) []ComicDTO {
|
||||
@@ -45,8 +46,8 @@ func ConvertComicsToDtos(comics []Comic) []ComicDTO {
|
||||
for i, comic := range comics {
|
||||
dtos[i] = ComicDTO{
|
||||
ID: comic.ID,
|
||||
CreatedAt: comic.CreatedAt,
|
||||
UpdatedAt: comic.UpdatedAt,
|
||||
CreatedAt: helpers.KontorTime{Time: comic.CreatedAt},
|
||||
UpdatedAt: helpers.KontorTime{Time: comic.UpdatedAt},
|
||||
DeletedAt: comic.DeletedAt,
|
||||
Version: comic.Version,
|
||||
Title: comic.Title,
|
||||
|
||||
Reference in New Issue
Block a user