Documentation
¶
Index ¶
- type SaveResultAsync
- type VoteService
- type VoteServiceImpl
- func (s VoteServiceImpl) CreateVoteIndex(indexes map[string]interface{}) error
- func (s VoteServiceImpl) DeleteManyVotes(filter interface{}) error
- func (s VoteServiceImpl) DeleteVote(filter interface{}) error
- func (s VoteServiceImpl) DeleteVoteByOwner(ownerUserId uuid.UUID, voteId uuid.UUID) error
- func (s VoteServiceImpl) DeleteVotesByPostId(ownerUserId uuid.UUID, postId uuid.UUID) error
- func (s VoteServiceImpl) FindById(objectId uuid.UUID) (*dto.Vote, error)
- func (s VoteServiceImpl) FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Vote, error)
- func (s VoteServiceImpl) FindOneVote(filter interface{}) (*dto.Vote, error)
- func (s VoteServiceImpl) FindVoteList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Vote, error)
- func (s VoteServiceImpl) GetVoteByPostId(postId *uuid.UUID, sortBy string, page int64) ([]dto.Vote, error)
- func (s VoteServiceImpl) SaveVote(vote *dto.Vote) <-chan SaveResultAsync
- func (s VoteServiceImpl) UpdateVote(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
- func (s VoteServiceImpl) UpdateVoteById(data *dto.Vote) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SaveResultAsync ¶
type SaveResultAsync struct {
Error error
}
type VoteService ¶
type VoteService interface { SaveVote(vote *dto.Vote) <-chan SaveResultAsync FindOneVote(filter interface{}) (*dto.Vote, error) FindVoteList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Vote, error) FindById(objectId uuid.UUID) (*dto.Vote, error) FindByOwnerUserId(ownerUserId uuid.UUID) ([]dto.Vote, error) UpdateVote(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error UpdateVoteById(data *dto.Vote) error DeleteVote(filter interface{}) error DeleteVoteByOwner(ownerUserId uuid.UUID, voteId uuid.UUID) error DeleteManyVotes(filter interface{}) error CreateVoteIndex(indexes map[string]interface{}) error GetVoteByPostId(postId *uuid.UUID, sortBy string, page int64) ([]dto.Vote, error) DeleteVotesByPostId(ownerUserId uuid.UUID, postId uuid.UUID) error }
func NewVoteService ¶
func NewVoteService(db interface{}) (VoteService, error)
NewVoteService initializes VoteService's dependencies and create new VoteService struct
type VoteServiceImpl ¶
type VoteServiceImpl struct {
VoteRepo repo.Repository
}
VoteService handlers with injected dependencies
func (VoteServiceImpl) CreateVoteIndex ¶
func (s VoteServiceImpl) CreateVoteIndex(indexes map[string]interface{}) error
CreateVoteIndex create index for vote search.
func (VoteServiceImpl) DeleteManyVotes ¶
func (s VoteServiceImpl) DeleteManyVotes(filter interface{}) error
DeleteManyVotes delete many votes by filter
func (VoteServiceImpl) DeleteVote ¶
func (s VoteServiceImpl) DeleteVote(filter interface{}) error
DeleteVote delete vote by filter
func (VoteServiceImpl) DeleteVoteByOwner ¶
DeleteVote delete vote by ownerUserId and voteId
func (VoteServiceImpl) DeleteVotesByPostId ¶
DeleteVotesByPostId delete votes by postId
func (VoteServiceImpl) FindByOwnerUserId ¶
FindByOwnerUserId find by owner user id
func (VoteServiceImpl) FindOneVote ¶
func (s VoteServiceImpl) FindOneVote(filter interface{}) (*dto.Vote, error)
FindOneVote get one vote
func (VoteServiceImpl) FindVoteList ¶
func (s VoteServiceImpl) FindVoteList(filter interface{}, limit int64, skip int64, sort map[string]int) ([]dto.Vote, error)
FindVoteList get all votes by filter
func (VoteServiceImpl) GetVoteByPostId ¶
func (s VoteServiceImpl) GetVoteByPostId(postId *uuid.UUID, sortBy string, page int64) ([]dto.Vote, error)
GetVoteByPostId get all votes by postId
func (VoteServiceImpl) SaveVote ¶
func (s VoteServiceImpl) SaveVote(vote *dto.Vote) <-chan SaveResultAsync
SaveVote save the vote
func (VoteServiceImpl) UpdateVote ¶
func (s VoteServiceImpl) UpdateVote(filter interface{}, data interface{}, opts ...*coreData.UpdateOptions) error
UpdateVote update the vote
func (VoteServiceImpl) UpdateVoteById ¶
func (s VoteServiceImpl) UpdateVoteById(data *dto.Vote) error
UpdateVote update the vote
Click to show internal directories.
Click to hide internal directories.