Documentation ¶
Index ¶
- type IPostRepository
- type PostRepository
- func (r *PostRepository) AddLike(ctx context.Context, id string, ip string) error
- func (r *PostRepository) AddPost(ctx context.Context, post *domain.Post) error
- func (r *PostRepository) DecreaseCommentCount(ctx context.Context, postId string, cnt int) error
- func (r *PostRepository) DeleteLike(ctx context.Context, id string, ip string) error
- func (r *PostRepository) DeletePost(ctx context.Context, id string) error
- func (r *PostRepository) FindPostById(ctx context.Context, id string) (*domain.Post, error)
- func (r *PostRepository) GetLatest5Posts(ctx context.Context, count int64) ([]*domain.Post, error)
- func (r *PostRepository) GetPunishedPostById(ctx context.Context, id string) (*domain.Post, error)
- func (r *PostRepository) HadLikePost(ctx context.Context, id string, ip string) (bool, error)
- func (r *PostRepository) IncreaseCommentCount(ctx context.Context, id string) error
- func (r *PostRepository) IncreasePostLikeCount(ctx context.Context, postId string) error
- func (r *PostRepository) IncreaseVisitCount(ctx context.Context, id string) error
- func (r *PostRepository) QueryAdminPostsPage(ctx context.Context, postsQueryDTO dto.PostsQueryDTO) ([]*domain.Post, int64, error)
- func (r *PostRepository) QueryPostsPage(ctx context.Context, postsQueryCondition domain.PostsQueryCondition) ([]*domain.Post, int64, error)
- func (r *PostRepository) SavePost(ctx context.Context, post *domain.Post) error
- func (r *PostRepository) UpdatePostIsCommentAllowedById(ctx context.Context, id string, isCommentAllowed bool) error
- func (r *PostRepository) UpdatePostIsDisplayedById(ctx context.Context, id string, isDisplayed bool) error
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) DecreaseCommentCount ¶
func (*PostRepository) DeleteLike ¶
func (*PostRepository) DeletePost ¶
func (r *PostRepository) DeletePost(ctx context.Context, id string) error
func (*PostRepository) FindPostById ¶
func (*PostRepository) GetLatest5Posts ¶
func (*PostRepository) GetPunishedPostById ¶
func (*PostRepository) HadLikePost ¶
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) UpdatePostIsCommentAllowedById ¶
func (*PostRepository) UpdatePostIsDisplayedById ¶
Click to show internal directories.
Click to hide internal directories.