post

package
v0.0.0-...-c52fe67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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) Create

func (s *Service) Create(ctx context.Context, data *service.CreatePostData) (*entity.PostEx, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id uint) error

func (*Service) Draft

func (s *Service) Draft(ctx context.Context, id uint) error

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, id uint) (*entity.Post, error)

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 (s *Service) GetExByFilterWithLanguage(ctx context.Context, data *service.GetByFilterPostData, lngID uint) ([]entity.PostEx, error)

func (*Service) GetExByID

func (s *Service) GetExByID(ctx context.Context, id uint) (*entity.PostEx, error)

func (*Service) GetExByIDWithLanguage

func (s *Service) GetExByIDWithLanguage(ctx context.Context, id uint, lngID uint) (*entity.PostEx, error)

func (*Service) GetExBySlug

func (s *Service) GetExBySlug(ctx context.Context, slug string) (*entity.PostEx, error)

GetExBySlug returns PostEx by slug

func (*Service) GetExBySlugWithLanguage

func (s *Service) GetExBySlugWithLanguage(ctx context.Context, slug string, lngID uint) (*entity.PostEx, error)

func (*Service) Publish

func (s *Service) Publish(ctx context.Context, id uint) error

func (*Service) Update

func (s *Service) Update(ctx context.Context, data *service.UpdatePostData) (*entity.PostEx, error)

func (*Service) Upsert

func (s *Service) Upsert(ctx context.Context, data *service.UpsertPostData) (*entity.PostEx, error)

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL