From 9558ad87cc950bd67306aa31e5f3b7de367258ae Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 20 一月 2026 17:29:23 +0800
Subject: [PATCH] 2026.1.20 1. 新增自巡查承诺功能接口
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/NotificationController.kt | 53 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 42 insertions(+), 11 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/NotificationController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/NotificationController.kt
index b47b946..e5538ae 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/NotificationController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/NotificationController.kt
@@ -1,10 +1,12 @@
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
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
+import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
import javax.servlet.http.HttpServletResponse
@@ -13,38 +15,67 @@
@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
fun getNotificationUnRead(
- @RequestParam(value = "userId") userId: String,
- @RequestParam(value = "page") page: Int,
- @RequestParam(value = "per_page") perPage: Int,
- response: HttpServletResponse
+ @ApiParam("鐢ㄦ埛id") @RequestParam(value = "userId") userId: String,
+ @ApiParam("椤电爜") @RequestParam(value = "page") page: Int,
+ @ApiParam("鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int,
+ response: HttpServletResponse
) = notificationService.getNotificationUnRead(userId, page, perPage, response)
@ApiOperation(value = "鏇存柊閫氱煡璇诲彇鐘舵��")
@PostMapping("/{userId}/readState")
fun updateReadState(
- @PathVariable("userId") userId: String,
- @RequestBody readStates: List<NoticeReadStateVo>
+ @ApiParam("鐢ㄦ埛id") @PathVariable("userId") userId: String,
+ @ApiParam("閫氱煡璇诲彇鐘舵��") @RequestBody readStates: List<NoticeReadStateVo>
) = notificationService.updateReadState(userId, readStates)
@ApiOperation(value = "鑾峰彇閫氱煡闀挎枃鏈唴瀹�")
@GetMapping("/text")
fun getNotificationText(
- @RequestParam(value = "id") notificationId: String
+ @ApiParam("閫氱煡id") @RequestParam(value = "id") notificationId: String
) = notificationService.getNotificationText(notificationId)
@ApiOperation(value = "鑾峰彇鎬绘湭璇婚�氱煡鏁伴噺")
@GetMapping("/{userId}/unread")
fun getUnReadNoticeNum(
- @PathVariable("userId") userId: String
+ @ApiParam("鐢ㄦ埛id") @PathVariable("userId") userId: String
) = notificationService.getUnReadNoticeNum(userId)
@ApiOperation(value = "鍙戝竷閫氱煡")
- @PostMapping("{userId}/release")
+ @PostMapping("/{userId}/release")
fun releaseNotice(
- @PathVariable("userId") userId: String,
- @RequestBody notice: NotificationVo
+ @ApiParam("鐢ㄦ埛id") @PathVariable("userId") userId: String,
+ @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)
}
\ No newline at end of file
--
Gitblit v1.9.3