umstellung auf Service und Repository Verwendung - WIP
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
Reference in New Issue
Block a user