-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotificationOutput.java
More file actions
26 lines (23 loc) · 997 Bytes
/
NotificationOutput.java
File metadata and controls
26 lines (23 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.example.moim.notification.dto;
import com.example.moim.notification.entity.NotificationEntity;
import java.time.format.DateTimeFormatter;
import lombok.Data;
@Data
public class NotificationOutput {
private Long id;
private String notificationType;
private String title;
private String content;
private String createdAt;
private Boolean isRead;
private String actionUrl;
public NotificationOutput(NotificationEntity notificationEntity) {
this.id = notificationEntity.getId();
this.title = notificationEntity.getTitle();
this.notificationType = notificationEntity.getType().name();
this.content = notificationEntity.getContent();
this.createdAt = notificationEntity.getCreatedDate().format(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm"));
this.isRead = notificationEntity.getIsRead();
this.actionUrl = notificationEntity.getType().getCategory() + "/" + notificationEntity.getLinkedId();
}
}