(ctx context.Context, startTime, endTime time.Time, limit int, userIDExist map[string]bool)
| 874 | } |
| 875 | |
| 876 | func (us *UserService) getActivityUserRankStat(ctx context.Context, startTime, endTime time.Time, limit int, |
| 877 | userIDExist map[string]bool) (rankStat []*entity.ActivityUserRankStat, userIDs []string, err error) { |
| 878 | if plugin.RankAgentEnabled() { |
| 879 | return make([]*entity.ActivityUserRankStat, 0), make([]string, 0), nil |
| 880 | } |
| 881 | rankStat, err = us.activityRepo.GetUsersWhoHasGainedTheMostReputation(ctx, startTime, endTime, limit) |
| 882 | if err != nil { |
| 883 | return nil, nil, err |
| 884 | } |
| 885 | for _, stat := range rankStat { |
| 886 | if stat.Rank <= 0 { |
| 887 | continue |
| 888 | } |
| 889 | if userIDExist[stat.UserID] { |
| 890 | continue |
| 891 | } |
| 892 | userIDs = append(userIDs, stat.UserID) |
| 893 | userIDExist[stat.UserID] = true |
| 894 | } |
| 895 | return rankStat, userIDs, nil |
| 896 | } |
| 897 | |
| 898 | func (us *UserService) getActivityUserVoteStat(ctx context.Context, startTime, endTime time.Time, limit int, |
| 899 | userIDExist map[string]bool) (voteStat []*entity.ActivityUserVoteStat, userIDs []string, err error) { |
no test coverage detected