-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: SurveyBookmark 변경감지가 동작하지 않는 버그를 수정한다
- Loading branch information
Showing
9 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...in/java/me/nalab/survey/application/port/out/persistence/bookmark/SurveyBookmarkPort.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package me.nalab.survey.application.port.out.persistence.bookmark; | ||
|
||
import me.nalab.survey.domain.target.Target; | ||
|
||
public interface SurveyBookmarkPort { | ||
|
||
void bookmark(Target target); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...jpa-adaptor/src/main/java/me/nalab/survey/jpa/adaptor/bookmark/SurveyBookmarkAdaptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package me.nalab.survey.jpa.adaptor.bookmark; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import me.nalab.survey.application.exception.TargetDoesNotExistException; | ||
import me.nalab.survey.application.port.out.persistence.bookmark.SurveyBookmarkPort; | ||
import me.nalab.survey.domain.target.Target; | ||
import me.nalab.survey.jpa.adaptor.common.mapper.TargetEntityMapper; | ||
import me.nalab.survey.jpa.adaptor.find.repository.TargetFindRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class SurveyBookmarkAdaptor implements SurveyBookmarkPort { | ||
|
||
private final TargetFindRepository targetFindRepository; | ||
|
||
@Override | ||
public void bookmark(Target target) { | ||
var savedTarget = targetFindRepository.findById(target.getId()) | ||
.orElseThrow(() -> new TargetDoesNotExistException(target.getId())); | ||
|
||
savedTarget.setBookmarkedSurveys(TargetEntityMapper.toSurveyBookmarkEntity(target.getBookmarkedSurveys())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters