Commit b4ff3c79 by hzc

增加未读消息过滤

parent e2a20241
...@@ -28,15 +28,16 @@ public class NoticeInfoCtrl { ...@@ -28,15 +28,16 @@ public class NoticeInfoCtrl {
@ApiOperation("根据条件搜索我的通知信息") @ApiOperation("根据条件搜索我的通知信息")
@GetMapping("find") @GetMapping("find")
public Page<NoticeInfo> find(@ApiParam("关键字搜索(标题)") @RequestParam(value = "keyword", required = false) String keyword, public Page<NoticeInfo> find(@ApiParam("关键字搜索(标题)") @RequestParam(value = "keyword", required = false) String keyword,
@ApiParam("是否已读") @RequestParam(value = "isRead",required = false) Boolean isRead,
@ApiParam("页码,从1开始") @RequestParam("pageNo") int pageNo, @ApiParam("页码,从1开始") @RequestParam("pageNo") int pageNo,
@ApiParam("每页条数") @RequestParam("pageSize") int pageSize) { @ApiParam("每页条数") @RequestParam("pageSize") int pageSize) {
PageRequest request = PageRequest.of(pageNo-1, pageSize); PageRequest request = PageRequest.of(pageNo-1, pageSize);
List<NoticeInfo> list = new ArrayList<>(); List<NoticeInfo> list = new ArrayList<>();
// String currentUserId = SystemUserUtil.getCurrentUserId(); // String currentUserId = SystemUserUtil.getCurrentUserId();
// System.out.println(currentUserId); // System.out.println(currentUserId);
long total = noticeInfoService.findByPageCount(keyword, null, SystemUserUtil.getCurrentUserId()); long total = noticeInfoService.findByPageCount(keyword, isRead, SystemUserUtil.getCurrentUserId());
if (total > 0) { if (total > 0) {
list = noticeInfoService.findByPage(keyword, null, SystemUserUtil.getCurrentUserId(), request.getOffset(), pageSize); list = noticeInfoService.findByPage(keyword, isRead, SystemUserUtil.getCurrentUserId(), request.getOffset(), pageSize);
} }
return new PageImpl<>(list, request, total); return new PageImpl<>(list, request, total);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment