activity

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func (vr *VoteRepo) CheckRank(ctx context.Context, objectID, objectUserID, userID string, action string) (activityUserID string, activityType, rank, hasRank int, err error)

func (*VoteRepo) GetVoteResultByObjectId

func (vr *VoteRepo) GetVoteResultByObjectId(ctx context.Context, objectID string) (resp *schema.VoteResp, err error)

func (*VoteRepo) ListUserVotes

func (vr *VoteRepo) ListUserVotes(
	ctx context.Context,
	userID string,
	req schema.GetVoteWithPageReq,
	activityTypes []int,
) (voteList []entity.Activity, total int64, err error)

func (*VoteRepo) VoteDown

func (vr *VoteRepo) VoteDown(ctx context.Context, objectID string, userID, objectUserID string) (resp *schema.VoteResp, err error)

func (*VoteRepo) VoteDownCancel

func (vr *VoteRepo) VoteDownCancel(ctx context.Context, objectID string, userID, objectUserID string) (resp *schema.VoteResp, err error)

func (*VoteRepo) VoteUp

func (vr *VoteRepo) VoteUp(ctx context.Context, objectID string, userID, objectUserID string) (resp *schema.VoteResp, err error)

func (*VoteRepo) VoteUpCancel

func (vr *VoteRepo) VoteUpCancel(ctx context.Context, objectID string, userID, objectUserID string) (resp *schema.VoteResp, err error)

Jump to

Keyboard shortcuts

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