rank

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QuestionAddRank               = "rank.question.add"
	QuestionEditRank              = "rank.question.edit"
	QuestionEditWithoutReviewRank = "rank.question.edit_without_review"
	QuestionDeleteRank            = "rank.question.delete"
	QuestionVoteUpRank            = "rank.question.vote_up"
	QuestionVoteDownRank          = "rank.question.vote_down"
	AnswerAddRank                 = "rank.answer.add"
	AnswerEditRank                = "rank.answer.edit"
	AnswerEditWithoutReviewRank   = "rank.answer.edit_without_review"
	AnswerDeleteRank              = "rank.answer.delete"
	AnswerAcceptRank              = "rank.answer.accept"
	AnswerVoteUpRank              = "rank.answer.vote_up"
	AnswerVoteDownRank            = "rank.answer.vote_down"
	CommentAddRank                = "rank.comment.add"
	CommentEditRank               = "rank.comment.edit"
	CommentDeleteRank             = "rank.comment.delete"
	CommentVoteUpRank             = "rank.comment.vote_up"
	CommentVoteDownRank           = "rank.comment.vote_down"
	ReportAddRank                 = "rank.report.add"
	TagAddRank                    = "rank.tag.add"
	TagEditRank                   = "rank.tag.edit"
	TagEditWithoutReviewRank      = "rank.tag.edit_without_review"
	TagDeleteRank                 = "rank.tag.delete"
	TagSynonymRank                = "rank.tag.synonym"
	LinkUrlLimitRank              = "rank.link.url_limit"
	VoteDetailRank                = "rank.vote.detail"
	AnswerAuditRank               = "rank.answer.audit"
	QuestionAuditRank             = "rank.question.audit"
	TagAuditRank                  = "rank.tag.audit"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RankService

type RankService struct {
	// contains filtered or unexported fields
}

RankService rank service

func NewRankService

func NewRankService(
	userCommon *usercommon.UserCommon,
	userRankRepo UserRankRepo,
	objectInfoService *object_info.ObjService,
	configRepo config.ConfigRepo) *RankService

NewRankService new rank service

func (*RankService) CheckOperationPermission added in v0.5.0

func (rs *RankService) CheckOperationPermission(ctx context.Context, userID string, action string, objectID string) (
	can bool, err error)

CheckOperationPermission verify that the user has permission

func (*RankService) CheckOperationPermissions added in v0.5.0

func (rs *RankService) CheckOperationPermissions(ctx context.Context, userID string, actions []string, objectID string) (
	can []bool, err error)

CheckOperationPermissions verify that the user has permission

func (*RankService) CheckVotePermission added in v0.5.0

func (rs *RankService) CheckVotePermission(ctx context.Context, userID, objectID string, voteUp bool) (
	can bool, err error)

CheckVotePermission verify that the user has vote permission

func (*RankService) GetRankPersonalWithPage

func (rs *RankService) GetRankPersonalWithPage(ctx context.Context, req *schema.GetRankPersonalWithPageReq) (
	pageModel *pager.PageModel, err error)

GetRankPersonalWithPage get personal comment list page

type UserRankRepo

type UserRankRepo interface {
	TriggerUserRank(ctx context.Context, session *xorm.Session, userId string, rank int, activityType int) (isReachStandard bool, err error)
	UserRankPage(ctx context.Context, userId string, page, pageSize int) (rankPage []*entity.Activity, total int64, err error)
}

Jump to

Keyboard shortcuts

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