rank

package
v0.0.0-...-883d24b Latest Latest
Warning

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

Go to latest
Published: Dec 9, 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

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

ChangeUserRank change user rank

func (*UserRankRepo) CheckReachLimit

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

func (*UserRankRepo) GetMaxDailyRank

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