diff options
author | Vitaly Takmazov | 2023-01-22 20:57:17 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-22 20:57:17 +0300 |
commit | b08f5b104bdd98e2b422420479a1a962a4fb9d78 (patch) | |
tree | ef94a72be2aff434a2f8a8d05a149c0fe54763f7 | |
parent | 478a7bfba88401c1996d0be5a144459011b60e10 (diff) |
twitter_user cache
-rw-r--r-- | src/main/java/com/juick/service/UserService.java | 4 | ||||
-rw-r--r-- | src/main/resources/application.properties | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/juick/service/UserService.java b/src/main/java/com/juick/service/UserService.java index eeabf42e..05725b73 100644 --- a/src/main/java/com/juick/service/UserService.java +++ b/src/main/java/com/juick/service/UserService.java @@ -100,7 +100,7 @@ public interface UserService { List<User> getUserFriends(int uid); List<User> getUserBLUsers(int uid); - + @CacheEvict(value = "twitter_user", key="{ #user.getUid() }") boolean linkTwitterAccount(User user, String accessToken, String accessTokenSecret, String screenName); int getStatsMessages(int uid); @@ -127,6 +127,7 @@ public interface UserService { Optional<ExternalToken> getTwitterToken(int uid); + @CacheEvict(value = "twitter_user", key="{ #uid }") boolean deleteTwitterToken(Integer uid); void addFacebookState(String state, String redirectUri); @@ -146,6 +147,7 @@ public interface UserService { void disableFBCrosspost(Integer uid); @Nonnull + @Cacheable(value = "twitter_user") String getTwitterName(int uid); String getTelegramName(int uid); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 16da22e6..ecea6a79 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,7 +8,7 @@ spring.datasource.generate-unique-name=false spring.flyway.locations=classpath:db/migration,classpath:db/specific/{vendor} spring.sql.init.platform=h2 spring.cache.type=simple -spring.cache.cache-names=help, usernames, users_by_name, discover, discussions, messages, replies, popular_tags, profiles +spring.cache.cache-names=help, usernames, users_by_name, discover, discussions, messages, replies, popular_tags, profiles, twitter_user spring.profiles.active=@activatedProperties@ springdoc.swagger-ui.path=/api/swagger-ui.html server.forward-headers-strategy=framework |