service

package
v0.0.0-...-702fcad Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentService

type CommentService interface {
	SaveComment(comment *dto.Comment) <-chan SaveResultAsync
	FindOneComment(filter interface{}) (*dto.Comment, error)
	FindCommentList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Comment, error)
	QueryComment(search string, ownerUserId *uuid.UUID, commentTypeId *int, sortBy string, page int64) ([]dto.Comment, error)
	QueryCommentIncludeProfile(search string, ownerUserId *uuid.UUID, commentTypeId *int, sortBy string, page int64) ([]dto.Comment, error)
	FindById(objectId uuid.UUID) (*dto.Comment, error)
	FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Comment, error)
	UpdateComment(filter interface{}, data interface{}) error
	UpdateManyComment(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
	UpdateCommentById(data *dto.Comment) error
	DeleteComment(filter interface{}) error
	DeleteCommentByOwner(ownerUserId uuid.UUID, commentId uuid.UUID) error
	DeleteManyComments(filter interface{}) error
	CreateCommentIndex(indexes map[string]interface{}) error
	GetCommentByPostId(postId *uuid.UUID, sortBy string, page int64) ([]dto.Comment, error)
	DeleteCommentsByPostId(ownerUserId uuid.UUID, postId uuid.UUID) error
	UpdateCommentProfile(ownerUserId uuid.UUID, ownerDisplayName string, ownerAvatar string) error
}

func NewCommentService

func NewCommentService(db interface{}) (CommentService, error)

NewCommentService initializes CommentService's dependencies and create new CommentService struct

type CommentServiceImpl

type CommentServiceImpl struct {
	CommentRepo repo.Repository
}

CommentService handlers with injected dependencies

func (CommentServiceImpl) CreateCommentIndex

func (s CommentServiceImpl) CreateCommentIndex(indexes map[string]interface{}) error

CreateCommentIndex create index for comment search.

func (CommentServiceImpl) DeleteComment

func (s CommentServiceImpl) DeleteComment(filter interface{}) error

DeleteComment delete comment by filter

func (CommentServiceImpl) DeleteCommentByOwner

func (s CommentServiceImpl) DeleteCommentByOwner(ownerUserId uuid.UUID, commentId uuid.UUID) error

DeleteCommentByOwner delete comment by ownerUserId and commentId

func (CommentServiceImpl) DeleteCommentsByPostId

func (s CommentServiceImpl) DeleteCommentsByPostId(ownerUserId uuid.UUID, postId uuid.UUID) error

DeleteCommentsByPostId delete comments by postId

func (CommentServiceImpl) DeleteManyComments

func (s CommentServiceImpl) DeleteManyComments(filter interface{}) error

DeleteManyComment delete many comments by filter

func (CommentServiceImpl) FindById

func (s CommentServiceImpl) FindById(objectId uuid.UUID) (*dto.Comment, error)

FindById find by comment id

func (CommentServiceImpl) FindByOwnerUserId

func (s CommentServiceImpl) FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Comment, error)

FindByOwnerUserId find by owner user id

func (CommentServiceImpl) FindCommentList

func (s CommentServiceImpl) FindCommentList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Comment, error)

FindCommentList get all comments by filter

func (CommentServiceImpl) FindCommentsInclueProfile

func (s CommentServiceImpl) FindCommentsInclueProfile(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Comment, error)

FindComments get all comments by filter including user profile

func (CommentServiceImpl) FindOneComment

func (s CommentServiceImpl) FindOneComment(filter interface{}) (*dto.Comment, error)

FindOneComment get one comment

func (CommentServiceImpl) GetCommentByPostId

func (s CommentServiceImpl) GetCommentByPostId(postId *uuid.UUID, sortBy string, page int64) ([]dto.Comment, error)

GetCommentByPostId get all comments by postId

func (CommentServiceImpl) QueryComment

func (s CommentServiceImpl) QueryComment(search string, ownerUserId *uuid.UUID, commentTypeId *int, sortBy string, page int64) ([]dto.Comment, error)

QueryComment get all comments by query

func (CommentServiceImpl) QueryCommentIncludeProfile

func (s CommentServiceImpl) QueryCommentIncludeProfile(search string, ownerUserId *uuid.UUID, commentTypeId *int, sortBy string, page int64) ([]dto.Comment, error)

QueryComment get all comments by query

func (CommentServiceImpl) SaveComment

func (s CommentServiceImpl) SaveComment(comment *dto.Comment) <-chan SaveResultAsync

SaveComment save the comment

func (CommentServiceImpl) UpdateComment

func (s CommentServiceImpl) UpdateComment(filter interface{}, data interface{}) error

UpdateComment update the comment

func (CommentServiceImpl) UpdateCommentById

func (s CommentServiceImpl) UpdateCommentById(data *dto.Comment) error

UpdateComment update the comment

func (CommentServiceImpl) UpdateCommentProfile

func (s CommentServiceImpl) UpdateCommentProfile(ownerUserId uuid.UUID, ownerDisplayName string, ownerAvatar string) error

UpdateCommentProfile update the post

func (CommentServiceImpl) UpdateManyComment

func (s CommentServiceImpl) UpdateManyComment(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error

UpdateManyComment update the comment

type SaveResultAsync

type SaveResultAsync struct {
	Error error
}

Jump to

Keyboard shortcuts

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