activity_common

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 12 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,
	configRepo config.ConfigRepo,
) 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) 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) GetActivityTypeByObjID

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

func (*ActivityRepo) GetActivityTypeByObjKey

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

func (*ActivityRepo) GetUserIDObjectIDActivitySum

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

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(userID, objectID string) (bool, error)

IsFollowed check user if follow object or not

type VoteRepo

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

VoteRepo activity repository

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