From 280ef5100bece9b40ac51736aef037704a52a4ca Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期四, 30 七月 2026 14:58:52 +0800
Subject: [PATCH] update
---
backend/src/main/java/com/tourguide/modules/system/dto/GuideNotificationResponse.java | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/backend/src/main/java/com/tourguide/modules/system/dto/GuideNotificationResponse.java b/backend/src/main/java/com/tourguide/modules/system/dto/GuideNotificationResponse.java
index 4f29aa5..59d2131 100644
--- a/backend/src/main/java/com/tourguide/modules/system/dto/GuideNotificationResponse.java
+++ b/backend/src/main/java/com/tourguide/modules/system/dto/GuideNotificationResponse.java
@@ -1,30 +1,48 @@
package com.tourguide.modules.system.dto;
import com.tourguide.modules.system.entity.SystemNotice;
+import com.tourguide.modules.system.entity.GuideNotification;
import java.time.LocalDateTime;
public class GuideNotificationResponse {
- private final Long id;
+ private final String id;
private final String type;
private final String title;
private final String content;
private final LocalDateTime time;
private final boolean read;
+ private final Long orderId;
+ private final String targetUrl;
public GuideNotificationResponse(SystemNotice notice, boolean read) {
- this.id = notice.getId();
+ this.id = "system:" + notice.getId();
this.type = notice.getNoticeType();
this.title = notice.getNoticeTitle();
this.content = notice.getNoticeContent();
this.time = notice.getPublishTime();
this.read = read;
+ this.orderId = null;
+ this.targetUrl = null;
}
- public Long getId() { return id; }
+ public GuideNotificationResponse(GuideNotification notification) {
+ this.id = "guide:" + notification.getId();
+ this.type = notification.getNotificationType();
+ this.title = notification.getTitle();
+ this.content = notification.getContent();
+ this.time = notification.getCreatedAt();
+ this.read = notification.getReadAt() != null;
+ this.orderId = notification.getOrderId();
+ this.targetUrl = notification.getTargetUrl();
+ }
+
+ public String getId() { return id; }
public String getType() { return type; }
public String getTitle() { return title; }
public String getContent() { return content; }
public LocalDateTime getTime() { return time; }
public boolean isRead() { return read; }
+ public Long getOrderId() { return orderId; }
+ public String getTargetUrl() { return targetUrl; }
}
--
Gitblit v1.7.1