repository

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPostRepository

type IPostRepository interface {
	GetLatest5Posts(ctx context.Context, count int64) ([]*domain.Post, error)
	QueryPostsPage(ctx context.Context, postsQueryCondition domain.PostsQueryCondition) ([]*domain.Post, int64, error)
	GetPunishedPostById(ctx context.Context, id string) (*domain.Post, error)
	IncreaseVisitCount(ctx context.Context, id string) error
	HadLikePost(ctx context.Context, id string, ip string) (bool, error)
	IncreaseCommentCount(ctx context.Context, id string) error
	QueryAdminPostsPage(ctx context.Context, postsQueryDTO dto.PostsQueryDTO) ([]*domain.Post, int64, error)
	AddPost(ctx context.Context, post *domain.Post) error
	DeletePost(ctx context.Context, id string) error
	FindPostById(ctx context.Context, id string) (*domain.Post, error)
	DecreaseCommentCount(ctx context.Context, postId string, cnt int) error
	SavePost(ctx context.Context, post *domain.Post) error
	UpdatePostIsDisplayedById(ctx context.Context, id string, isDisplayed bool) error
	UpdatePostIsCommentAllowedById(ctx context.Context, id string, isCommentAllowed bool) error
	IncreasePostLikeCount(ctx context.Context, postId string) error
}

type PostRepository

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

func NewPostRepository

func NewPostRepository(dao dao.IPostDao) *PostRepository

func (*PostRepository) AddLike

func (r *PostRepository) AddLike(ctx context.Context, id string, ip string) error

func (*PostRepository) AddPost

func (r *PostRepository) AddPost(ctx context.Context, post *domain.Post) error

func (*PostRepository) DecreaseCommentCount

func (r *PostRepository) DecreaseCommentCount(ctx context.Context, postId string, cnt int) error

func (*PostRepository) DeleteLike

func (r *PostRepository) DeleteLike(ctx context.Context, id string, ip string) error

func (*PostRepository) DeletePost

func (r *PostRepository) DeletePost(ctx context.Context, id string) error

func (*PostRepository) FindPostById

func (r *PostRepository) FindPostById(ctx context.Context, id string) (*domain.Post, error)

func (*PostRepository) GetLatest5Posts

func (r *PostRepository) GetLatest5Posts(ctx context.Context, count int64) ([]*domain.Post, error)

func (*PostRepository) GetPunishedPostById

func (r *PostRepository) GetPunishedPostById(ctx context.Context, id string) (*domain.Post, error)

func (*PostRepository) HadLikePost

func (r *PostRepository) HadLikePost(ctx context.Context, id string, ip string) (bool, error)

func (*PostRepository) IncreaseCommentCount

func (r *PostRepository) IncreaseCommentCount(ctx context.Context, id string) error

func (*PostRepository) IncreasePostLikeCount

func (r *PostRepository) IncreasePostLikeCount(ctx context.Context, postId string) error

func (*PostRepository) IncreaseVisitCount

func (r *PostRepository) IncreaseVisitCount(ctx context.Context, id string) error

func (*PostRepository) QueryAdminPostsPage

func (r *PostRepository) QueryAdminPostsPage(ctx context.Context, postsQueryDTO dto.PostsQueryDTO) ([]*domain.Post, int64, error)

func (*PostRepository) QueryPostsPage

func (r *PostRepository) QueryPostsPage(ctx context.Context, postsQueryCondition domain.PostsQueryCondition) ([]*domain.Post, int64, error)

func (*PostRepository) SavePost

func (r *PostRepository) SavePost(ctx context.Context, post *domain.Post) error

func (*PostRepository) UpdatePostIsCommentAllowedById

func (r *PostRepository) UpdatePostIsCommentAllowedById(ctx context.Context, id string, isCommentAllowed bool) error

func (*PostRepository) UpdatePostIsDisplayedById

func (r *PostRepository) UpdatePostIsDisplayedById(ctx context.Context, id string, isDisplayed bool) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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