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
+17 -14
View File
@@ -1,6 +1,9 @@
package models
import "time"
import (
"kontor-api-gin/internal/helpers"
"time"
)
type MediaLoFi struct {
ID string `gorm:"type:string;primary_key;" json:"id"`
@@ -11,7 +14,7 @@ type MediaLoFi struct {
WebLink string `gorm:"column:url" json:"url"`
Review bool `gorm:"column:review" json:"review"`
ShouldDownload bool `gorm:"column:should_download" json:"should_download"`
Title string `gorm:"size:300, column:title" json:"title"`
Title string `gorm:"size:300;column:title" json:"title"`
FileName string `gorm:"column:file_name" json:"file_name"`
}
@@ -20,16 +23,16 @@ func (media_lofi *MediaLoFi) TableName() string {
}
type MediaLoFiDTO 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"`
Version int `json:"version"`
WebLink string `json:"url"`
Review bool `json:"review"`
ShouldDownload bool `json:"should_download"`
Title string `json:"title"`
FileName string `json:"file_name"`
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"`
FileName string `json:"file_name"`
Review bool `json:"review"`
ShouldDownload bool `json:"should_download"`
Title string `json:"title"`
WebLink string `json:"url"`
}
func ConvertMediaLoFisToDtos(media_lofis []MediaLoFi) []MediaLoFiDTO {
@@ -37,8 +40,8 @@ func ConvertMediaLoFisToDtos(media_lofis []MediaLoFi) []MediaLoFiDTO {
for i, media_lofi := range media_lofis {
dtos[i] = MediaLoFiDTO{
ID: media_lofi.ID,
CreatedAt: media_lofi.CreatedAt,
UpdatedAt: media_lofi.UpdatedAt,
CreatedAt: helpers.KontorTime{Time: media_lofi.CreatedAt},
UpdatedAt: helpers.KontorTime{Time: media_lofi.UpdatedAt},
DeletedAt: media_lofi.DeletedAt,
Version: media_lofi.Version,
WebLink: media_lofi.WebLink,