From ad4d10fcf02c8bc1347360223390978e29088f05 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 27 二月 2026 16:43:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
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