Files
CompanyRegister/backend/src/main/java/com/smartoffice/notification/NotificationDto.java
2026-01-28 23:56:33 +08:00

24 lines
616 B
Java

package com.smartoffice.notification;
import java.time.Instant;
public record NotificationDto(
Long id,
NotificationType type,
String title,
String content,
Instant readAt,
Instant createdAt
) {
public static NotificationDto from(Notification notification) {
return new NotificationDto(
notification.getId(),
notification.getType(),
notification.getTitle(),
notification.getContent(),
notification.getReadAt(),
notification.getCreatedAt()
);
}
}