Documentation ¶
Index ¶
- type IPostService
- type PostService
- func (s *PostService) AddLike(ctx context.Context, id string, ip string) error
- func (s *PostService) DeleteLike(ctx context.Context, id string, ip string) error
- func (s *PostService) GetHomePosts(ctx context.Context) ([]*domain.Post, error)
- func (s *PostService) GetPosts(ctx context.Context, pageRequest *domain.PostRequest) ([]*domain.Post, int64, error)
- func (s *PostService) GetPunishedPostById(ctx context.Context, id string) (*domain.Post, error)
- func (s *PostService) IncreaseVisitCount(ctx context.Context, id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPostService ¶
type IPostService interface { GetHomePosts(ctx context.Context) ([]*domain.Post, error) GetPosts(ctx context.Context, pageRequest *domain.PostRequest) ([]*domain.Post, int64, error) GetPunishedPostById(ctx context.Context, id string) (*domain.Post, error) AddLike(ctx context.Context, id string, ip string) error DeleteLike(ctx context.Context, id string, ip string) error IncreaseVisitCount(ctx context.Context, id string) error }
type PostService ¶
type PostService struct {
// contains filtered or unexported fields
}
func NewPostService ¶
func NewPostService(repo repository.IPostRepository) *PostService
func (*PostService) DeleteLike ¶
func (*PostService) GetHomePosts ¶
func (*PostService) GetPosts ¶
func (s *PostService) GetPosts(ctx context.Context, pageRequest *domain.PostRequest) ([]*domain.Post, int64, error)
func (*PostService) GetPunishedPostById ¶
func (*PostService) IncreaseVisitCount ¶
func (s *PostService) IncreaseVisitCount(ctx context.Context, id string) error
Click to show internal directories.
Click to hide internal directories.