rank

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUserRankRepo

func NewUserRankRepo(data *data.Data, configService *config.ConfigService) rank.UserRankRepo

NewUserRankRepo new repository

Types

type UserRankRepo

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

UserRankRepo user rank repository

func (*UserRankRepo) ChangeUserRank added in v1.1.1

func (ur *UserRankRepo) ChangeUserRank(
	ctx context.Context, session *xorm.Session, userID string, userCurrentScore, deltaRank int) (err error)

ChangeUserRank change user rank

func (*UserRankRepo) CheckReachLimit added in v1.1.1

func (ur *UserRankRepo) CheckReachLimit(ctx context.Context, session *xorm.Session,
	userID string, maxDailyRank int) (
	reach bool, err error)

func (*UserRankRepo) GetMaxDailyRank added in v1.1.1

func (ur *UserRankRepo) GetMaxDailyRank(ctx context.Context) (maxDailyRank int, err error)

func (*UserRankRepo) TriggerUserRank

func (ur *UserRankRepo) TriggerUserRank(ctx context.Context,
	session *xorm.Session, userID string, deltaRank int, activityType int,
) (isReachStandard bool, err error)

TriggerUserRank trigger user rank change session is need provider, it means this action must be success or failure if outer action is failed then this action is need rollback

func (*UserRankRepo) UserRankPage

func (ur *UserRankRepo) 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