umstellung auf Service und Repository Verwendung - WIP
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
Thomas Peetz
2026-09-25 16:57:23 +02:00
parent 131296c644
commit f0f1819a1f
42 changed files with 998 additions and 351 deletions
@@ -0,0 +1,21 @@
package comics
import "time"
type Artist struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
Name string `gorm:"uniqueIndex" json:"name"`
WebLink string `gorm:"column:weblink" json:"weblink"`
}
func (artist *Artist) TableName() string {
return "artist"
}
type CreateArtistDTO struct {
Name string `json:"name" binding:"required"`
}
@@ -0,0 +1,38 @@
package comics
import (
"time"
)
type Comic struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
Title string `gorm:"uniqueIndex" json:"title"`
CurrentOrder bool `gorm:"column:current_order" json:"current_order"`
Completed bool `gorm:"column:completed" json:"completed"`
WebLink string `gorm:"column:weblink" json:"weblink"`
PublisherID *string `gorm:"column:publisher_id" json:"publisher_id"`
Issues []Issue `gorm:"foreignKey:ComicID"`
StoryArcs []StoryArc `gorm:"foreignKey:ComicID"`
TradePaperbacks []TradePaperback `gorm:"foreignKey:ComicID"`
Volumes []Volume `gorm:"foreignKey:ComicID"`
ComicWorks []ComicWork `gorm:"foreignKey:ComicID"`
}
func (comic *Comic) TableName() string {
return "comic"
}
type CreateComicDTO struct {
Title string `json:"title" binding:"required"`
}
type UpdateComicDTO struct {
Title *string `json:"title,omitempty" binding:"omitempty"`
WebLink *string `json:"weblink,omitempty" binding:"omitempty"`
Completed *bool `json:"cimpleted,omitempty" binding:"omitempty"`
CurrentOrder *bool `json:"current_order,omitempty" binding:"omitempty"`
}
@@ -0,0 +1,21 @@
package comics
import "time"
type ComicWork struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
ArtistID *string `gorm:"column:artist_id" json:"artist_id"`
Artist *Artist `gorm:"foreignKey:ArtistID"`
ComicID *string `gorm:"column:comic_id" json:"comic_id"`
Comic *Comic `gorm:"foreignKey:ComicID"`
WorkTypeID *string `gorm:"column:work_type_id" json:"work_type_id"`
WorkType *WorkType `gorm:"foreignKey:WorkTypeID"`
}
func (comic_work *ComicWork) TableName() string {
return "comic_work"
}
@@ -0,0 +1,26 @@
package comics
import "time"
type Issue struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
InStock bool `gorm:"column:in_stock" json:"in_stock"`
IsRead bool `gorm:"column:is_read" json:"is_read"`
IssueNumber string `gorm:"column:issue_number" json:"issue_number"`
Title string `gorm:"column:title" json:"title"`
PublishedOn time.Time `gorm:"column:published_on" json:"published_on"`
ComicID *string `gorm:"column:comic_id" json:"comic_id"`
Comic *Comic `gorm:"foreignKey:ComicID"`
StoryArcID *string `gorm:"column:story_arc_id" json:"story_arc_id"`
StoryArc *StoryArc `gorm:"foreignKey:StoryArcID"`
VolumeID *string `gorm:"column:volume_id" json:"volume_id"`
Volume *Volume `gorm:"foreignKey:VolumeID"`
}
func (issue *Issue) TableName() string {
return "issue"
}
@@ -0,0 +1,21 @@
package comics
import "time"
type IssueWork struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
ArtistID *string `gorm:"column:artist_id" json:"artist_id"`
Artist *Artist `gorm:"foreignKey:ArtistID"`
IssueID *string `gorm:"column:issue_id" json:"issue_id"`
Issue *Issue `gorm:"foreignKey:IssueID"`
WorkTypeID *string `gorm:"column:work_type_id" json:"work_type_id"`
WorkType *WorkType `gorm:"foreignKey:WorkTypeID"`
}
func (issue_work *IssueWork) TableName() string {
return "issue_work"
}
@@ -0,0 +1,26 @@
package comics
import "time"
type Publisher struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
Name string `gorm:"uniqueIndex" json:"name"`
WebLink string `gorm:"column:weblink" json:"weblink"`
ParentPublisherID *string `gorm:"column:parent_publisher_id" json:"parent_publisher_id"`
ParentPublisher *Publisher `gorm:"foreignKey:ParentPublisherID"`
Imprints []Publisher `gorm:"foreignKey:ParentPublisherID"`
Comics []Comic `gorm:"foreignKey:PublisherID"`
}
func (publisher *Publisher) TableName() string {
return "publisher"
}
type CreatePublisherDTO struct {
Name string `json:"name" binding:"required"`
WebLink string `json:"weblink" binding:"required"`
}
@@ -0,0 +1,20 @@
package comics
import "time"
type StoryArc struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
Name string `gorm:"uniqueIndex" json:"name"`
ComicID *string `gorm:"column:comic_id" json:"comic_id"`
Comic *Comic `gorm:"foreignKey:ComicID"`
VolumeID *string `gorm:"column:volume_id" json:"volume_id"`
Volume *Volume `gorm:"foreignKey:VolumeID"`
}
func (story_arc *StoryArc) TableName() string {
return "story_arc"
}
@@ -0,0 +1,20 @@
package comics
import "time"
type TradePaperback struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
Name string `gorm:"uniqueIndex" json:"name"`
IssueStart int `gorm:"column:issue_start" json:"issue_start"`
IssueEnd int `gorm:"column:issue_end" json:"issue_end"`
ComicID *string `gorm:"column:comic_id" json:"comic_id"`
Comic *Comic `gorm:"foreignKey:ComicID"`
}
func (trade_paperback *TradePaperback) TableName() string {
return "trade_paperback"
}
@@ -0,0 +1,18 @@
package comics
import "time"
type Volume struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
Name string `gorm:"uniqueIndex" json:"name"`
ComicID *string `gorm:"column:comic_id" json:"comic_id"`
Comic *Comic `gorm:"foreignKey:ComicID"`
}
func (volume *Volume) TableName() string {
return "volume"
}
@@ -0,0 +1,16 @@
package comics
import "time"
type WorkType struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `gorm:"column:created_date" json:"created_date"`
UpdatedAt time.Time `gorm:"column:last_modified_date" json:"last_modified_date"`
DeletedAt *time.Time `gorm:"column:deleted_date" json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
Name string `gorm:"uniqueIndex" json:"name"`
}
func (worktype *WorkType) TableName() string {
return "worktype"
}