| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 运维人员消息通知表 前端控制器 |
| | |
| | | /** |
| | | * 根据当前登录用户获取通知分页列表(运维APP接口) |
| | | */ |
| | | @PostMapping("/api/v1/notification/list") |
| | | @PostMapping("/maintenance-app/api/v1/notification/list") |
| | | @ApiOperation(value = "获取通知分页列表", tags = {"运维APP-消息通知"}) |
| | | public R<PageInfo<XpOperationsUserNotification>> getNotificationList( |
| | | @RequestBody XpOperationsUserNotificationPageQuery query) { |
| | |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | | @GetMapping("/api/v1/notification/unreadCount") |
| | | @GetMapping("/maintenance-app/api/v1/notification/unreadCount") |
| | | @ApiOperation(value = "获取未读通知数量", tags = {"运维APP-消息通知"}) |
| | | public R<Long> getUnreadNotificationCount() { |
| | | // 从Token中获取当前登录用户ID |
| | |
| | | return R.ok(count); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/notification/read") |
| | | @GetMapping("/maintenance-app/api/v1/notification/read") |
| | | @ApiOperation(value = "操作已读", tags = "运维APP-消息通知") |
| | | public R<?> readNotification(@RequestParam Long notificationId){ |
| | | notificationService.lambdaUpdate().set(XpOperationsUserNotification::getReadStatus, 1).eq(XpOperationsUserNotification::getId, notificationId).update(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/logan/inner/v1/notification/addBatch") |
| | | @ApiOperation(value = "批量添加通知", tags = {"内部接口"}) |
| | | public R<?> addNotificationBatch(@RequestBody List<XpOperationsUserNotification> notifications) { |
| | | notificationService.addNotificationBatch(notifications); |
| | | return R.ok(); |
| | | } |
| | | } |