Skip to content

Commit

Permalink
[PDS-32] feat: 아카이빙 자료 검색어 API 기능 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
dangnak2 committed Oct 14, 2023
1 parent 3bcaa16 commit 766d63c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@

@Repository
public interface MaterialRepository extends JpaRepository<Material, Long> {

// @Query("SELECT mt FROM Material mt WHERE :extension LIKE CONCAT('%', mt.extension, '%') ")
// List<Material> findByProject(Project project, @Param("extension") String extension);

Page<Material> findByProjectAndExtensionIn(Project project, List<String> extensions, Pageable pageable);
Page<Material> findByProjectAndExtensionInAndNameContaining(Project project, List<String> extensions, String cond, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Page<SearchMaterialRes> searchMaterial(Long projectId, SearchMaterialReq
} else if (category == Category.DOCS) {
extension = List.of(Constants.EXTENSION.DOCS.split(" "));
}
filteredMaterials = materialRepository.findByProjectAndExtensionIn(project, extension, pageable);
filteredMaterials = materialRepository.findByProjectAndExtensionInAndNameContaining(project, extension, searchMaterialReq.getCond(), pageable);
} else {
filteredMaterials = materialRepository.findAll(pageable);
}
Expand Down

0 comments on commit 766d63c

Please sign in to comment.