mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Model refactor (#3915)
* Add mockery config file * Move basic file/folder structs to models * Fix hack due to import loop * Move file interfaces to models * Move folder interfaces to models * Move scene interfaces to models * Move scene marker interfaces to models * Move image interfaces to models * Move gallery interfaces to models * Move gallery chapter interfaces to models * Move studio interfaces to models * Move movie interfaces to models * Move performer interfaces to models * Move tag interfaces to models * Move autotag interfaces to models * Regenerate mocks
This commit is contained in:
55
pkg/models/repository_gallery_chapter.go
Normal file
55
pkg/models/repository_gallery_chapter.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package models
|
||||
|
||||
import "context"
|
||||
|
||||
// GalleryChapterGetter provides methods to get gallery chapters by ID.
|
||||
type GalleryChapterGetter interface {
|
||||
// TODO - rename this to Find and remove existing method
|
||||
FindMany(ctx context.Context, ids []int) ([]*GalleryChapter, error)
|
||||
Find(ctx context.Context, id int) (*GalleryChapter, error)
|
||||
}
|
||||
|
||||
// GalleryChapterFinder provides methods to find gallery chapters.
|
||||
type GalleryChapterFinder interface {
|
||||
GalleryChapterGetter
|
||||
FindByGalleryID(ctx context.Context, galleryID int) ([]*GalleryChapter, error)
|
||||
}
|
||||
|
||||
// GalleryChapterCreator provides methods to create gallery chapters.
|
||||
type GalleryChapterCreator interface {
|
||||
Create(ctx context.Context, newGalleryChapter *GalleryChapter) error
|
||||
}
|
||||
|
||||
// GalleryChapterUpdater provides methods to update gallery chapters.
|
||||
type GalleryChapterUpdater interface {
|
||||
Update(ctx context.Context, updatedGalleryChapter *GalleryChapter) error
|
||||
UpdatePartial(ctx context.Context, id int, updatedGalleryChapter GalleryChapterPartial) (*GalleryChapter, error)
|
||||
}
|
||||
|
||||
// GalleryChapterDestroyer provides methods to destroy gallery chapters.
|
||||
type GalleryChapterDestroyer interface {
|
||||
Destroy(ctx context.Context, id int) error
|
||||
}
|
||||
|
||||
type GalleryChapterCreatorUpdater interface {
|
||||
GalleryChapterCreator
|
||||
GalleryChapterUpdater
|
||||
}
|
||||
|
||||
// GalleryChapterReader provides all methods to read gallery chapters.
|
||||
type GalleryChapterReader interface {
|
||||
GalleryChapterFinder
|
||||
}
|
||||
|
||||
// GalleryChapterWriter provides all methods to modify gallery chapters.
|
||||
type GalleryChapterWriter interface {
|
||||
GalleryChapterCreator
|
||||
GalleryChapterUpdater
|
||||
GalleryChapterDestroyer
|
||||
}
|
||||
|
||||
// GalleryChapterReaderWriter provides all gallery chapter methods.
|
||||
type GalleryChapterReaderWriter interface {
|
||||
GalleryChapterReader
|
||||
GalleryChapterWriter
|
||||
}
|
||||
Reference in New Issue
Block a user