2020-09-15 07:28:53 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
type MovieReader interface {
|
|
|
|
Find(id int) (*Movie, error)
|
|
|
|
FindMany(ids []int) ([]*Movie, error)
|
|
|
|
// FindBySceneID(sceneID int) ([]*Movie, error)
|
2020-09-20 08:36:02 +00:00
|
|
|
FindByName(name string, nocase bool) (*Movie, error)
|
|
|
|
FindByNames(names []string, nocase bool) ([]*Movie, error)
|
2020-09-15 07:28:53 +00:00
|
|
|
All() ([]*Movie, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Count() (int, error)
|
|
|
|
AllSlim() ([]*Movie, error)
|
|
|
|
Query(movieFilter *MovieFilterType, findFilter *FindFilterType) ([]*Movie, int, error)
|
2020-09-15 07:28:53 +00:00
|
|
|
GetFrontImage(movieID int) ([]byte, error)
|
|
|
|
GetBackImage(movieID int) ([]byte, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type MovieWriter interface {
|
2020-09-20 08:36:02 +00:00
|
|
|
Create(newMovie Movie) (*Movie, error)
|
|
|
|
Update(updatedMovie MoviePartial) (*Movie, error)
|
|
|
|
UpdateFull(updatedMovie Movie) (*Movie, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Destroy(id int) error
|
|
|
|
UpdateImages(movieID int, frontImage []byte, backImage []byte) error
|
|
|
|
DestroyImages(movieID int) error
|
2020-09-15 07:28:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type MovieReaderWriter interface {
|
|
|
|
MovieReader
|
|
|
|
MovieWriter
|
|
|
|
}
|