-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
인기순 게시글 조회 API 구현 #762
Merged
Merged
인기순 게시글 조회 API 구현 #762
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2798108
feat: 인기순 게시글 조회 API 구현
jschoi-96 eb2f5b1
Merge branch 'main' into feat/757-popular-tag-api-create
jschoi-96 09a6813
style: sonarqube
jschoi-96 0c5c122
Merge remote-tracking branch 'origin/feat/757-popular-tag-api-create'…
jschoi-96 04e1e99
Merge branch 'main' into feat/757-popular-tag-api-create
jschoi-96 5671933
style: sonarqube
jschoi-96 17d6f66
Merge remote-tracking branch 'origin/feat/757-popular-tag-api-create'…
jschoi-96 657a7c2
Merge branch 'main' into feat/757-popular-tag-api-create
jschoi-96 a98edee
feat: 하나의 API 엔드포인트로 통합
jschoi-96 5123b78
Merge remote-tracking branch 'origin/feat/757-popular-tag-api-create'…
jschoi-96 90c4c29
style: sonarqube
jschoi-96 e60454c
feat: 서비스 메서드를 하나로 통합하여 분기처리
jschoi-96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,15 +69,19 @@ public List<GameSetResponse> findLatestGames( | |
return gameService.findLatestGames(tagName, pageable, guestOrApiMember); | ||
} | ||
|
||
@GetMapping("/best") | ||
@Operation(summary = "조회수 순으로 밸런스 게임 조회", description = "조회수 순으로 정렬된 16개의 게임 목록을 리턴합니다.") | ||
public List<GameSetResponse> findBestGames( | ||
@RequestParam String tagName, | ||
@GetMapping("/popular") | ||
@Operation(summary = "인기순으로 밸런스 게임 조회", | ||
description = "메인 태그가 주어지면 해당 태그의 게임을 인기순으로 조회, 없으면 밸런스 게임 전체를 인기순으로 조회합니다.") | ||
public List<GameSetResponse> findPopularGamesWithTag( | ||
@RequestParam(required = false) String tagName, | ||
@RequestParam(defaultValue = "0") int page, | ||
@RequestParam(defaultValue = "16") int size, | ||
@Parameter(hidden = true) @AuthPrincipal final GuestOrApiMember guestOrApiMember | ||
) { | ||
Pageable pageable = PageRequest.of(page, size); | ||
return gameService.findBestGames(tagName, pageable, guestOrApiMember); | ||
if (tagName != null) { | ||
return gameService.findPopularGamesWithTag(tagName, pageable, guestOrApiMember); | ||
} | ||
return gameService.findPopularGamesWithoutTag(pageable, guestOrApiMember); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 메인태그 유무에 따른 분기처리를 서비스 계층에서 수행하면 findPopularGames 메서드 하나로 코드를 통합할 수 있지 않을까요?? |
||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
페이지네이션 제한 및 문서화가 필요합니다
메서드 구현은 적절하나, PR 요구사항에 맞춰 다음 개선사항들을 제안드립니다:
📝 Committable suggestion