| | |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | @Api(tags = "公告接口-学员端") |
| | | @Api(tags = "公告接口-学员端") |
| | | @RestController |
| | | @RequestMapping(value = "/stu/notice") |
| | | public class StuNoticeController { |
| | |
| | | * @param classId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "公告列表", notes = "获取班级列表及班级所在公告列表") |
| | | @ApiOperation(value = "公告列表", notes = "获取班级列表及班级所在公告列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "classId", value = "班级id", required = false, paramType="query", dataType = "String") |
| | | @ApiImplicitParam(name = "classId", value = "班级id", required = false, paramType="query", dataType = "String") |
| | | }) |
| | | @GetMapping(value = "list") |
| | | public Result list(Integer pageNum, Integer pageSize, String classId) { |
| | | |
| | | //获取班级列表及班级所在通知列表 |
| | | //获取班级列表及班级所在通知列表 |
| | | List<String> noticeIds = dao.getClassNotices(StringUtils.isEmpty(classId)?ClientUtils.getClassId():classId); |
| | | List<Notice> notices = noticeService.readByStatus(noticeIds, Notice.STATUS_ISSUED); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取未读消息总数 |
| | | * 获取未读消息总数 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取未读消息总数") |
| | | @ApiOperation(value = "获取未读消息总数") |
| | | @GetMapping(value = "getCountToView") |
| | | public Result getCountToView() { |
| | | |
| | | //获取班级列表及班级所在通知列表 |
| | | //获取班级列表及班级所在通知列表 |
| | | List<ClsClass> clsLst = classService.listMyClass(); |
| | | Set<String> noticeIdLst = new HashSet<String>(10); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取通知详情 |
| | | * 获取通知详情 |
| | | * |
| | | * @param noticeId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取公告详情") |
| | | @ApiOperation(value = "获取公告详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "noticeId", value = "公告id", required = true, paramType="query", dataType = "String") |
| | | @ApiImplicitParam(name = "noticeId", value = "公告id", required = true, paramType="query", dataType = "String") |
| | | }) |
| | | @GetMapping(value = "detail") |
| | | public Result detail(String noticeId) { |
| | | Notice notice = noticeService.read(noticeId); |
| | | dao.addReadCount(noticeId, ClientUtils.getUserId());//记录学员已读通知的人数; |
| | | dao.addReadCount(noticeId, ClientUtils.getUserId());//记录学员已读通知的人数; |
| | | return new Result(true, "success", |
| | | CollectionUtils.newObjectMap( |
| | | "noticeName", notice.getTitle(), |
| | |
| | | )); |
| | | } |
| | | |
| | | @ApiOperation(value = "更新公告查看次数", notes = "") |
| | | @ApiOperation(value = "更新公告查看次数", notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "noticeId", value = "公告id", required = true, paramType = "query", dataType = "String") |
| | | @ApiImplicitParam(name = "noticeId", value = "公告id", required = true, paramType = "query", dataType = "String") |
| | | }) |
| | | @GetMapping(value = "view") |
| | | public Result view(String noticeId) { |