11package clap.server.application.service.webhook;
22
3- import clap.server.adapter.inbound.web.dto.notification.request.SseRequest;
43import clap.server.adapter.outbound.api.dto.PushNotificationTemplate;
54import clap.server.adapter.outbound.persistense.entity.notification.constant.NotificationType;
65import clap.server.application.port.outbound.notification.CommandNotificationPort;
7- import clap.server.application.port.outbound.webhook.SendSsePort;
86import clap.server.common.annotation.architecture.ApplicationService;
97import clap.server.domain.model.member.Member;
108import clap.server.domain.model.notification.Notification;
2018@RequiredArgsConstructor
2119public class SendNotificationService {
2220
23- private final SendSsePort sendSsePort ;
21+ private final SendSseService sendSseService ;
2422 private final SendAgitService sendAgitService;
2523 private final SendWebhookEmailService sendWebhookEmailService;
2624 private final SendKaKaoWorkService sendKaKaoWorkService;
@@ -35,13 +33,6 @@ public void sendPushNotification(Member receiver, NotificationType notificationT
3533
3634 Notification notification = createTaskNotification(task, receiver, notificationType, message, taskTitle);
3735
38- SseRequest sseRequest = new SseRequest(
39- taskTitle,
40- notificationType,
41- receiver.getMemberId(),
42- message
43- );
44-
4536 PushNotificationTemplate pushNotificationTemplate = new PushNotificationTemplate(
4637 email, notificationType, taskTitle, requesterNickname, message, commenterName
4738 );
@@ -51,7 +42,7 @@ public void sendPushNotification(Member receiver, NotificationType notificationT
5142 });
5243
5344 CompletableFuture<Void> sendSseFuture = CompletableFuture.runAsync(() -> {
54- sendSsePort .send(sseRequest );
45+ sendSseService .send(receiver, notificationType, task, message );
5546 });
5647
5748 CompletableFuture<Void> sendEmailFuture = CompletableFuture.runAsync(() -> {
0 commit comments