-
Notifications
You must be signed in to change notification settings - Fork 1
feat 97 메모 수정기능 추가 #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "feat/#97/\uBA54\uBAA8-\uC218\uC815\uAE30\uB2A5-\uCD94\uAC00"
Changes from 4 commits
daaf17e
5e46b38
cd0d55a
4e58e44
3834ec9
b115849
5485865
e3951c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package leets.bookmark.domain.bookmark.application.exception; | ||
|
|
||
| import leets.bookmark.global.common.exception.BusinessException; | ||
|
|
||
| public class BookmarkUpdateFieldEmptyException extends BusinessException { | ||
| public BookmarkUpdateFieldEmptyException() { | ||
| super(BookmarkErrorCode.Bookmark_Update_Field_Empty_Exception); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| import leets.bookmark.domain.bookmark.application.dto.response.BookmarkFullResponse; | ||
| import leets.bookmark.domain.bookmark.application.dto.response.BookmarkPreviewResponse; | ||
| import leets.bookmark.domain.bookmark.application.dto.response.BookmarkPlatformResponse; | ||
| import leets.bookmark.domain.bookmark.application.exception.BookmarkUpdateFieldEmptyException; | ||
| import leets.bookmark.domain.bookmark.application.exception.TagCategoryMismatchException; | ||
| import leets.bookmark.domain.bookmark.application.mapper.BookmarkPlatformMapper; | ||
| import leets.bookmark.domain.bookmark.application.mapper.BookmarkSearchConditionMapper; | ||
|
|
@@ -24,6 +25,7 @@ | |
| import leets.bookmark.domain.file.application.dto.response.FileResponse; | ||
| import leets.bookmark.domain.file.application.mapper.FileMapper; | ||
| import leets.bookmark.domain.file.application.usecase.FileUseCase; | ||
| import leets.bookmark.domain.notification.application.dto.request.NotificationSaveRequest; | ||
| import leets.bookmark.domain.notification.application.dto.response.NotificationResponse; | ||
| import leets.bookmark.domain.notification.domain.service.NotificationDeleteService; | ||
| import leets.bookmark.domain.notification.domain.service.NotificationGetService; | ||
|
|
@@ -185,6 +187,12 @@ public void update(Long userId, Long bookmarkId, BookmarkUpdateRequest request, | |
| if (request.title() != null && !request.title().trim().isEmpty()) { | ||
| bookmark.updateTitle(request.title()); | ||
| updated = true; | ||
|
|
||
| } | ||
| if (request.memo() != null && !request.memo().trim().isEmpty()) { | ||
| bookmark.updateMemo(request.memo()); | ||
| updated = true; | ||
|
|
||
| } | ||
|
|
||
| if (request.thumbnailUrl() != null) { | ||
|
|
@@ -207,8 +215,15 @@ public void update(Long userId, Long bookmarkId, BookmarkUpdateRequest request, | |
| updated = true; | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 넵 |
||
|
|
||
| if (request.notification() != null && request.notification().notificationId() != null) { | ||
| notificationUseCase.updateNotification(user, bookmark, request.notification()); | ||
| if (request.notification() != null) { | ||
| if (request.notification().notificationId() != null) { | ||
| notificationUseCase.updateNotification(user, bookmark, request.notification()); | ||
| } else { | ||
| NotificationSaveRequest saveRequest = new NotificationSaveRequest( | ||
| request.notification().notifyAt() | ||
| ); | ||
|
||
| notificationUseCase.saveNotification(user, bookmark, saveRequest); | ||
| } | ||
| updated = true; | ||
| } | ||
|
|
||
|
|
@@ -245,7 +260,7 @@ public void update(Long userId, Long bookmarkId, BookmarkUpdateRequest request, | |
| } | ||
|
|
||
| if (!updated) { | ||
| throw new IllegalArgumentException("업데이트할 필드가 존재하지 않습니다."); | ||
| throw new BookmarkUpdateFieldEmptyException(); | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum 이름은 모든 글자를 대문자로 부탁드려요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 수정하겠습니다