Skip to content

Commit

Permalink
feat: 역량 키워드 이름 검색 기능 구현(#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
whereami2048 committed May 21, 2024
1 parent 1437a15 commit 36734b1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ interface StrongPointRepository {
fun isExistByStrongPointId(strongPointId: UUID): Boolean
fun findByIds(strongPointIds: List<UUID>) : List<StrongPoint>
fun saveAll(strongPoints: List<StrongPoint>)
fun findByNameContains(search: String): List<StrongPoint>
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ class StrongPointReader(
fun readByIds(strongPointIds: List<UUID>) : List<StrongPoint> {
return strongPointRepository.findByIds(strongPointIds)
}

fun readIdsByNameContains(search: String) : List<UUID> {
return strongPointRepository.findByNameContains(search).map { it.id }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ public void saveAll(List<StrongPoint> strongPoints) {

strongPointJpaRepository.saveAll(strongPointJpaEntities);
}

@Override
public List<StrongPoint> findByNameContains(String search) {
List<StrongPointJpaEntity> strongPointJpaEntities = strongPointJpaRepository.findByNameContaining(search);
return strongPointJpaEntities.stream().map(strongPointMapper::toDomainEntity).toList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ public interface StrongPointJpaRepository extends JpaRepository<StrongPointJpaEn
@Modifying
@Query("select spe from StrongPointJpaEntity spe where spe.strongPointId in :strongPoints")
List<StrongPointJpaEntity> findByIds(@Param("strongPoints") List<UUID> strongPointIds);

List<StrongPointJpaEntity> findByNameContaining(String search);
}

0 comments on commit 36734b1

Please sign in to comment.