service

package
v0.0.0-...-a783adc Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 9 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 {
	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) AddLike

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

func (*PostService) DeleteLike

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

func (*PostService) GetHomePosts

func (s *PostService) GetHomePosts(ctx context.Context) ([]*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) IncreaseVisitCount

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

Jump to

Keyboard shortcuts

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