diff --git a/model/src/main/java/cn/org/gitlink/notification/model/dao/mapper/SysNotificationMapper.java b/model/src/main/java/cn/org/gitlink/notification/model/dao/mapper/SysNotificationMapper.java index 88d5d37..fb42db0 100644 --- a/model/src/main/java/cn/org/gitlink/notification/model/dao/mapper/SysNotificationMapper.java +++ b/model/src/main/java/cn/org/gitlink/notification/model/dao/mapper/SysNotificationMapper.java @@ -39,7 +39,7 @@ public interface SysNotificationMapper extends BaseMapper { List getSysNotificationPageList(Page page, String orderBy, @Param("type") int type, - @Param("source") String source, + @Param("sources") String sources, @Param("platform") String platform, @Param("receiver") Integer receiver, @Param("status") Integer status); diff --git a/model/src/main/java/cn/org/gitlink/notification/model/service/notification/SysNotificationService.java b/model/src/main/java/cn/org/gitlink/notification/model/service/notification/SysNotificationService.java index 0c92047..74c1bf6 100644 --- a/model/src/main/java/cn/org/gitlink/notification/model/service/notification/SysNotificationService.java +++ b/model/src/main/java/cn/org/gitlink/notification/model/service/notification/SysNotificationService.java @@ -40,13 +40,13 @@ public interface SysNotificationService extends IService { * @param receiver 消息接收者 * @param status 状态 -1 全部、1 未读 2 已读 * @param type 类型 -1 全部 1 系统消息、2 @我 - * @param source + * @param sources * @param page 页码 * @param size 页大小 * @return */ - Page getNotification(String platform, Integer receiver, Integer status, Integer type, String source, Integer page, Integer size) throws Exception; + Page getNotification(String platform, Integer receiver, Integer status, Integer type, String sources, Integer page, Integer size) throws Exception; /** * @Description: 批量删除系统消息 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 5cf17cd..247566c 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 @@ -73,7 +73,7 @@ public class SysNotificationServiceImpl extends ServiceImpl getNotification(String platform, Integer receiver, Integer status, Integer type, String source, Integer page, Integer size) { + public Page getNotification(String platform, Integer receiver, Integer status, Integer type, String sources, Integer page, Integer size) { String cacheKey = cacheKeyForPage(platform, receiver, type, status, page, size); Object foundResult = this.redisUtil.get(cacheKey); if (foundResult != null) { @@ -82,7 +82,7 @@ public class SysNotificationServiceImpl extends ServiceImpl pageItem = new Page(page, size); List sysNotificationList = baseMapper.getSysNotificationPageList( - pageItem, "", type, source, platform, receiver, status + pageItem, "", type, sources, platform, receiver, status ); pageItem.setRecords(sysNotificationList); this.redisUtil.set(cacheKey, pageItem); diff --git a/model/src/main/resources/mapper/notification/SysNotificationMapper.xml b/model/src/main/resources/mapper/notification/SysNotificationMapper.xml index 87a5808..34b2ce4 100644 --- a/model/src/main/resources/mapper/notification/SysNotificationMapper.xml +++ b/model/src/main/resources/mapper/notification/SysNotificationMapper.xml @@ -202,8 +202,11 @@ and status = #{status} - - and source = #{source} + + and source in + + #{sources} + ORDER BY id DESC diff --git a/reader/src/main/java/cn/org/gitlink/notification/reader/controller/NotificationController.java b/reader/src/main/java/cn/org/gitlink/notification/reader/controller/NotificationController.java index 5368bd3..86f5a9b 100644 --- a/reader/src/main/java/cn/org/gitlink/notification/reader/controller/NotificationController.java +++ b/reader/src/main/java/cn/org/gitlink/notification/reader/controller/NotificationController.java @@ -53,7 +53,7 @@ public class NotificationController { @RequestParam(name = "type", required = false, defaultValue = "-1") Integer type, @ApiParam(value = "消息来源") - @RequestParam(name = "source", required = false) String source, + @RequestParam(name = "sources", required = false) String sources, @ApiParam(value = "页码:值为-1时(默认值),不开启分页;", required = false, defaultValue = "-1") @RequestParam(name = "page", required = false, defaultValue = "-1") Integer page, @@ -91,7 +91,7 @@ public class NotificationController { } //分页的数据 - Page foundPage = notificationService.getNotification(platform, receiver, status, type, source, page, size); + Page foundPage = notificationService.getNotification(platform, receiver, status, type, sources, page, size); if (foundPage != null) { notificationListVo.setPageNum(foundPage.getCurrent()); notificationListVo.setPageSize(foundPage.getSize());