Skip to content

Commit 00a3902

Browse files
authored
Update SendNotificationService.java
1 parent 69ae96f commit 00a3902

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/main/java/clap/server/application/service/webhook/SendNotificationService.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ public class SendNotificationService {
2626

2727
@Async("notificationExecutor")
2828
public void sendPushNotification(Member receiver, NotificationType notificationType,
29-
Task task, String message, String commenterName) {
29+
Task task, String message, String commenterName, Boolean isManager) {
30+
3031
String email = receiver.getMemberInfo().getEmail();
3132
String taskTitle = task.getTitle();
3233
String requesterNickname = task.getRequester().getNickname();
3334

35+
String taskDetailUrl = extractTaskUrl(notificationType, task, isManager);
36+
3437
Notification notification = createTaskNotification(task, receiver, notificationType, message, taskTitle);
3538

3639
PushNotificationTemplate pushNotificationTemplate = new PushNotificationTemplate(
@@ -41,23 +44,32 @@ public void sendPushNotification(Member receiver, NotificationType notificationT
4144
commandNotificationPort.save(notification);
4245
});
4346

44-
CompletableFuture<Void> sendSseFuture = CompletableFuture.runAsync(() -> {
45-
sendSseService.send(receiver, notificationType, task, message);
46-
});
47-
4847
CompletableFuture<Void> sendEmailFuture = CompletableFuture.runAsync(() -> {
4948
if (receiver.getEmailNotificationEnabled()) {
50-
sendWebhookEmailService.send(pushNotificationTemplate);
49+
sendWebhookEmailService.send(pushNotificationTemplate, taskDetailUrl);
5150
}
5251
});
5352

5453
CompletableFuture<Void> sendKakaoWorkFuture = CompletableFuture.runAsync(() -> {
5554
if (receiver.getKakaoworkNotificationEnabled()) {
56-
sendKaKaoWorkService.send(pushNotificationTemplate);
55+
sendKaKaoWorkService.send(pushNotificationTemplate, taskDetailUrl);
5756
}
5857
});
5958

60-
CompletableFuture<Void> allOf = CompletableFuture.allOf(saveNotification, sendSseFuture,
59+
//Todo : SSE 구현시 추가
60+
//SseRequest sseRequest = new SseRequest(
61+
// taskTitle,
62+
// notificationType,
63+
// receiver.getMemberId(),
64+
// message
65+
//);
66+
67+
//Todo : SSE 구현시 추가
68+
//CompletableFuture<Void> sendSseFuture = CompletableFuture.runAsync(() -> {
69+
// sendSsePort.send(sseRequest);
70+
//});
71+
72+
CompletableFuture<Void> allOf = CompletableFuture.allOf(saveNotification,
6173
sendEmailFuture, sendKakaoWorkFuture);
6274
allOf.join();
6375
}

0 commit comments

Comments
 (0)