Documentation ¶
Index ¶
- Constants
- Variables
- func NewActivityRepo(data *data.Data) activity.ActivityRepo
- func NewAnswerActivityRepo(data *data.Data, activityRepo activity_common.ActivityRepo, ...) activity.AnswerActivityRepo
- func NewFollowRepo(data *data.Data, uniqueIDRepo unique.UniqueIDRepo, ...) follow.FollowRepo
- func NewQuestionActivityRepo(data *data.Data, activityRepo activity_common.ActivityRepo, ...) activity.QuestionActivityRepo
- func NewUserActiveActivityRepo(data *data.Data, activityRepo activity_common.ActivityRepo, ...) activity.UserActiveActivityRepo
- func NewVoteRepo(data *data.Data, uniqueIDRepo unique.UniqueIDRepo, ...) service.VoteRepo
- type AnswerActivityRepo
- func (ar *AnswerActivityRepo) AcceptAnswer(ctx context.Context, ...) (err error)
- func (ar *AnswerActivityRepo) CancelAcceptAnswer(ctx context.Context, ...) (err error)
- func (ar *AnswerActivityRepo) DeleteAnswer(ctx context.Context, answerID string) (err error)
- func (ar *AnswerActivityRepo) DeleteQuestion(ctx context.Context, questionID string) (err error)
- type FollowRepo
- type UserActiveActivityRepo
- type VoteRepo
- func (vr *VoteRepo) CheckRank(ctx context.Context, objectID, objectUserID, userID string, action string) (activityUserID string, activityType, rank, hasRank int, err error)
- func (vr *VoteRepo) GetVoteResultByObjectId(ctx context.Context, objectID string) (resp *schema.VoteResp, err error)
- func (vr *VoteRepo) ListUserVotes(ctx context.Context, userID string, req schema.GetVoteWithPageReq, ...) (voteList []entity.Activity, total int64, err error)
- func (vr *VoteRepo) VoteDown(ctx context.Context, objectID string, userID, objectUserID string) (resp *schema.VoteResp, err error)
- func (vr *VoteRepo) VoteDownCancel(ctx context.Context, objectID string, userID, objectUserID string) (resp *schema.VoteResp, err error)
- func (vr *VoteRepo) VoteUp(ctx context.Context, objectID string, userID, objectUserID string) (resp *schema.VoteResp, err error)
- func (vr *VoteRepo) VoteUpCancel(ctx context.Context, objectID string, userID, objectUserID string) (resp *schema.VoteResp, err error)
Constants ¶
View Source
const (
UserActivated = "user.activated"
)
Variables ¶
View Source
var LimitDownActions = map[string][]string{
"question": {"vote_down", "voted_down"},
"answer": {"vote_down", "voted_down"},
"comment": {"vote_down"},
}
View Source
var LimitUpActions = map[string][]string{
"question": {"vote_up", "voted_up"},
"answer": {"vote_up", "voted_up"},
"comment": {"vote_up"},
}
Functions ¶
func NewActivityRepo ¶ added in v0.5.0
func NewActivityRepo( data *data.Data, ) activity.ActivityRepo
NewActivityRepo new repository
func NewAnswerActivityRepo ¶
func NewAnswerActivityRepo( data *data.Data, activityRepo activity_common.ActivityRepo, userRankRepo rank.UserRankRepo, ) activity.AnswerActivityRepo
NewAnswerActivityRepo new repository
func NewFollowRepo ¶
func NewFollowRepo( data *data.Data, uniqueIDRepo unique.UniqueIDRepo, activityRepo activity_common.ActivityRepo, ) follow.FollowRepo
NewFollowRepo new repository
func NewQuestionActivityRepo ¶
func NewQuestionActivityRepo( data *data.Data, activityRepo activity_common.ActivityRepo, userRankRepo rank.UserRankRepo, ) activity.QuestionActivityRepo
NewQuestionActivityRepo new repository
func NewUserActiveActivityRepo ¶
func NewUserActiveActivityRepo( data *data.Data, activityRepo activity_common.ActivityRepo, userRankRepo rank.UserRankRepo, configRepo config.ConfigRepo, ) activity.UserActiveActivityRepo
NewUserActiveActivityRepo new repository
func NewVoteRepo ¶
func NewVoteRepo( data *data.Data, uniqueIDRepo unique.UniqueIDRepo, configRepo config.ConfigRepo, activityRepo activity_common.ActivityRepo, userRankRepo rank.UserRankRepo, voteCommon activity_common.VoteRepo, ) service.VoteRepo
NewVoteRepo new repository
Types ¶
type AnswerActivityRepo ¶
type AnswerActivityRepo struct {
// contains filtered or unexported fields
}
AnswerActivityRepo answer accepted
func (*AnswerActivityRepo) AcceptAnswer ¶
func (ar *AnswerActivityRepo) AcceptAnswer(ctx context.Context, answerObjID, questionObjID, questionUserID, answerUserID string, isSelf bool, ) (err error)
AcceptAnswer accept other answer
func (*AnswerActivityRepo) CancelAcceptAnswer ¶
func (ar *AnswerActivityRepo) CancelAcceptAnswer(ctx context.Context, answerObjID, questionObjID, questionUserID, answerUserID string, ) (err error)
CancelAcceptAnswer accept other answer
func (*AnswerActivityRepo) DeleteAnswer ¶
func (ar *AnswerActivityRepo) DeleteAnswer(ctx context.Context, answerID string) (err error)
func (*AnswerActivityRepo) DeleteQuestion ¶
func (ar *AnswerActivityRepo) DeleteQuestion(ctx context.Context, questionID string) (err error)
type FollowRepo ¶
type FollowRepo struct {
// contains filtered or unexported fields
}
FollowRepo activity repository
func (*FollowRepo) Follow ¶
func (ar *FollowRepo) Follow(ctx context.Context, objectID, userID string) error
func (*FollowRepo) FollowCancel ¶
func (ar *FollowRepo) FollowCancel(ctx context.Context, objectID, userID string) error
type UserActiveActivityRepo ¶
type UserActiveActivityRepo struct {
// contains filtered or unexported fields
}
UserActiveActivityRepo answer accepted
func (*UserActiveActivityRepo) UserActive ¶
func (ar *UserActiveActivityRepo) UserActive(ctx context.Context, userID string) (err error)
UserActive accept other answer
type VoteRepo ¶
type VoteRepo struct {
// contains filtered or unexported fields
}
VoteRepo activity repository
func (*VoteRepo) GetVoteResultByObjectId ¶
func (*VoteRepo) ListUserVotes ¶
func (*VoteRepo) VoteDownCancel ¶
Click to show internal directories.
Click to hide internal directories.