diff --git a/model/src/main/java/cn/org/gitlink/notification/model/service/notification/impl/SysNotificationServiceImpl.java b/model/src/main/java/cn/org/gitlink/notification/model/service/notification/impl/SysNotificationServiceImpl.java index 56a2b09..3324ffa 100644 --- a/model/src/main/java/cn/org/gitlink/notification/model/service/notification/impl/SysNotificationServiceImpl.java +++ b/model/src/main/java/cn/org/gitlink/notification/model/service/notification/impl/SysNotificationServiceImpl.java @@ -1,6 +1,5 @@ package cn.org.gitlink.notification.model.service.notification.impl; -import cn.org.gitlink.notification.common.constant.NotificationSystemConstant; import cn.org.gitlink.notification.common.utils.RedisUtil; import cn.org.gitlink.notification.model.dao.entity.SysNotification; import cn.org.gitlink.notification.model.dao.entity.vo.NewSysNotificationVo; @@ -19,7 +18,7 @@ import java.util.List; @Service(value = "SysNotificationServiceImpl") public class SysNotificationServiceImpl extends ServiceImpl implements SysNotificationService { - private static final String CACHE_KEY_PREFFIX = "GITLINK-CACHE#R"; + private static final String CACHE_KEY_PREFFIX = "GNSCache#"; @Autowired @@ -40,7 +39,7 @@ public class SysNotificationServiceImpl extends ServiceImpl 0) { - this.delUserCache(receiver); + this.delUserCache(platform, receiver); } return count; } @Override public int getUnreadNotificationCount(String platform, Integer receiver) throws Exception { - String KEY_ALL_COUNT = CACHE_KEY_PREFFIX + receiver + "#COUNT"; + String KEY_ALL_COUNT = CACHE_KEY_PREFFIX + platform.toUpperCase() + "#" + receiver + "#COUNT"; Object foundResult = this.redisUtil.get(KEY_ALL_COUNT); if (foundResult != null) { return (Integer) foundResult; @@ -68,7 +67,7 @@ public class SysNotificationServiceImpl extends ServiceImpl getUnreadNotificationByType(String platform, Integer receiver, Integer size, Integer type) throws Exception { - String KEY_TYPE_LIST = CACHE_KEY_PREFFIX + receiver + "#T" + type + "#LIST"; + String KEY_TYPE_LIST = CACHE_KEY_PREFFIX + platform.toUpperCase() + "#" + receiver + "#T" + type + "#LIST"; Object foundResult = this.redisUtil.get(KEY_TYPE_LIST); if (foundResult != null) { return (List) foundResult; @@ -80,7 +79,7 @@ public class SysNotificationServiceImpl extends ServiceImpl getNotification(int type, int page, int size, String orderBy, String platform, Integer receiver) throws Exception { - String KEY_PAGE_LIST = CACHE_KEY_PREFFIX + receiver + "P" + page + "S" + size + "T" + type + "#LIST"; + String KEY_PAGE_LIST = CACHE_KEY_PREFFIX + platform.toUpperCase() + "#" + receiver + "P" + page + "S" + size + "T" + type + "#LIST"; Object foundResult = this.redisUtil.get(KEY_PAGE_LIST); if (foundResult != null) { return (Page) foundResult; @@ -109,7 +108,7 @@ public class SysNotificationServiceImpl extends ServiceImpl