2020-09-15 07:28:53 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
type TagReader interface {
|
|
|
|
Find(id int) (*Tag, error)
|
|
|
|
FindMany(ids []int) ([]*Tag, error)
|
|
|
|
FindBySceneID(sceneID int) ([]*Tag, error)
|
2021-03-10 01:25:51 +00:00
|
|
|
FindByPerformerID(performerID int) ([]*Tag, error)
|
2020-09-15 07:28:53 +00:00
|
|
|
FindBySceneMarkerID(sceneMarkerID int) ([]*Tag, error)
|
2020-10-12 23:12:46 +00:00
|
|
|
FindByImageID(imageID int) ([]*Tag, error)
|
|
|
|
FindByGalleryID(galleryID int) ([]*Tag, error)
|
2020-09-20 08:36:02 +00:00
|
|
|
FindByName(name string, nocase bool) (*Tag, error)
|
|
|
|
FindByNames(names []string, nocase bool) ([]*Tag, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Count() (int, error)
|
2020-09-15 07:28:53 +00:00
|
|
|
All() ([]*Tag, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Query(tagFilter *TagFilterType, findFilter *FindFilterType) ([]*Tag, int, error)
|
|
|
|
GetImage(tagID int) ([]byte, error)
|
2020-09-15 07:28:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type TagWriter interface {
|
2020-09-20 08:36:02 +00:00
|
|
|
Create(newTag Tag) (*Tag, error)
|
|
|
|
Update(updatedTag Tag) (*Tag, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Destroy(id int) error
|
|
|
|
UpdateImage(tagID int, image []byte) error
|
|
|
|
DestroyImage(tagID int) error
|
2020-09-15 07:28:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type TagReaderWriter interface {
|
|
|
|
TagReader
|
|
|
|
TagWriter
|
|
|
|
}
|