Initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user