From ba78f764042ca15bf3f3be62e7a3fc699df56d67 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期六, 07 三月 2026 20:59:53 +0800
Subject: [PATCH] 提交管理后台新接口,修改XPU报文相关功能,增加测试小程序状态流转接口

---
 xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/XpOperationsUserNotificationController.java |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/XpOperationsUserNotificationController.java b/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/XpOperationsUserNotificationController.java
index 2efc1fa..84330c6 100644
--- a/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/XpOperationsUserNotificationController.java
+++ b/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/XpOperationsUserNotificationController.java
@@ -9,9 +9,7 @@
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * <p>
@@ -55,4 +53,21 @@
 
         return R.ok(pageInfo);
     }
+
+    @GetMapping("/api/v1/notification/unreadCount")
+    @ApiOperation(value = "获取未读通知数量", tags = {"运维APP-消息通知"})
+    public R<Long> getUnreadNotificationCount() {
+        // 从Token中获取当前登录用户ID
+        Long currentUserId = tokenService.getLoginOperationUser().getId();
+        Long count = notificationService.lambdaQuery().eq(XpOperationsUserNotification::getOperationsUserId, currentUserId)
+                .eq(XpOperationsUserNotification::getReadStatus, 0).count();
+        return R.ok(count);
+    }
+
+    @PostMapping("/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();
+    }
 }

--
Gitblit v1.7.1