diff --git a/src/main/java/clap/server/adapter/outbound/api/agit/AgitTemplateBuilder.java b/src/main/java/clap/server/adapter/outbound/api/agit/AgitTemplateBuilder.java index cac0c9f1..aaf6fb00 100644 --- a/src/main/java/clap/server/adapter/outbound/api/agit/AgitTemplateBuilder.java +++ b/src/main/java/clap/server/adapter/outbound/api/agit/AgitTemplateBuilder.java @@ -52,8 +52,8 @@ public String createMessage(PushNotificationTemplate request, String taskDetailU case PROCESSOR_CHANGED -> "담당자가 " + "*" + request.message() + "*" + "으로 변경되었습니다."; - case PROCESSOR_ASSIGNED -> "작업이 *승인*되었습니다.*\n" - + "\\t\\t*• 👤 담당자:* " + "*" + request.message() + "*"; + case PROCESSOR_ASSIGNED -> "*작업*이 *승인*되었습니다.\\n" + + "\\t\\t*•담당자:* " + "*" + request.message() + "*"; default -> null; }; diff --git a/src/main/java/clap/server/adapter/outbound/persistense/repository/notification/NotificationRepository.java b/src/main/java/clap/server/adapter/outbound/persistense/repository/notification/NotificationRepository.java index b871a0cf..9a364a83 100644 --- a/src/main/java/clap/server/adapter/outbound/persistense/repository/notification/NotificationRepository.java +++ b/src/main/java/clap/server/adapter/outbound/persistense/repository/notification/NotificationRepository.java @@ -25,7 +25,7 @@ Slice findAllByReceiver_MemberIdOrderByCreatedAtDesc( @Query("SELECT n FROM NotificationEntity n " + "WHERE n.receiver.memberId = :receiverId " + "AND n.task.isDeleted = false") - List findAllByReceiver_MemberId(Long memberId); + List findAllByReceiver_MemberId(Long receiverId); List findByTask_TaskId(Long taskId); diff --git a/src/main/java/clap/server/application/service/task/TerminateTaskService.java b/src/main/java/clap/server/application/service/task/TerminateTaskService.java index ecb92333..8223e79f 100644 --- a/src/main/java/clap/server/application/service/task/TerminateTaskService.java +++ b/src/main/java/clap/server/application/service/task/TerminateTaskService.java @@ -28,7 +28,6 @@ public class TerminateTaskService implements TerminateTaskUsecase { @Override public void terminateTask(Long memberId, Long taskId, String reason) { - memberService.findReviewer(memberId); Task task = taskService.findById(taskId); task.terminateTask(); taskService.upsert(task); @@ -42,5 +41,6 @@ public void terminateTask(Long memberId, Long taskId, String reason) { private void publishNotification(Member receiver, Task task, String message, String reason) { sendNotificationService.sendPushNotification(receiver, NotificationType.STATUS_SWITCHED, task, message, reason, null, false); + sendNotificationService.sendAgitNotification(NotificationType.STATUS_SWITCHED, task, message, null); } } diff --git a/src/main/java/clap/server/application/service/webhook/SendAgitService.java b/src/main/java/clap/server/application/service/webhook/SendAgitService.java index 4b004702..bdcb34ba 100644 --- a/src/main/java/clap/server/application/service/webhook/SendAgitService.java +++ b/src/main/java/clap/server/application/service/webhook/SendAgitService.java @@ -7,6 +7,7 @@ import clap.server.domain.model.task.Task; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; @Service @RequiredArgsConstructor @@ -15,6 +16,7 @@ public class SendAgitService { private final SendAgitPort agitPort; private final TaskService taskService; + @Transactional public void sendAgit(PushNotificationTemplate request, Task task, String taskDetailUrl) { Long agitPostId = agitPort.sendAgit(request, task, taskDetailUrl); diff --git a/src/main/java/clap/server/application/service/webhook/SendNotificationService.java b/src/main/java/clap/server/application/service/webhook/SendNotificationService.java index f28c4852..1957bfd9 100644 --- a/src/main/java/clap/server/application/service/webhook/SendNotificationService.java +++ b/src/main/java/clap/server/application/service/webhook/SendNotificationService.java @@ -86,7 +86,6 @@ public void sendPushNotification(Member receiver, NotificationType notificationT } @Async("notificationExecutor") - @Transactional public void sendAgitNotification(NotificationType notificationType, Task task, String message, String commenterName) { PushNotificationTemplate pushNotificationTemplate = new PushNotificationTemplate(