Documentation
¶
Index ¶
- func New(params ServiceParams) service.PostService
- type Service
- func (s *Service) Create(ctx context.Context, data *service.CreatePostData) (*entity.PostEx, error)
- func (s *Service) Delete(ctx context.Context, id uint) error
- func (s *Service) Draft(ctx context.Context, id uint) error
- func (s *Service) GetByID(ctx context.Context, id uint) (*entity.Post, error)
- func (s *Service) GetCountByFilter(ctx context.Context, data *service.GetByFilterPostData) (int, error)
- func (s *Service) GetExByFilter(ctx context.Context, data *service.GetByFilterPostData) ([]entity.PostEx, error)
- func (s *Service) GetExByFilterWithLanguage(ctx context.Context, data *service.GetByFilterPostData, lngID uint) ([]entity.PostEx, error)
- func (s *Service) GetExByID(ctx context.Context, id uint) (*entity.PostEx, error)
- func (s *Service) GetExByIDWithLanguage(ctx context.Context, id uint, lngID uint) (*entity.PostEx, error)
- func (s *Service) GetExBySlug(ctx context.Context, slug string) (*entity.PostEx, error)
- func (s *Service) GetExBySlugWithLanguage(ctx context.Context, slug string, lngID uint) (*entity.PostEx, error)
- func (s *Service) Publish(ctx context.Context, id uint) error
- func (s *Service) Update(ctx context.Context, data *service.UpdatePostData) (*entity.PostEx, error)
- func (s *Service) Upsert(ctx context.Context, data *service.UpsertPostData) (*entity.PostEx, error)
- type ServiceParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(params ServiceParams) service.PostService
Types ¶
type Service ¶
type Service struct { PostRepository repository.PostRepository PostL10nRepository repository.PostL10nRepository PostExRepository repository.PostExRepository PostMediaRepository repository.PostMediaRepository Media service.MediaService MediaParser service.MediaParser Transactor *transactor.Transactor }
func (*Service) GetCountByFilter ¶
func (s *Service) GetCountByFilter(ctx context.Context, data *service.GetByFilterPostData) (int, error)
GetCountByFilter returns count posts founded by filter
func (*Service) GetExByFilter ¶
func (s *Service) GetExByFilter(ctx context.Context, data *service.GetByFilterPostData) ([]entity.PostEx, error)
GetExByFilter returns posts founded by filter
func (*Service) GetExByFilterWithLanguage ¶
func (*Service) GetExByIDWithLanguage ¶
func (*Service) GetExBySlug ¶
GetExBySlug returns PostEx by slug
func (*Service) GetExBySlugWithLanguage ¶
type ServiceParams ¶
type ServiceParams struct { fx.In PostRepository repository.PostRepository PostL10nRepository repository.PostL10nRepository PostExRepository repository.PostExRepository PostMediaRepository repository.PostMediaRepository Media service.MediaService MediaParser service.MediaParser Transactor *transactor.Transactor }
Click to show internal directories.
Click to hide internal directories.