This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"kontor-api-gin/internal/helpers"
|
||||
"time"
|
||||
)
|
||||
|
||||
type StoryArc struct {
|
||||
ID string `gorm:"type:string;primary_key;" json:"id"`
|
||||
@@ -20,14 +23,14 @@ func (story_arc *StoryArc) TableName() string {
|
||||
}
|
||||
|
||||
type StoryArcDTO 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"`
|
||||
Name string `json:"name"`
|
||||
ComicID *string `json:"comic_id"`
|
||||
VolumeID *string `json:"volume_id"`
|
||||
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"`
|
||||
Name string `json:"name"`
|
||||
ComicID *string `json:"comic_id"`
|
||||
VolumeID *string `json:"volume_id"`
|
||||
}
|
||||
|
||||
func ConvertStoryArcsToDtos(storyarcs []StoryArc) []StoryArcDTO {
|
||||
@@ -35,8 +38,8 @@ func ConvertStoryArcsToDtos(storyarcs []StoryArc) []StoryArcDTO {
|
||||
for i, storyarc := range storyarcs {
|
||||
dtos[i] = StoryArcDTO{
|
||||
ID: storyarc.ID,
|
||||
CreatedAt: storyarc.CreatedAt,
|
||||
UpdatedAt: storyarc.UpdatedAt,
|
||||
CreatedAt: helpers.KontorTime{Time: storyarc.CreatedAt},
|
||||
UpdatedAt: helpers.KontorTime{Time: storyarc.UpdatedAt},
|
||||
DeletedAt: storyarc.DeletedAt,
|
||||
Version: storyarc.Version,
|
||||
Name: storyarc.Name,
|
||||
|
||||
Reference in New Issue
Block a user