Documentation ¶
Index ¶
- Constants
- type RankService
- func (rs *RankService) CheckOperationObjectOwner(ctx context.Context, userID, objectID string) bool
- func (rs *RankService) CheckOperationPermission(ctx context.Context, userID string, action string, objectID string) (can bool, err error)
- func (rs *RankService) CheckOperationPermissions(ctx context.Context, userID string, actions []string) (can []bool, err error)
- func (rs *RankService) CheckOperationPermissionsForRanks(ctx context.Context, userID string, actions []string) (can []bool, requireRanks []int, err error)
- func (rs *RankService) CheckVotePermission(ctx context.Context, userID, objectID string, voteUp bool) (can bool, needRank int, err error)
- func (rs *RankService) GetRankPersonalPage(ctx context.Context, req *schema.GetRankPersonalWithPageReq) (pageModel *pager.PageModel, err error)
- type UserRankRepo
Constants ¶
View Source
const (
PermissionPrefix = "rank."
)
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, roleService *role.UserRoleRelService, rolePowerService *role.RolePowerRelService, configService *config.ConfigService) *RankService
NewRankService new rank service
func (*RankService) CheckOperationObjectOwner ¶
func (rs *RankService) CheckOperationObjectOwner(ctx context.Context, userID, objectID string) bool
CheckOperationObjectOwner check operation object owner
func (*RankService) CheckOperationPermission ¶
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 ¶
func (rs *RankService) CheckOperationPermissions(ctx context.Context, userID string, actions []string) ( can []bool, err error)
CheckOperationPermissions verify that the user has permission
func (*RankService) CheckOperationPermissionsForRanks ¶
func (rs *RankService) CheckOperationPermissionsForRanks(ctx context.Context, userID string, actions []string) ( can []bool, requireRanks []int, err error)
CheckOperationPermissionsForRanks verify that the user has permission
func (*RankService) CheckVotePermission ¶
func (rs *RankService) CheckVotePermission(ctx context.Context, userID, objectID string, voteUp bool) ( can bool, needRank int, err error)
CheckVotePermission verify that the user has vote permission
func (*RankService) GetRankPersonalPage ¶
func (rs *RankService) GetRankPersonalPage(ctx context.Context, req *schema.GetRankPersonalWithPageReq) ( pageModel *pager.PageModel, err error)
GetRankPersonalPage get personal comment list page
type UserRankRepo ¶
type UserRankRepo interface { GetMaxDailyRank(ctx context.Context) (maxDailyRank int, err error) CheckReachLimit(ctx context.Context, session *xorm.Session, userID string, maxDailyRank int) (reach bool, err error) ChangeUserRank(ctx context.Context, session *xorm.Session, userID string, userCurrentScore, deltaRank int) (err error) 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) }
Click to show internal directories.
Click to hide internal directories.