| | |
| | | } |
| | | |
| | | /** |
| | | * 记录已读的学员 |
| | | * 记录已读的学员 |
| | | * |
| | | * @param noticeId |
| | | * @param userId |
| | | */ |
| | | public void addReadCount(String noticeId, String userId) { |
| | | cache.lstRemove("noticeReadCount" + noticeId, userId);//删除用户之前查看的记录,避免重复记录; |
| | | cache.lstRemove("noticeReadCount" + noticeId, userId);//删除用户之前查看的记录,避免重复记录; |
| | | cache.lstRightPush("noticeReadCount" + noticeId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 获取已读的学员人数 |
| | | * 获取已读的学员人数 |
| | | */ |
| | | public int getReadCount(String noticeId) { |
| | | List<Object> lstAll = cache.lstAll("noticeReadCount" + noticeId); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除cache的key |
| | | * 删除cache的key |
| | | */ |
| | | public void deleteNoticeForCache(String noticeId) { |
| | | cache.delete("noticeReadCount" + noticeId); |