2020-09-15 07:28:53 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
type StudioReader interface {
|
|
|
|
Find(id int) (*Studio, error)
|
|
|
|
FindMany(ids []int) ([]*Studio, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
FindChildren(id int) ([]*Studio, error)
|
2020-09-20 08:36:02 +00:00
|
|
|
FindByName(name string, nocase bool) (*Studio, error)
|
2021-11-14 20:51:52 +00:00
|
|
|
FindByStashID(stashID StashID) ([]*Studio, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Count() (int, error)
|
2020-09-15 07:28:53 +00:00
|
|
|
All() ([]*Studio, error)
|
2021-04-26 02:51:31 +00:00
|
|
|
// TODO - this interface is temporary until the filter schema can fully
|
|
|
|
// support the query needed
|
|
|
|
QueryForAutoTag(words []string) ([]*Studio, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Query(studioFilter *StudioFilterType, findFilter *FindFilterType) ([]*Studio, int, error)
|
|
|
|
GetImage(studioID int) ([]byte, error)
|
|
|
|
HasImage(studioID int) (bool, error)
|
|
|
|
GetStashIDs(studioID int) ([]*StashID, error)
|
2021-09-09 08:13:42 +00:00
|
|
|
GetAliases(studioID int) ([]string, error)
|
2020-09-15 07:28:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type StudioWriter interface {
|
2020-09-20 08:36:02 +00:00
|
|
|
Create(newStudio Studio) (*Studio, error)
|
|
|
|
Update(updatedStudio StudioPartial) (*Studio, error)
|
|
|
|
UpdateFull(updatedStudio Studio) (*Studio, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Destroy(id int) error
|
|
|
|
UpdateImage(studioID int, image []byte) error
|
|
|
|
DestroyImage(studioID int) error
|
|
|
|
UpdateStashIDs(studioID int, stashIDs []StashID) error
|
2021-09-09 08:13:42 +00:00
|
|
|
UpdateAliases(studioID int, aliases []string) error
|
2020-09-15 07:28:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type StudioReaderWriter interface {
|
|
|
|
StudioReader
|
|
|
|
StudioWriter
|
|
|
|
}
|