repository

package
v0.0.0-...-594631a Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 (r *CommentRepository) AddComment(ctx context.Context, comment domain.Comment) (string, error)

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 (r *CommentRepository) DeleteCommentByIds(ctx context.Context, ids []primitive.ObjectID) error

func (*CommentRepository) DeleteManyByPostId

func (r *CommentRepository) DeleteManyByPostId(ctx context.Context, postId string) error

func (*CommentRepository) DeleteReplyByCIdAndRId

func (r *CommentRepository) DeleteReplyByCIdAndRId(ctx context.Context, commentId string, replyId string) error

func (*CommentRepository) FindApprovedCommentById

func (r *CommentRepository) FindApprovedCommentById(ctx context.Context, cmtId string) (*domain.CommentWithReplies, error)

func (*CommentRepository) FindCommentById

func (r *CommentRepository) FindCommentById(ctx context.Context, id string) (*domain.Comment, error)

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 (r *CommentRepository) PullReplyByCIdAndRIds(ctx context.Context, commentId string, replyIds []string) error

func (*CommentRepository) UpdateCReplyStatus2TrueByCidAndRIds

func (r *CommentRepository) UpdateCReplyStatus2TrueByCidAndRIds(ctx context.Context, commentId string, replyIds []string) error

func (*CommentRepository) UpdateCommentReplyStatus

func (r *CommentRepository) UpdateCommentReplyStatus(ctx context.Context, commentId string, replyId string, approvalStatus bool) error

func (*CommentRepository) UpdateCommentStatus2True

func (r *CommentRepository) UpdateCommentStatus2True(ctx context.Context, id string) error

func (*CommentRepository) UpdateCommentStatus2TrueByIds

func (r *CommentRepository) UpdateCommentStatus2TrueByIds(ctx context.Context, ids []primitive.ObjectID) error

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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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