From 8e7c404014a4600e1759454a0dd137a92670f5a2 Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Tue, 21 May 2024 20:55:11 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B2=BD=ED=97=98=20=EC=A0=9C=EB=AA=A9?= =?UTF-8?q?=20&=20=EB=82=B4=EC=9A=A9=20=EA=B2=80=EC=83=89=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EA=B5=AC=ED=98=84=EC=B2=B4=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EB=B0=8F=20=EB=B6=81=EB=A7=88=ED=81=AC=20=EA=B2=BD=ED=97=98=20?= =?UTF-8?q?id=20=EB=B0=B0=EC=97=B4=20=EC=A1=B0=ED=9A=8C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EA=B5=AC=ED=98=84(#115)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/bookmark/service/BookmarkReaderTest.kt | 2 +- .../persistence/bookmark/BookmarkRepositoryImpl.java | 2 +- .../persistence/experience/ExperienceRepositoryImpl.java | 5 +++++ .../experience/jpa/repository/ExperienceJpaRepository.java | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/bookmark/service/BookmarkReaderTest.kt b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/bookmark/service/BookmarkReaderTest.kt index 7c0b63c2..b1b61d35 100644 --- a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/bookmark/service/BookmarkReaderTest.kt +++ b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/bookmark/service/BookmarkReaderTest.kt @@ -16,7 +16,7 @@ class BookmarkReaderTest: BehaviorSpec({ val jobDescriptionId = UUID.randomUUID() val experienceId = UUID.randomUUID() val expectedBookmark = mockk() - every { mockBookmarkRepository.findByIds(jobDescriptionId, experienceId) } returns expectedBookmark + every { mockBookmarkRepository.findById(jobDescriptionId, experienceId) } returns expectedBookmark `when`("북마크를 조회하면") { val result = bookmarkReader.readBookmark(jobDescriptionId, experienceId) diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/bookmark/BookmarkRepositoryImpl.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/bookmark/BookmarkRepositoryImpl.java index 1770f85f..cacbb10d 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/bookmark/BookmarkRepositoryImpl.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/bookmark/BookmarkRepositoryImpl.java @@ -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); diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/ExperienceRepositoryImpl.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/ExperienceRepositoryImpl.java index 5c284b0e..5338ac30 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/ExperienceRepositoryImpl.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/ExperienceRepositoryImpl.java @@ -81,4 +81,9 @@ public List findByIds(List experienceIds) { List experienceJpaEntities = experienceJpaRepository.findByIds(experienceIds); return experienceJpaEntities.stream().map(experienceMapper::toExperienceDomainEntity).toList(); } + + public List findByTitleContains(String search) { + List experienceJpaEntities = experienceJpaRepository.findByTitleContaining(search); + return experienceJpaEntities.stream().map(experienceMapper::toExperienceDomainEntity).toList(); + } } diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/jpa/repository/ExperienceJpaRepository.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/jpa/repository/ExperienceJpaRepository.java index 60c73e70..dd2d62ab 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/jpa/repository/ExperienceJpaRepository.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/jpa/repository/ExperienceJpaRepository.java @@ -14,6 +14,7 @@ public interface ExperienceJpaRepository extends JpaRepository findByUserIdAndCreatedAtBetweenOrderByCreatedAtDesc(UUID userId, LocalDateTime startYear, LocalDateTime endYear); List findByParentTagIdAndCreatedAtBetweenOrderByCreatedAtDesc(UUID parentTagId, LocalDateTime startYear, LocalDateTime endYear); List findByChildTagIdAndCreatedAtBetweenOrderByCreatedAtDesc(UUID childTagId, LocalDateTime startYear, LocalDateTime endYear); + List findByTitleContaining(String title); @Modifying @Query("select e from ExperienceTagJpaEntity e where e.experienceId in :experienceIds")