modify the key of redis cache
This commit is contained in:
parent
f29368dd58
commit
7629b93293
|
|
@ -74,7 +74,7 @@ public class SysNotificationServiceImpl extends ServiceImpl<SysNotificationMappe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<SysNotification> getNotification(String platform, Integer receiver, Integer status, Integer type, String sources, Integer page, Integer size) {
|
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);
|
Object foundResult = this.redisUtil.get(cacheKey);
|
||||||
if (foundResult != null) {
|
if (foundResult != null) {
|
||||||
return (Page<SysNotification>) foundResult;
|
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);
|
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) {
|
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#P%s_S%s", cachePrefixForPlatform(platform, receiver), type, status, page, 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) {
|
private static String cachePrefixForPlatform(String platform, Integer receiver) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue