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
+13 -10
View File
@@ -1,6 +1,9 @@
package models
import "time"
import (
"kontor-api-gin/internal/helpers"
"time"
)
type Volume struct {
ID string `gorm:"type:string;primary_key;" json:"id"`
@@ -18,13 +21,13 @@ func (volume *Volume) TableName() string {
}
type VolumeDTO 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"`
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"`
}
func ConvertVolumesToDtos(volumes []Volume) []VolumeDTO {
@@ -32,8 +35,8 @@ func ConvertVolumesToDtos(volumes []Volume) []VolumeDTO {
for i, volume := range volumes {
dtos[i] = VolumeDTO{
ID: volume.ID,
CreatedAt: volume.CreatedAt,
UpdatedAt: volume.UpdatedAt,
CreatedAt: helpers.KontorTime{Time: volume.CreatedAt},
UpdatedAt: helpers.KontorTime{Time: volume.UpdatedAt},
DeletedAt: volume.DeletedAt,
Version: volume.Version,
Name: volume.Name,