Documentation ¶
Index ¶
- func NewActivityRepo(data *data.Data, uniqueIDRepo unique.UniqueIDRepo, ...) activity_common.ActivityRepo
- func NewFollowRepo(data *data.Data, uniqueIDRepo unique.UniqueIDRepo, ...) activity_common.FollowRepo
- func NewVoteRepo(data *data.Data, activityRepo activity_common.ActivityRepo) activity_common.VoteRepo
- type ActivityRepo
- func (ar *ActivityRepo) AddActivity(ctx context.Context, activity *entity.Activity) (err error)
- func (ar *ActivityRepo) GetActivity(ctx context.Context, session *xorm.Session, objectID, userID string, ...) (existsActivity *entity.Activity, exist bool, err error)
- func (ar *ActivityRepo) GetActivityTypeByConfigKey(ctx context.Context, configKey string) (activityType int, err error)
- func (ar *ActivityRepo) GetActivityTypeByObjID(ctx context.Context, objectID string, action string) (activityType, rank, hasRank int, err error)
- func (ar *ActivityRepo) GetActivityTypeByObjectType(ctx context.Context, objectType, action string) (activityType int, err error)
- func (ar *ActivityRepo) GetUserActivitysByActivityType(ctx context.Context, userID string, activityType int) (activityList []*entity.Activity, err error)
- func (ar *ActivityRepo) GetUserIDObjectIDActivitySum(ctx context.Context, userID, objectID string) (int, error)
- func (ar *ActivityRepo) GetUsersWhoHasGainedTheMostReputation(ctx context.Context, startTime, endTime time.Time, limit int) (rankStat []*entity.ActivityUserRankStat, err error)
- func (ar *ActivityRepo) GetUsersWhoHasVoteMost(ctx context.Context, startTime, endTime time.Time, limit int) (voteStat []*entity.ActivityUserVoteStat, err error)
- type FollowRepo
- func (ar *FollowRepo) GetFollowAmount(ctx context.Context, objectID string) (follows int, err error)
- func (ar *FollowRepo) GetFollowIDs(ctx context.Context, userID, objectKey string) (followIDs []string, err error)
- func (ar *FollowRepo) GetFollowUserIDs(ctx context.Context, objectID string) (userIDs []string, err error)
- func (ar *FollowRepo) IsFollowed(ctx context.Context, userID, objectID string) (followed bool, err error)
- type VoteRepo
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 ¶
AddActivity add activity
func (*ActivityRepo) GetActivity ¶
func (*ActivityRepo) GetActivityTypeByConfigKey ¶
func (*ActivityRepo) GetActivityTypeByObjID ¶
func (*ActivityRepo) GetActivityTypeByObjectType ¶
func (*ActivityRepo) GetUserActivitysByActivityType ¶ added in v1.4.0
func (*ActivityRepo) GetUserIDObjectIDActivitySum ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.