Skip to content

Commit

Permalink
feat: 경험 제목 & 내용 검색 기능 구현체 추가 및 북마크 경험 id 배열 조회 기능 구현(#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
whereami2048 committed May 21, 2024
1 parent 36734b1 commit 8e7c404
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BookmarkReaderTest: BehaviorSpec({
val jobDescriptionId = UUID.randomUUID()
val experienceId = UUID.randomUUID()
val expectedBookmark = mockk<Bookmark>()
every { mockBookmarkRepository.findByIds(jobDescriptionId, experienceId) } returns expectedBookmark
every { mockBookmarkRepository.findById(jobDescriptionId, experienceId) } returns expectedBookmark

`when`("북마크를 조회하면") {
val result = bookmarkReader.readBookmark(jobDescriptionId, experienceId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class BookmarkRepositoryImpl implements BookmarkRepository {
private final ExperienceMapper experienceMapper;

@Override
public Bookmark findByIds(UUID jobDescriptionId, UUID experienceId) {
public Bookmark findById(UUID jobDescriptionId, UUID experienceId) {
return bookmarkJpaRepository.findByJobDescriptionIdAndExperienceId(jobDescriptionId, experienceId)
.map(bookmarkMapper::toDomainEntity)
.orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,9 @@ public List<Experience> findByIds(List<UUID> experienceIds) {
List<ExperienceJpaEntity> experienceJpaEntities = experienceJpaRepository.findByIds(experienceIds);
return experienceJpaEntities.stream().map(experienceMapper::toExperienceDomainEntity).toList();
}

public List<Experience> findByTitleContains(String search) {
List<ExperienceJpaEntity> experienceJpaEntities = experienceJpaRepository.findByTitleContaining(search);
return experienceJpaEntities.stream().map(experienceMapper::toExperienceDomainEntity).toList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public interface ExperienceJpaRepository extends JpaRepository<ExperienceJpaEnti
List<ExperienceJpaEntity> findByUserIdAndCreatedAtBetweenOrderByCreatedAtDesc(UUID userId, LocalDateTime startYear, LocalDateTime endYear);
List<ExperienceJpaEntity> findByParentTagIdAndCreatedAtBetweenOrderByCreatedAtDesc(UUID parentTagId, LocalDateTime startYear, LocalDateTime endYear);
List<ExperienceJpaEntity> findByChildTagIdAndCreatedAtBetweenOrderByCreatedAtDesc(UUID childTagId, LocalDateTime startYear, LocalDateTime endYear);
List<ExperienceJpaEntity> findByTitleContaining(String title);

@Modifying

This comment has been minimized.

Copy link
@isprogrammingfun

isprogrammingfun May 21, 2024

Member

이게 필요한 이유가 뭘까요?

@Query("select e from ExperienceTagJpaEntity e where e.experienceId in :experienceIds")
Expand Down

0 comments on commit 8e7c404

Please sign in to comment.