Skip to content

Commit

Permalink
fix: 쪽지 읽음처리 서비스 레이어 수정
Browse files Browse the repository at this point in the history
- @Transactinal의 추가로 일부 메서드 쓰기 연산 허용
  • Loading branch information
7zrv committed Dec 8, 2024
1 parent ce6cda5 commit 5c9c0ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class NoteMarkAsReadService implements NoteMarkAsReadUseCase {
public void noteMarkAsRead(Long noteId) {
Note note = getNote(noteId);
note.markAsRead();
noteRepository.save(note);
}

private Note getNote(Long noteId) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/somemore/note/service/NoteQueryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public Page<NoteReceiverViewForVolunteer> getNotesForVolunteer(UUID volunteerId,
return noteRepository.findNotesByReceiverIsVolunteer(volunteerId, pageable);
}

@Transactional
@Override
public NoteDetailViewForCenter getNoteDetailForCenter(Long noteId) {
noteMarkAsReadUseCase.noteMarkAsRead(noteId);
Expand All @@ -44,6 +45,7 @@ public NoteDetailViewForCenter getNoteDetailForCenter(Long noteId) {
.orElseThrow(() -> new NoSuchElementException(NOT_EXISTS_NOTE));
}

@Transactional
@Override
public NoteDetailViewForVolunteer getNoteDetailForVolunteer(Long noteId) {
noteMarkAsReadUseCase.noteMarkAsRead(noteId);
Expand Down

0 comments on commit 5c9c0ff

Please sign in to comment.