Documentation ¶
Index ¶
- type IPostRepository
- type PostRepository
- func (r *PostRepository) AddLike(ctx context.Context, id string, ip string) error
- func (r *PostRepository) DeleteLike(ctx context.Context, id string, ip string) error
- func (r *PostRepository) GetLatest5Posts(ctx context.Context) ([]*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) IncreaseVisitCount(ctx context.Context, id string) error
- func (r *PostRepository) QueryPostsPage(ctx context.Context, postsQueryCondition domain.PostsQueryCondition) ([]*domain.Post, int64, 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) ([]*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) AddLike(ctx context.Context, id string, ip string) error DeleteLike(ctx context.Context, id string, ip string) error IncreaseCommentCount(ctx context.Context, id string) error }
type PostRepository ¶
type PostRepository struct {
// contains filtered or unexported fields
}
func NewPostRepository ¶
func NewPostRepository(dao dao.IPostDao) *PostRepository
func (*PostRepository) DeleteLike ¶
func (*PostRepository) GetLatest5Posts ¶
func (*PostRepository) GetPunishedPostById ¶
func (*PostRepository) HadLikePost ¶
func (*PostRepository) IncreaseCommentCount ¶
func (r *PostRepository) IncreaseCommentCount(ctx context.Context, id string) error
func (*PostRepository) IncreaseVisitCount ¶
func (r *PostRepository) IncreaseVisitCount(ctx context.Context, id string) error
func (*PostRepository) QueryPostsPage ¶
func (r *PostRepository) QueryPostsPage(ctx context.Context, postsQueryCondition domain.PostsQueryCondition) ([]*domain.Post, int64, error)
Click to show internal directories.
Click to hide internal directories.