-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: 커뮤니티, 지원, 성적 관련 api 수정 #196
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
85b8637
refactor: 지원서 uri 복수형으로 변경
nayonsoso 67c83f3
refactor: 게시판 uri 변경
nayonsoso 29437bd
refactor: 게시글 uri 변경
nayonsoso b3f0fb6
fix: 영속성 컨텍스트 때문에 동작하지 않는 부분 해결
nayonsoso 1046327
refactor: 댓글 uri 변경
nayonsoso 5b5971e
fix: 영속성 컨텍스트 때문에 동작하지 않는 부분 해결
nayonsoso f00bae9
refactor: 댓글 uri 변경
nayonsoso e00ebff
fix: 영속성 컨텍스트로 인한 문제 해결
nayonsoso ce47c1d
chore: 잘못 추가한 라인 삭제
nayonsoso 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 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
19 changes: 17 additions & 2 deletions
19
src/main/java/com/example/solidconnection/community/board/controller/BoardController.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,42 @@ | ||
| package com.example.solidconnection.community.board.controller; | ||
|
|
||
| import com.example.solidconnection.community.post.dto.PostListResponse; | ||
| import com.example.solidconnection.community.post.service.PostQueryService; | ||
| import com.example.solidconnection.type.BoardCode; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RequestParam; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| @RestController | ||
| @RequiredArgsConstructor | ||
| @RequestMapping("/communities") | ||
| @RequestMapping("/boards") | ||
| public class BoardController { | ||
|
|
||
| private final PostQueryService postQueryService; | ||
|
|
||
| // todo: 회원별로 접근 가능한 게시판 목록 조회 기능 개발 | ||
| @GetMapping() | ||
| @GetMapping | ||
| public ResponseEntity<?> findAccessibleCodes() { | ||
| List<String> accessibleCodeList = new ArrayList<>(); | ||
| for (BoardCode boardCode : BoardCode.values()) { | ||
| accessibleCodeList.add(String.valueOf(boardCode)); | ||
| } | ||
| return ResponseEntity.ok().body(accessibleCodeList); | ||
| } | ||
|
|
||
| @GetMapping("/{code}") | ||
| public ResponseEntity<?> findPostsByCodeAndCategory( | ||
| @PathVariable(value = "code") String code, | ||
| @RequestParam(value = "category", defaultValue = "전체") String category) { | ||
| List<PostListResponse> postsByCodeAndPostCategory = postQueryService | ||
| .findPostsByCodeAndPostCategory(code, category); | ||
| return ResponseEntity.ok().body(postsByCodeAndPostCategory); | ||
| } | ||
| } | ||
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
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
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
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
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
Oops, something went wrong.
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.
이건 게시글 리스트를 조회하는 것이길래 제가 지난번에 post쪽으로 옮겼던 것인데 boards가 더 적절한가요?
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.
저렇게 바꾸게 된 맥락을 말씀드리자면!
원래 특정 게시판의 게시글 목록 조회가
/communities/{code}였었어요.그런데 uri 회의에서 communities 였던걸 boards 로 바꾸기로 해서
/boards/{code}로 바꾼거예요.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.
아 기억났습니다! ㅎㅎ.. 깜빡했네요