Documentation ¶
Index ¶
- type MediaService
- type MediaServiceImpl
- func (s MediaServiceImpl) CreateMediaIndex(indexes map[string]interface{}) error
- func (s MediaServiceImpl) DeleteManyMedia(filter interface{}) error
- func (s MediaServiceImpl) DeleteMedia(filter interface{}) error
- func (s MediaServiceImpl) DeleteMediaByDirectory(ownerUserId uuid.UUID, directory string) error
- func (s MediaServiceImpl) DeleteMediaByOwner(ownerUserId uuid.UUID, mediaId uuid.UUID) error
- func (s MediaServiceImpl) FindByDirectory(ownerUserId uuid.UUID, directory string, limit int64, skip int64) ([]dto.Media, error)
- func (s MediaServiceImpl) FindById(objectId uuid.UUID) (*dto.Media, error)
- func (s MediaServiceImpl) FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Media, error)
- func (s MediaServiceImpl) FindMediaList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Media, error)
- func (s MediaServiceImpl) FindOneMedia(filter interface{}) (*dto.Media, error)
- func (s MediaServiceImpl) QueryAlbum(ownerUserId uuid.UUID, albumId *uuid.UUID, page int64, limit int64, ...) ([]dto.Media, error)
- func (s MediaServiceImpl) QueryMedia(search string, ownerUserId *uuid.UUID, mediaTypeId *int, sortBy string, ...) ([]dto.Media, error)
- func (s MediaServiceImpl) SaveManyMedia(medias []dto.Media) error
- func (s MediaServiceImpl) SaveMedia(media *dto.Media) error
- func (s MediaServiceImpl) UpdateMedia(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
- func (s MediaServiceImpl) UpdateMediaById(data *dto.Media) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MediaService ¶
type MediaService interface { SaveMedia(media *dto.Media) error SaveManyMedia(medias []dto.Media) error FindOneMedia(filter interface{}) (*dto.Media, error) FindMediaList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Media, error) QueryMedia(search string, ownerUserId *uuid.UUID, mediaTypeId *int, sortBy string, page int64) ([]dto.Media, error) FindById(objectId uuid.UUID) (*dto.Media, error) FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Media, error) UpdateMedia(filter interface{}, data interface{}, opts ...*repo.UpdateOptions) error UpdateMediaById(data *dto.Media) error DeleteMedia(filter interface{}) error DeleteMediaByOwner(ownerUserId uuid.UUID, mediaId uuid.UUID) error DeleteManyMedia(filter interface{}) error CreateMediaIndex(indexes map[string]interface{}) error FindByDirectory(ownerUserId uuid.UUID, directory string, limit int64, skip int64) ([]dto.Media, error) QueryAlbum(ownerUserId uuid.UUID, albumId *uuid.UUID, page int64, limit int64, sortBy string) ([]dto.Media, error) DeleteMediaByDirectory(ownerUserId uuid.UUID, directory string) error }
func NewMediaService ¶
func NewMediaService(db interface{}) (MediaService, error)
NewMediaService initializes MediaService's dependencies and create new MediaService struct
type MediaServiceImpl ¶
type MediaServiceImpl struct {
MediaRepo repo.Repository
}
MediaService handlers with injected dependencies
func (MediaServiceImpl) CreateMediaIndex ¶
func (s MediaServiceImpl) CreateMediaIndex(indexes map[string]interface{}) error
CreateMediaIndex create index for media search.
func (MediaServiceImpl) DeleteManyMedia ¶
func (s MediaServiceImpl) DeleteManyMedia(filter interface{}) error
DeleteManyMedia delete many media by filter
func (MediaServiceImpl) DeleteMedia ¶
func (s MediaServiceImpl) DeleteMedia(filter interface{}) error
DeleteMedia delete media by filter
func (MediaServiceImpl) DeleteMediaByDirectory ¶
func (s MediaServiceImpl) DeleteMediaByDirectory(ownerUserId uuid.UUID, directory string) error
DeleteMediaByDirectory delete media by ownerUserId and mediaId
func (MediaServiceImpl) DeleteMediaByOwner ¶
DeleteMedia delete media by ownerUserId and mediaId
func (MediaServiceImpl) FindByDirectory ¶
func (s MediaServiceImpl) FindByDirectory(ownerUserId uuid.UUID, directory string, limit int64, skip int64) ([]dto.Media, error)
FindByDirectory find by directory
func (MediaServiceImpl) FindByOwnerUserId ¶
FindByOwnerUserId find by owner user id
func (MediaServiceImpl) FindMediaList ¶
func (s MediaServiceImpl) FindMediaList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Media, error)
FindMediaList get all medias by filter
func (MediaServiceImpl) FindOneMedia ¶
func (s MediaServiceImpl) FindOneMedia(filter interface{}) (*dto.Media, error)
FindOneMedia get one media
func (MediaServiceImpl) QueryAlbum ¶
func (s MediaServiceImpl) QueryAlbum(ownerUserId uuid.UUID, albumId *uuid.UUID, page int64, limit int64, sortBy string) ([]dto.Media, error)
QueryAlbum query media by albumId
func (MediaServiceImpl) QueryMedia ¶
func (s MediaServiceImpl) QueryMedia(search string, ownerUserId *uuid.UUID, mediaTypeId *int, sortBy string, page int64) ([]dto.Media, error)
QueryMedia get all medias by query
func (MediaServiceImpl) SaveManyMedia ¶
func (s MediaServiceImpl) SaveManyMedia(medias []dto.Media) error
SaveManyMedia save the media
func (MediaServiceImpl) SaveMedia ¶
func (s MediaServiceImpl) SaveMedia(media *dto.Media) error
SaveMedia save the media
func (MediaServiceImpl) UpdateMedia ¶
func (s MediaServiceImpl) UpdateMedia(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
UpdateMedia update the media
func (MediaServiceImpl) UpdateMediaById ¶
func (s MediaServiceImpl) UpdateMediaById(data *dto.Media) error
UpdateMedia update the media