[AB-210] improving performance of star stats

This commit is contained in:
Sheldan
2021-03-24 20:11:32 +01:00
parent ddb256cf75
commit 134f25955c
16 changed files with 88 additions and 15 deletions

View File

@@ -15,5 +15,5 @@ public class GuildStarStatsModel {
private List<StarStatsUser> starGiver;
private Integer totalStars;
private List<String> badgeEmotes;
private Integer starredMessages;
private Long starredMessages;
}

View File

@@ -12,7 +12,7 @@ public class StarStatsPost {
private Long serverId;
private Long channelId;
private Long messageId;
private Integer starCount;
private Long starCount;
public String getMessageUrl() {
return MessageUtils.buildMessageUrl(serverId ,channelId, messageId);

View File

@@ -17,7 +17,7 @@ public interface StarboardPostManagementService {
Long retrieveGivenStarsOfUserInServer(Long serverId, Long userId);
Long retrieveReceivedStarsOfUserInServer(Long serverId, Long userId);
List<StarboardPost> retrieveAllPosts(Long serverId);
Integer getPostCount(Long serverId);
Long getPostCount(Long serverId);
Optional<StarboardPost> findByMessageId(Long messageId);
Optional<StarboardPost> findByStarboardPostId(Long postId);
Optional<StarboardPost> findByStarboardPostMessageId(Long postId);

View File

@@ -15,4 +15,5 @@ public interface StarboardPostReactorManagementService {
Integer getStarCount(Long serverId);
List<CompletableFuture<StarStatsUser>> retrieveTopStarGiver(Long serverId, Integer count);
List<CompletableFuture<StarStatsUser>> retrieveTopStarReceiver(Long serverId, Integer count);
Long getReactorCountOfPost(StarboardPost starboardPost);
}