优化 获取关注、粉丝列表

This commit is contained in:
2024-08-21 10:23:55 +08:00
parent 203c88dd70
commit 28df672a7d
19 changed files with 334 additions and 74 deletions

View File

@@ -216,4 +216,17 @@ public class RedisUtil {
return redisTemplate.opsForValue().increment(key, 0);
}
public final static String PERSONAL_HOMEPAGE_VIEW_KEY = "PersonalHomepage:view:";
public void increasePersonalHomepageViewCount(Long accountId) {
String key = PERSONAL_HOMEPAGE_VIEW_KEY + accountId;
redisTemplate.opsForValue().increment(key);
}
public Long getPersonalHomepageViewCount(Long accountId) {
String key = PERSONAL_HOMEPAGE_VIEW_KEY + accountId;
return redisTemplate.opsForValue().increment(key, 0);
}
}