activity_common

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActivityRepo

func NewActivityRepo(
	data *data.Data,
	uniqueIDRepo unique.UniqueIDRepo,
	configService *config.ConfigService,
) activity_common.ActivityRepo

NewActivityRepo new repository

func NewFollowRepo

func NewFollowRepo(
	data *data.Data,
	uniqueIDRepo unique.UniqueIDRepo,
	activityRepo activity_common.ActivityRepo,
) activity_common.FollowRepo

NewFollowRepo new repository

func NewVoteRepo

func NewVoteRepo(data *data.Data, activityRepo activity_common.ActivityRepo) activity_common.VoteRepo

NewVoteRepo new repository

Types

type ActivityRepo

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

ActivityRepo activity repository

func (*ActivityRepo) AddActivity

func (ar *ActivityRepo) AddActivity(ctx context.Context, activity *entity.Activity) (err error)

AddActivity add activity

func (*ActivityRepo) GetActivity

func (ar *ActivityRepo) GetActivity(ctx context.Context, session *xorm.Session,
	objectID, userID string, activityType int,
) (existsActivity *entity.Activity, exist bool, err error)

func (*ActivityRepo) GetActivityTypeByConfigKey

func (ar *ActivityRepo) GetActivityTypeByConfigKey(ctx context.Context, configKey string) (activityType int, err error)

func (*ActivityRepo) GetActivityTypeByObjID

func (ar *ActivityRepo) GetActivityTypeByObjID(ctx context.Context, objectID string, action string) (
	activityType, rank, hasRank int, err error)

func (*ActivityRepo) GetActivityTypeByObjectType

func (ar *ActivityRepo) GetActivityTypeByObjectType(ctx context.Context, objectType, action string) (activityType int, err error)

func (*ActivityRepo) GetUserIDObjectIDActivitySum

func (ar *ActivityRepo) GetUserIDObjectIDActivitySum(ctx context.Context, userID, objectID string) (int, error)

func (*ActivityRepo) GetUsersWhoHasGainedTheMostReputation

func (ar *ActivityRepo) GetUsersWhoHasGainedTheMostReputation(
	ctx context.Context, startTime, endTime time.Time, limit int) (rankStat []*entity.ActivityUserRankStat, err error)

GetUsersWhoHasGainedTheMostReputation get users who has gained the most reputation over a period of time

func (*ActivityRepo) GetUsersWhoHasVoteMost

func (ar *ActivityRepo) GetUsersWhoHasVoteMost(
	ctx context.Context, startTime, endTime time.Time, limit int) (voteStat []*entity.ActivityUserVoteStat, err error)

GetUsersWhoHasVoteMost get users who has vote most

type FollowRepo

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

FollowRepo follow repository

func (*FollowRepo) GetFollowAmount

func (ar *FollowRepo) GetFollowAmount(ctx context.Context, objectID string) (follows int, err error)

GetFollowAmount get object id's follows

func (*FollowRepo) GetFollowIDs

func (ar *FollowRepo) GetFollowIDs(ctx context.Context, userID, objectKey string) (followIDs []string, err error)

GetFollowIDs get all follow id list

func (*FollowRepo) GetFollowUserIDs

func (ar *FollowRepo) GetFollowUserIDs(ctx context.Context, objectID string) (userIDs []string, err error)

GetFollowUserIDs get follow userID by objectID

func (*FollowRepo) IsFollowed

func (ar *FollowRepo) IsFollowed(ctx context.Context, userID, objectID string) (followed bool, err error)

IsFollowed check user if follow object or not

type VoteRepo

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

VoteRepo activity repository

func (*VoteRepo) GetVoteCount

func (vr *VoteRepo) GetVoteCount(ctx context.Context, activityTypes []int) (count int64, err error)

func (*VoteRepo) GetVoteStatus

func (vr *VoteRepo) GetVoteStatus(ctx context.Context, objectID, userID string) (status string)

Jump to

Keyboard shortcuts

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