activity_common

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) GetUserActivitiesByActivityType added in v1.4.5

func (ar *ActivityRepo) GetUserActivitiesByActivityType(ctx context.Context, userID string, activityType int) (
	activityList []*entity.Activity, 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

func (*FollowRepo) MigrateFollowers added in v1.5.0

func (ar *FollowRepo) MigrateFollowers(ctx context.Context, sourceObjectID, targetObjectID, action string) error

MigrateFollowers migrate followers from source object to target object

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