Documentation ¶
Index ¶
- type CommentRepository
- func (r *CommentRepository) AddComment(ctx context.Context, comment domain.Comment) (string, error)
- func (r *CommentRepository) AddReply(ctx context.Context, cmtId string, commentReply domain.CommentReply) (string, error)
- func (r *CommentRepository) AdminFindCommentsWithPagination(ctx context.Context, page domain.Page) ([]domain.AdminComment, int64, error)
- func (r *CommentRepository) CountOfToday(ctx context.Context) (int64, error)
- func (r *CommentRepository) DeleteCommentById(ctx context.Context, id string) error
- func (r *CommentRepository) DeleteCommentByIds(ctx context.Context, ids []primitive.ObjectID) error
- func (r *CommentRepository) DeleteManyByPostId(ctx context.Context, postId string) error
- func (r *CommentRepository) DeleteReplyByCIdAndRId(ctx context.Context, commentId string, replyId string) error
- func (r *CommentRepository) FindApprovedCommentById(ctx context.Context, cmtId string) (*domain.CommentWithReplies, error)
- func (r *CommentRepository) FindCommentById(ctx context.Context, id string) (*domain.Comment, error)
- func (r *CommentRepository) FindCommentByObjectIDs(ctx context.Context, ids []primitive.ObjectID) ([]domain.AdminComment, error)
- func (r *CommentRepository) FindCommentWithDisapprovedReplyByCidAndRIds(ctx context.Context, commentId string, replyIds []string) (*domain.AdminComment, error)
- func (r *CommentRepository) FindCommentWithRepliesById(ctx context.Context, id string) (*domain.CommentWithReplies, error)
- func (r *CommentRepository) FindCommentsByPostId(ctx context.Context, postId string) ([]domain.AdminComment, error)
- func (r *CommentRepository) FindCommentsByPostIdAndCmtStatus(ctx context.Context, postId string) ([]domain.CommentWithReplies, error)
- func (r *CommentRepository) FindDisapprovedCommentByObjectIDs(ctx context.Context, commentObjectIDs []primitive.ObjectID) ([]domain.AdminComment, error)
- func (r *CommentRepository) FindReplyByCIdAndRId(ctx context.Context, commentId string, replyId string) (*domain.CommentReplyWithPostInfo, error)
- func (r *CommentRepository) FineLatestCommentAndReply(ctx context.Context, cnt int) ([]domain.LatestComment, error)
- func (r *CommentRepository) PullReplyByCIdAndRIds(ctx context.Context, commentId string, replyIds []string) error
- func (r *CommentRepository) UpdateCReplyStatus2TrueByCidAndRIds(ctx context.Context, commentId string, replyIds []string) error
- func (r *CommentRepository) UpdateCommentReplyStatus(ctx context.Context, commentId string, replyId string, approvalStatus bool) error
- func (r *CommentRepository) UpdateCommentStatus2True(ctx context.Context, id string) error
- func (r *CommentRepository) UpdateCommentStatus2TrueByIds(ctx context.Context, ids []primitive.ObjectID) error
- type ICommentRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentRepository ¶
type CommentRepository struct {
// contains filtered or unexported fields
}
func NewCommentRepository ¶
func NewCommentRepository(dao dao.ICommentDao) *CommentRepository
func (*CommentRepository) AddComment ¶
func (*CommentRepository) AddReply ¶
func (r *CommentRepository) AddReply(ctx context.Context, cmtId string, commentReply domain.CommentReply) (string, error)
func (*CommentRepository) AdminFindCommentsWithPagination ¶
func (r *CommentRepository) AdminFindCommentsWithPagination(ctx context.Context, page domain.Page) ([]domain.AdminComment, int64, error)
func (*CommentRepository) CountOfToday ¶
func (r *CommentRepository) CountOfToday(ctx context.Context) (int64, error)
func (*CommentRepository) DeleteCommentById ¶
func (r *CommentRepository) DeleteCommentById(ctx context.Context, id string) error
func (*CommentRepository) DeleteCommentByIds ¶
func (*CommentRepository) DeleteManyByPostId ¶
func (r *CommentRepository) DeleteManyByPostId(ctx context.Context, postId string) error
func (*CommentRepository) DeleteReplyByCIdAndRId ¶
func (*CommentRepository) FindApprovedCommentById ¶
func (r *CommentRepository) FindApprovedCommentById(ctx context.Context, cmtId string) (*domain.CommentWithReplies, error)
func (*CommentRepository) FindCommentById ¶
func (*CommentRepository) FindCommentByObjectIDs ¶
func (r *CommentRepository) FindCommentByObjectIDs(ctx context.Context, ids []primitive.ObjectID) ([]domain.AdminComment, error)
func (*CommentRepository) FindCommentWithDisapprovedReplyByCidAndRIds ¶
func (r *CommentRepository) FindCommentWithDisapprovedReplyByCidAndRIds(ctx context.Context, commentId string, replyIds []string) (*domain.AdminComment, error)
func (*CommentRepository) FindCommentWithRepliesById ¶
func (r *CommentRepository) FindCommentWithRepliesById(ctx context.Context, id string) (*domain.CommentWithReplies, error)
func (*CommentRepository) FindCommentsByPostId ¶
func (r *CommentRepository) FindCommentsByPostId(ctx context.Context, postId string) ([]domain.AdminComment, error)
func (*CommentRepository) FindCommentsByPostIdAndCmtStatus ¶
func (r *CommentRepository) FindCommentsByPostIdAndCmtStatus(ctx context.Context, postId string) ([]domain.CommentWithReplies, error)
func (*CommentRepository) FindDisapprovedCommentByObjectIDs ¶
func (r *CommentRepository) FindDisapprovedCommentByObjectIDs(ctx context.Context, commentObjectIDs []primitive.ObjectID) ([]domain.AdminComment, error)
func (*CommentRepository) FindReplyByCIdAndRId ¶
func (r *CommentRepository) FindReplyByCIdAndRId(ctx context.Context, commentId string, replyId string) (*domain.CommentReplyWithPostInfo, error)
func (*CommentRepository) FineLatestCommentAndReply ¶
func (r *CommentRepository) FineLatestCommentAndReply(ctx context.Context, cnt int) ([]domain.LatestComment, error)
func (*CommentRepository) PullReplyByCIdAndRIds ¶
func (*CommentRepository) UpdateCReplyStatus2TrueByCidAndRIds ¶
func (*CommentRepository) UpdateCommentReplyStatus ¶
func (*CommentRepository) UpdateCommentStatus2True ¶
func (r *CommentRepository) UpdateCommentStatus2True(ctx context.Context, id string) error
func (*CommentRepository) UpdateCommentStatus2TrueByIds ¶
type ICommentRepository ¶
type ICommentRepository interface { AddComment(ctx context.Context, comment domain.Comment) (string, error) FindApprovedCommentById(ctx context.Context, cmtId string) (*domain.CommentWithReplies, error) AddReply(ctx context.Context, cmtId string, commentReply domain.CommentReply) (string, error) FineLatestCommentAndReply(ctx context.Context, cnt int) ([]domain.LatestComment, error) FindCommentsByPostIdAndCmtStatus(ctx context.Context, postId string) ([]domain.CommentWithReplies, error) FindCommentById(ctx context.Context, id string) (*domain.Comment, error) UpdateCommentStatus2True(ctx context.Context, id string) error FindReplyByCIdAndRId(ctx context.Context, commentId string, replyId string) (*domain.CommentReplyWithPostInfo, error) UpdateCommentReplyStatus(ctx context.Context, commentId string, replyId string, approvalStatus bool) error FindCommentWithRepliesById(ctx context.Context, id string) (*domain.CommentWithReplies, error) DeleteCommentById(ctx context.Context, id string) error DeleteReplyByCIdAndRId(ctx context.Context, commentId string, replyId string) error CountOfToday(ctx context.Context) (int64, error) AdminFindCommentsWithPagination(ctx context.Context, page domain.Page) ([]domain.AdminComment, int64, error) UpdateCommentStatus2TrueByIds(ctx context.Context, ids []primitive.ObjectID) error FindCommentByObjectIDs(ctx context.Context, ids []primitive.ObjectID) ([]domain.AdminComment, error) UpdateCReplyStatus2TrueByCidAndRIds(ctx context.Context, commentId string, replyIds []string) error FindCommentWithDisapprovedReplyByCidAndRIds(ctx context.Context, commentId string, replyIds []string) (*domain.AdminComment, error) FindDisapprovedCommentByObjectIDs(ctx context.Context, commentObjectIDs []primitive.ObjectID) ([]domain.AdminComment, error) DeleteCommentByIds(ctx context.Context, ids []primitive.ObjectID) error PullReplyByCIdAndRIds(ctx context.Context, commentId string, replyIds []string) error DeleteManyByPostId(ctx context.Context, postId string) error FindCommentsByPostId(ctx context.Context, postId string) ([]domain.AdminComment, error) }
Click to show internal directories.
Click to hide internal directories.