WIP: Export Kontor DB
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s

This commit is contained in:
Thomas Peetz
2026-10-01 17:40:17 +02:00
parent f5abb44466
commit 4aaf580735
47 changed files with 1101 additions and 369 deletions
+24 -15
View File
@@ -1,6 +1,9 @@
package models
import "time"
import (
"kontor-api-gin/internal/helpers"
"time"
)
type Issue struct {
ID string `gorm:"type:string;primary_key;" json:"id"`
@@ -26,16 +29,19 @@ func (issue *Issue) TableName() string {
}
type IssueDTO 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"`
PublishedOn time.Time `json:"published_on"`
ComicID *string `json:"comic_id"`
StoryArcID *string `json:"story_arc_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"`
IssueNumber string `json:"issue_number"`
Title string `json:"title"`
PublishedOn helpers.DateOnly `json:"published_on"`
InStock bool `json:"in_stock"`
IsRead bool `json:"is_read"`
ComicID *string `json:"comic_id"`
VolumeID *string `json:"volume_id"`
StoryArcID *string `json:"story_arc_id"`
}
func ConvertIssuesToDtos(issues []Issue) []IssueDTO {
@@ -43,15 +49,18 @@ func ConvertIssuesToDtos(issues []Issue) []IssueDTO {
for i, issue := range issues {
dtos[i] = IssueDTO{
ID: issue.ID,
CreatedAt: issue.CreatedAt,
UpdatedAt: issue.UpdatedAt,
CreatedAt: helpers.KontorTime{Time: issue.CreatedAt},
UpdatedAt: helpers.KontorTime{Time: issue.UpdatedAt},
DeletedAt: issue.DeletedAt,
Version: issue.Version,
IssueNumber: issue.IssueNumber,
Title: issue.Title,
PublishedOn: issue.PublishedOn,
PublishedOn: helpers.DateOnly{Time: issue.PublishedOn},
InStock: issue.InStock,
IsRead: issue.IsRead,
ComicID: issue.ComicID,
StoryArcID: issue.StoryArcID,
VolumeID: issue.VolumeID,
StoryArcID: issue.StoryArcID,
}
}
return dtos