modify the key of redis cache

This commit is contained in:
wanjia 2022-10-25 10:38:14 +08:00
parent f29368dd58
commit 7629b93293
1 changed files with 3 additions and 3 deletions

View File

@ -74,7 +74,7 @@ public class SysNotificationServiceImpl extends ServiceImpl<SysNotificationMappe
@Override
public Page<SysNotification> getNotification(String platform, Integer receiver, Integer status, Integer type, String sources, Integer page, Integer size) {
String cacheKey = cacheKeyForPage(platform, receiver, type, status, page, size);
String cacheKey = cacheKeyForPage(platform, receiver, type, sources, status, page, size);
Object foundResult = this.redisUtil.get(cacheKey);
if (foundResult != null) {
return (Page<SysNotification>) foundResult;
@ -107,8 +107,8 @@ public class SysNotificationServiceImpl extends ServiceImpl<SysNotificationMappe
return String.format("%s#T%s#S%s#Count", cachePrefixForPlatform(platform, receiver), type, status);
}
private static String cacheKeyForPage(String platform, Integer receiver, Integer type, Integer status, Integer page, Integer size) {
return String.format("%s#T%s#S%s#P%s_S%s", cachePrefixForPlatform(platform, receiver), type, status, page, size);
private static String cacheKeyForPage(String platform, Integer receiver, Integer type, String sources, Integer status, Integer page, Integer size) {
return String.format("%s#T%s#%s#S%s#P%s_S%s", cachePrefixForPlatform(platform, receiver), type, sources, status, page, size);
}
private static String cachePrefixForPlatform(String platform, Integer receiver) {