Documentation ¶
Index ¶
- type PostService
- type PostServiceImpl
- func (s PostServiceImpl) CreatePostIndex(indexes map[string]interface{}) error
- func (s PostServiceImpl) Decrement(objectId uuid.UUID, field string, value int) error
- func (s PostServiceImpl) DecrementCommentCount(objectId uuid.UUID) error
- func (s PostServiceImpl) DecrementScoreCount(objectId uuid.UUID, ownerUserId uuid.UUID, displayName string, avatar string) error
- func (s PostServiceImpl) DeleteManyPost(filter interface{}) error
- func (s PostServiceImpl) DeletePost(filter interface{}) error
- func (s PostServiceImpl) DeletePostByOwner(ownerUserId uuid.UUID, postId uuid.UUID) error
- func (s PostServiceImpl) DisableCommnet(OwnerUserId uuid.UUID, objectId uuid.UUID, value bool) error
- func (s PostServiceImpl) DisableSharing(OwnerUserId uuid.UUID, objectId uuid.UUID, value bool) error
- func (s PostServiceImpl) FindById(objectId uuid.UUID) (*dto.Post, error)
- func (s PostServiceImpl) FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Post, error)
- func (s PostServiceImpl) FindByURLKey(urlKey string) (*dto.Post, error)
- func (s PostServiceImpl) FindOnePost(filter interface{}) (*dto.Post, error)
- func (s PostServiceImpl) FindPostList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Post, error)
- func (s PostServiceImpl) FindPostsIncludeProfile(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Post, error)
- func (s PostServiceImpl) Increment(objectId uuid.UUID, field string, value int) error
- func (s PostServiceImpl) IncrementCommentCount(objectId uuid.UUID) error
- func (s PostServiceImpl) IncrementScoreCount(objectId uuid.UUID, ownerUserId uuid.UUID, displayName string, avatar string) error
- func (s PostServiceImpl) QueryPost(search string, ownerUserIds []uuid.UUID, postTypeId int, sortBy string, ...) ([]dto.Post, error)
- func (s PostServiceImpl) QueryPostIncludeUser(search string, ownerUserIds []uuid.UUID, collectiveIds []uuid.UUID, ...) ([]dto.Post, error)
- func (s PostServiceImpl) SavePost(post *dto.Post) error
- func (s PostServiceImpl) UpdateManyPost(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
- func (s PostServiceImpl) UpdatePost(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
- func (s PostServiceImpl) UpdatePostById(data *models.PostUpdateModel) error
- func (s PostServiceImpl) UpdatePostProfile(ownerUserId uuid.UUID, ownerDisplayName string, ownerAvatar string) error
- func (s PostServiceImpl) UpdatePostURLKey(postId uuid.UUID, urlKey string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostService ¶
type PostService interface { SavePost(post *dto.Post) error FindOnePost(filter interface{}) (*dto.Post, error) FindPostList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Post, error) FindPostsIncludeProfile(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Post, error) QueryPost(search string, ownerUserIds []uuid.UUID, postTypeId int, sortBy string, page int64) ([]dto.Post, error) QueryPostIncludeUser(search string, ownerUserIds []uuid.UUID, collectiveIds []uuid.UUID, postTypeId int, sortBy string, page int64) ([]dto.Post, error) FindById(objectId uuid.UUID) (*dto.Post, error) FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Post, error) FindByURLKey(urlKey string) (*dto.Post, error) UpdatePost(filter interface{}, data interface{}, opts ...*repo.UpdateOptions) error UpdateManyPost(filter interface{}, data interface{}, opts ...*repo.UpdateOptions) error UpdatePostById(data *models.PostUpdateModel) error DeletePost(filter interface{}) error DeletePostByOwner(ownerUserId uuid.UUID, postId uuid.UUID) error DeleteManyPost(filter interface{}) error CreatePostIndex(indexes map[string]interface{}) error DisableCommnet(OwnerUserId uuid.UUID, objectId uuid.UUID, value bool) error DisableSharing(OwnerUserId uuid.UUID, objectId uuid.UUID, value bool) error IncrementScoreCount(objectId uuid.UUID, ownerUserId uuid.UUID, displayName string, avatar string) error DecrementScoreCount(objectId uuid.UUID, ownerUserId uuid.UUID, displayName string, avatar string) error Increment(objectId uuid.UUID, field string, value int) error IncrementCommentCount(objectId uuid.UUID) error DecrementCommentCount(objectId uuid.UUID) error UpdatePostProfile(ownerUserId uuid.UUID, ownerDisplayName string, ownerAvatar string) error UpdatePostURLKey(postId uuid.UUID, urlKey string) error }
func NewPostService ¶
func NewPostService(db interface{}) (PostService, error)
NewPostService initializes PostService's dependencies and create new PostService struct
type PostServiceImpl ¶
type PostServiceImpl struct {
PostRepo coreData.Repository
}
PostService handlers with injected dependencies
func (PostServiceImpl) CreatePostIndex ¶
func (s PostServiceImpl) CreatePostIndex(indexes map[string]interface{}) error
CreatePostIndex create index for post search.
func (PostServiceImpl) DecrementCommentCount ¶
func (s PostServiceImpl) DecrementCommentCount(objectId uuid.UUID) error
DecrementCommentCount increment comment count of post by -1
func (PostServiceImpl) DecrementScoreCount ¶
func (s PostServiceImpl) DecrementScoreCount(objectId uuid.UUID, ownerUserId uuid.UUID, displayName string, avatar string) error
DecrementScoreCount decrement score of post
func (PostServiceImpl) DeleteManyPost ¶
func (s PostServiceImpl) DeleteManyPost(filter interface{}) error
DeleteManyPost delete many post by filter
func (PostServiceImpl) DeletePost ¶
func (s PostServiceImpl) DeletePost(filter interface{}) error
DeletePost delete post by filter
func (PostServiceImpl) DeletePostByOwner ¶
DeletePost delete post by ownerUserId and postId
func (PostServiceImpl) DisableCommnet ¶
func (s PostServiceImpl) DisableCommnet(OwnerUserId uuid.UUID, objectId uuid.UUID, value bool) error
DisableCommnet
func (PostServiceImpl) DisableSharing ¶
func (s PostServiceImpl) DisableSharing(OwnerUserId uuid.UUID, objectId uuid.UUID, value bool) error
DisableSharing
func (PostServiceImpl) FindByOwnerUserId ¶
FindByOwnerUserId find by owner user id
func (PostServiceImpl) FindByURLKey ¶
func (s PostServiceImpl) FindByURLKey(urlKey string) (*dto.Post, error)
FindByURLKey find by URL key
func (PostServiceImpl) FindOnePost ¶
func (s PostServiceImpl) FindOnePost(filter interface{}) (*dto.Post, error)
FindOnePost get one post
func (PostServiceImpl) FindPostList ¶
func (s PostServiceImpl) FindPostList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Post, error)
FindPostList get all posts by filter
func (PostServiceImpl) FindPostsIncludeProfile ¶
func (s PostServiceImpl) FindPostsIncludeProfile(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Post, error)
FindPostsIncludeProfile get all posts by filter including user profile entity
func (PostServiceImpl) IncrementCommentCount ¶
func (s PostServiceImpl) IncrementCommentCount(objectId uuid.UUID) error
IncrementCommentCount increment comment count of post by +1
func (PostServiceImpl) IncrementScoreCount ¶
func (s PostServiceImpl) IncrementScoreCount(objectId uuid.UUID, ownerUserId uuid.UUID, displayName string, avatar string) error
IncrementScoreCount increment score of post
func (PostServiceImpl) QueryPost ¶
func (s PostServiceImpl) QueryPost(search string, ownerUserIds []uuid.UUID, postTypeId int, sortBy string, page int64) ([]dto.Post, error)
QueryPost get all posts by query
func (PostServiceImpl) QueryPostIncludeUser ¶
func (s PostServiceImpl) QueryPostIncludeUser(search string, ownerUserIds []uuid.UUID, collectiveIds []uuid.UUID, postTypeId int, sortBy string, page int64) ([]dto.Post, error)
QueryPostIncludeUser get all posts by query including user entity
func (PostServiceImpl) SavePost ¶
func (s PostServiceImpl) SavePost(post *dto.Post) error
SavePost save the post
func (PostServiceImpl) UpdateManyPost ¶
func (s PostServiceImpl) UpdateManyPost(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
UpdateManyPost update the post
func (PostServiceImpl) UpdatePost ¶
func (s PostServiceImpl) UpdatePost(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
UpdatePost update the post
func (PostServiceImpl) UpdatePostById ¶
func (s PostServiceImpl) UpdatePostById(data *models.PostUpdateModel) error
UpdatePost update the post
func (PostServiceImpl) UpdatePostProfile ¶
func (s PostServiceImpl) UpdatePostProfile(ownerUserId uuid.UUID, ownerDisplayName string, ownerAvatar string) error
UpdatePostProfile update the post
func (PostServiceImpl) UpdatePostURLKey ¶
func (s PostServiceImpl) UpdatePostURLKey(postId uuid.UUID, urlKey string) error
UpdatePostURLKey update the post URL key