| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.domain.entity.NoticeConfig |
| | | import cn.flightfeather.supervision.lightshare.service.NotificationService |
| | | import cn.flightfeather.supervision.lightshare.vo.NoticeReadStateVo |
| | | import cn.flightfeather.supervision.lightshare.vo.NotificationVo |
| | |
| | | @RestController |
| | | @RequestMapping("/notifications") |
| | | class NotificationController(val notificationService: NotificationService) { |
| | | |
| | | @ApiOperation(value = "按查询条件获取通知") |
| | | @PostMapping("/history") |
| | | fun getAllNotices( |
| | | @ApiParam("用户id") @RequestParam(value = "userId") userId: String, |
| | | @ApiParam("通知查询条件") @RequestBody noticeConfig: NoticeConfig, |
| | | @ApiParam("页码") @RequestParam(value = "page") page: Int, |
| | | @ApiParam("单页数据量") @RequestParam(value = "per_page") perPage: Int, |
| | | ) = notificationService.getAllNotices(userId, noticeConfig, page, perPage) |
| | | |
| | | @ApiOperation(value = "获取用户未读通知") |
| | | @GetMapping |
| | |
| | | @ApiParam("通知") @RequestBody notice: NotificationVo |
| | | ) = notificationService.releaseNotice(userId, notice) |
| | | |
| | | @ApiOperation(value = "发布通知") |
| | | @PostMapping("/{userId}/release2") |
| | | fun releaseNotice2( |
| | | @ApiParam("用户id") @PathVariable("userId") userId: String, |
| | | @ApiParam("通知") @RequestBody notice: NotificationVo |
| | | ) = notificationService.releaseNotice2(userId, notice) |
| | | |
| | | @ApiOperation(value = "推送一条微信订阅消息") |
| | | @GetMapping("/wx/message/subscribe/send") |
| | | fun pushMsgWx( |
| | | @ApiParam("模板id") @RequestParam("templateId") templateId: Int |
| | | ) = notificationService.pushMsgWx(templateId) |
| | | |
| | | @ApiOperation(value = "获取通知模板") |
| | | @GetMapping("/template") |
| | | fun getTemplate( |
| | | @ApiParam("通知类型") @RequestParam("typeId") typeId: Int, |
| | | @ApiParam("通知子类型") @RequestParam("subTypeId") subTypeId: Int, |
| | | ) = notificationService.getTemplate(typeId, subTypeId) |
| | | } |