aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-08-02 15:58:45 +0300
committerGravatar Vitaly Takmazov2019-08-02 15:58:45 +0300
commit82cbd49555a723f91ed3684a64debeade9c0b3f8 (patch)
treea26a7dcdf9af3dd4d9bb212c32e7a88e84980a3a /src/main/java/com/juick/service
parentc8eeadee42695ed67dac47dbb9d7a66a1c9a8c6d (diff)
More caches
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r--src/main/java/com/juick/service/MessagesService.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/com/juick/service/MessagesService.java b/src/main/java/com/juick/service/MessagesService.java
index 490e0cfc..2b75a53a 100644
--- a/src/main/java/com/juick/service/MessagesService.java
+++ b/src/main/java/com/juick/service/MessagesService.java
@@ -32,10 +32,10 @@ import java.util.*;
* Created by aalexeev on 11/13/16.
*/
public interface MessagesService {
- @CacheEvict(value = "discussions", allEntries = true)
+ @CacheEvict(value = { "discussions", "messages", "replies" }, allEntries = true)
int createMessage(int uid, String txt, String attachment, List<com.juick.Tag> tags);
- @CacheEvict(value = "discussions", allEntries = true)
+ @CacheEvict(value = { "discussions", "messages", "replies" }, allEntries = true)
int createReply(int mid, int rid, User user, String txt, String attachment);
int getReplyIDIncrement(int mid);
@@ -87,7 +87,7 @@ public interface MessagesService {
List<Integer> getPrivate(int uid, int before);
- @Cacheable(value = "discussions", key="#uid")
+ @Cacheable(value = "discussions", key="#uid + #to")
List<Integer> getDiscussions(int uid, Long to);
List<Integer> getRecommended(int uid, int before);
@@ -112,10 +112,12 @@ public interface MessagesService {
List<Integer> getUserSearch(User visitor, int UID, String search, int privacy, int page);
+ @Cacheable(value = "messages", key="#visitor.uid + #mids.hashCode()")
List<com.juick.Message> getMessages(User visitor, List<Integer> mids);
Map<Integer,Set<Reaction>> updateReactionsFor(final List<Integer> mid);
+ @Cacheable(value = "replies", key="#user.uid + #mid")
List<com.juick.Message> getReplies(User user, int mid);
boolean setMessagePopular(int mid, int popular);