Skip to content

Commit

Permalink
feat: changed tagList to int type (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
정문영 authored and 정문영 committed Jan 29, 2024
1 parent 89bbe4a commit 52287af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public ResponseEntity<?> getMemo(@PathVariable("memo_id") Long memo_id) {
public ResponseEntity<?> getMemoTagList(@RequestParam("tags") String tags,
@RequestParam(required = false, defaultValue = "0", value = "page") Integer page) {

long[] tagList = Arrays.stream(tags.split(",")).mapToLong(Long::parseLong).toArray();
int[] tagList = Arrays.stream(tags.split(",")).mapToInt(Integer::parseInt).toArray();

Slice<GetMemoDto> memoList = memoService.getMemoTagList(tagList, page);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ public interface MemoRepository extends JpaRepository<Memo, Long> {
"left join fetch m.tags r " +
"join m.tags t " +
"where t.id in :tags")
Slice<Memo> findSliceByTag(@Param("tags") long[] tags, Pageable pageable);
Slice<Memo> findSliceByTag(@Param("tags") int[] tags, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Optional<Memo> getMemo(Long memo_id) {
return memoRepository.findById(memo_id);
}

public Slice<GetMemoDto> getMemoTagList(long[] tags, Integer page) {
public Slice<GetMemoDto> getMemoTagList(int[] tags, Integer page) {
Pageable pageable = PageRequest.of(page, 10);

Slice<Memo> memo = memoRepository.findSliceByTag(tags, pageable);
Expand Down

0 comments on commit 52287af

Please sign in to comment.