activity_common

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 9 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

This section is empty.

Types

type ActivityCommon

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

func NewActivityCommon

func NewActivityCommon(
	activityRepo ActivityRepo,
	activityQueueService activity_queue.ActivityQueueService,
) *ActivityCommon

NewActivityCommon new activity common

func (*ActivityCommon) HandleActivity

func (ac *ActivityCommon) HandleActivity(ctx context.Context, msg *schema.ActivityMsg) error

HandleActivity handle activity message

type ActivityRepo

type ActivityRepo interface {
	GetActivityTypeByObjID(ctx context.Context, objectId string, action string) (activityType, rank int, hasRank int, err error)
	GetActivityTypeByObjectType(ctx context.Context, objectKey, action string) (activityType int, err error)
	GetActivity(ctx context.Context, session *xorm.Session, objectID, userID string, activityType int) (
		existsActivity *entity.Activity, exist bool, err error)
	GetUserActivitiesByActivityType(ctx context.Context, userID string, activityType int) (activityList []*entity.Activity, err error)
	GetUserIDObjectIDActivitySum(ctx context.Context, userID, objectID string) (int, error)
	GetActivityTypeByConfigKey(ctx context.Context, configKey string) (activityType int, err error)
	AddActivity(ctx context.Context, activity *entity.Activity) (err error)
	GetUsersWhoHasGainedTheMostReputation(
		ctx context.Context, startTime, endTime time.Time, limit int) (rankStat []*entity.ActivityUserRankStat, err error)
	GetUsersWhoHasVoteMost(
		ctx context.Context, startTime, endTime time.Time, limit int) (voteStat []*entity.ActivityUserVoteStat, err error)
}

type FollowRepo

type FollowRepo interface {
	GetFollowIDs(ctx context.Context, userID, objectType string) (followIDs []string, err error)
	GetFollowAmount(ctx context.Context, objectID string) (followAmount int, err error)
	GetFollowUserIDs(ctx context.Context, objectID string) (userIDs []string, err error)
	IsFollowed(ctx context.Context, userId, objectId string) (bool, error)
	MigrateFollowers(ctx context.Context, sourceObjectID, targetObjectID, action string) error
}

type VoteRepo

type VoteRepo interface {
	GetVoteStatus(ctx context.Context, objectId, userId string) (status string)
	GetVoteCount(ctx context.Context, activityTypes []int) (count int64, err error)
}

VoteRepo activity repository

Jump to

Keyboard shortcuts

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