Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public EmailTemplate createNewPasswordTemplate(String receiver, String receiverN
Context context = new Context();
String templateName = "new-password";
String subject = "[TaskFlow] 비밀번호 재설정";
context.setVariable("loginLink", "http://localhost:5173/login");
context.setVariable("loginLink", REDIRECT_URL_LOGIN);
context.setVariable("newPassword", newPassword);
context.setVariable("receiverName", receiverName);
String body = templateEngine.process(templateName, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public List<Notification> findNotificationsByTaskId(Long taskId) {

@Override
public Integer countNotification(final Long memberId) {
return notificationRepository.countByIsReadFalseAndReceiver_MemberId(memberId);
return notificationRepository.countUnreadByMemberId(memberId);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ public interface NotificationRepository extends JpaRepository<NotificationEntity

@Query("SELECT n FROM NotificationEntity n " +
"WHERE n.receiver.memberId = :receiverId " +
"AND n.task.isDeleted = false " +
"ORDER BY n.createdAt DESC")
Slice<NotificationEntity> findAllByReceiver_MemberIdOrderByCreatedAtDesc(
@Param("receiverId") Long receiverId, Pageable pageable);

@Query("SELECT n FROM NotificationEntity n " +
"WHERE n.receiver.memberId = :receiverId " +
"AND n.task.isDeleted = false")
"WHERE n.receiver.memberId = :receiverId")
List<NotificationEntity> findAllByReceiver_MemberId(Long receiverId);

List<NotificationEntity> findByTask_TaskId(Long taskId);

Integer countByIsReadFalseAndReceiver_MemberId(Long memberId);
@Query("SELECT COUNT(n) FROM NotificationEntity n " +
"WHERE n.isRead = false " +
"AND n.receiver.memberId = :memberId")
Integer countUnreadByMemberId(@Param("memberId") Long memberId);
}
Loading