Open
Conversation
added 6 commits
March 22, 2024 16:28
HyunJunSon
approved these changes
Mar 22, 2024
| BBSDto result = BBSDto.from(entity, fileRepository.findByReferenceTypeAndReferenceNo(REFERENCE_TYPE, entity.getBbsNo())); | ||
|
|
||
| return BBSDto.from(bbsRepository.findOneByBbsNo(bbsNo)); | ||
| return result; |
chan99k
approved these changes
Mar 26, 2024
Comment on lines
+10
to
+11
| Page<BBSListDto> getBBSWithConditionByPage(String type, String keyword, Pageable pageable); | ||
| Slice<BBSListDto> getBBSWithConditionBySlice(String type, String keyword, Pageable pageable); |
Collaborator
There was a problem hiding this comment.
페이지를 반환하는 메서드와 슬라이스를 반환하는 메서드를 둘 다 만들어 두는 점 좋은 것 같습니다.
linglong67
approved these changes
Apr 3, 2024
Comment on lines
+52
to
+77
| @Override | ||
| public Slice<BBSListDto> getBBSWithConditionBySlice(String type, String keyword, Pageable pageable) { | ||
|
|
||
| Predicate finalPredicate = bBS.isVisible.eq(true) | ||
| .and(bBS.type.eq(BBSType.valueOf(type).name())); | ||
|
|
||
| List<BBSListDto> bbs = getBBSListWithMember(). | ||
| where( | ||
| finalPredicate, | ||
| keywordContains(keyword) | ||
| ) | ||
| .orderBy(bBS.createdAt.desc()) | ||
| .offset(pageable.getOffset()) | ||
| .limit(pageable.getPageSize() + 1) | ||
| .fetch(); | ||
|
|
||
| boolean hasNext = false; | ||
| int pageSize = pageable.getPageSize(); | ||
| if(bbs.size() > pageSize){ | ||
| bbs.remove(pageSize); | ||
| hasNext = true; | ||
| } | ||
|
|
||
| return new SliceImpl<>(bbs, pageable, hasNext); | ||
| } | ||
|
|
Comment on lines
-64
to
+88
| bBS.member.memberNo, | ||
| bBS.member.id | ||
| member.memberNo, | ||
| member.id |
| } | ||
|
|
||
| public static BBSDto from(BBS entity){ | ||
| public static BBSDto from(BBS entity, List<File> byReferenceTypeAndReferenceNo){ |
Collaborator
There was a problem hiding this comment.
byReferenceTypeAndReferenceNo 대신에 좀 더 '파일 리스트'인 게 드러나는 변수명이 좋지 않을까요?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
여기에 왜 이 PR이 필요했는지, PR을 통해 무엇이 바뀌는지에 대해서 설명해 주세요쿼리 수정하여 500ms -> slice 적용하여 400ms로 단축하였습니다.
첨부파일 저장
첨부파일 조회
JOIN절이 2중으로 걸려 딜레이 발생하여 한번만 조인되도록 수정하였습니다.
🔨 Modified
🌟 More
테스트코드는 발표후에 시간날 때 천천히 하는것으로....
API버저닝은 url을 쓰지말고 API헤더를 추가하여 같은 호출Mapping을 쓰되 버전마다 enum을 통해 매핑하여
알맞는 method를 타게끔 적용하고 싶었는데 적용이 쉽지않아 일단은 보류하였습니다.
이는 전략(Strategy) 패턴과 유사성을 가지고 있습니다.
url 버저닝
📋 커밋 전 체크리스트
🤟🏻 PR로 완료된 이슈
closes #