service

package
v0.0.0-...-8ac8648 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPostService

type IPostService interface {
	GetLatestPosts(ctx context.Context, count int64) ([]*domain.Post, error)
	GetPosts(ctx context.Context, pageRequest *domain.PostRequest) ([]*domain.Post, int64, error)
	GetPunishedPostById(ctx context.Context, id string) (*domain.Post, error)
	IncreaseVisitCount(ctx context.Context, id string) error
	AdminGetPosts(ctx context.Context, pageDTO dto.PageDTO) ([]*domain.Post, int64, error)
	AddPost(ctx context.Context, post *domain.Post) error
	DeletePost(ctx context.Context, id string) error
	DecreaseCommentCount(ctx context.Context, postId string, cnt int) error
	AdminGetPostById(ctx context.Context, id string) (*domain.Post, error)
	UpdatePostIsDisplayed(ctx context.Context, id string, isDisplayed bool) error
	UpdatePostIsCommentAllowed(ctx context.Context, id string, isCommentAllowed bool) error
	SavePost(ctx context.Context, originalPost *domain.Post, savedPost *domain.Post, isNewPost bool) error
	IncreasePostLikeCount(ctx context.Context, postId string) error
}

type PostService

type PostService struct {
	// contains filtered or unexported fields
}

func NewPostService

func NewPostService(repo repository.IPostRepository, cfgService website_config.Service, countStats service2.ICountStatsService, fileService service3.IFileService) *PostService

func (*PostService) AddPost

func (s *PostService) AddPost(ctx context.Context, post *domain.Post) error

func (*PostService) AdminGetPostById

func (s *PostService) AdminGetPostById(ctx context.Context, id string) (*domain.Post, error)

func (*PostService) AdminGetPosts

func (s *PostService) AdminGetPosts(ctx context.Context, pageDTO dto.PageDTO) ([]*domain.Post, int64, error)

func (*PostService) DecreaseCommentCount

func (s *PostService) DecreaseCommentCount(ctx context.Context, postId string, cnt int) error

func (*PostService) DeletePost

func (s *PostService) DeletePost(ctx context.Context, id string) error

func (*PostService) GetLatestPosts

func (s *PostService) GetLatestPosts(ctx context.Context, count int64) ([]*domain.Post, error)

func (*PostService) GetPosts

func (s *PostService) GetPosts(ctx context.Context, pageRequest *domain.PostRequest) ([]*domain.Post, int64, error)

func (*PostService) GetPunishedPostById

func (s *PostService) GetPunishedPostById(ctx context.Context, id string) (*domain.Post, error)

func (*PostService) IncreasePostLikeCount

func (s *PostService) IncreasePostLikeCount(ctx context.Context, postId string) error

func (*PostService) IncreaseVisitCount

func (s *PostService) IncreaseVisitCount(ctx context.Context, id string) error

func (*PostService) SavePost

func (s *PostService) SavePost(ctx context.Context, originalPost *domain.Post, savedPost *domain.Post, isNewPost bool) error

func (*PostService) UpdatePostIsCommentAllowed

func (s *PostService) UpdatePostIsCommentAllowed(ctx context.Context, id string, isCommentAllowed bool) error

func (*PostService) UpdatePostIsDisplayed

func (s *PostService) UpdatePostIsDisplayed(ctx context.Context, id string, isDisplayed bool) error

Jump to

Keyboard shortcuts

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