[3주차] 김다인/[feat] 게시글 도메인 API구현#129
Open
kallin1 wants to merge 2 commits intoLeets-Official:김다인/mainfrom
Open
Conversation
kdobi
reviewed
Apr 9, 2026
| @@ -0,0 +1,17 @@ | |||
| package com.leets.blog.dto; | |||
There was a problem hiding this comment.
DTO 패키지를 역할별로 명확하게 분리해서 보기 편한것 같습니다
브런치 문제가 생긴신것 같은데 고생많으셨습니다.
HandoA01
approved these changes
Apr 9, 2026
Comment on lines
+25
to
+26
| User user = userRepository.findById(request.userId()) | ||
| .orElseThrow(() -> new RuntimeException("사용자를 찾을 수 없습니다.")); |
There was a problem hiding this comment.
3주차도 수고하셨습니다 :)
예외 처리가 RuntimeException으로 되어있는 것 같은데, 커스텀 예외 클래스를 만들면 어떤 에러인지 더 명확하게 구분할 수 있어서 고려해보시면 좋을 것 같아요!
Comment on lines
+21
to
+31
| public ResponseEntity<Map<String, Object>> create(@Valid @RequestBody PostCreateRequest request) { | ||
| Long id = postService.createPost(request); | ||
| return ResponseEntity.status(HttpStatus.CREATED) | ||
| .body(Map.of("id", id, "message", "게시글이 생성되었습니다")); | ||
| } | ||
|
|
||
| // 게시글 목록 조회 | ||
| @GetMapping | ||
| public ResponseEntity<PostListResponse> getAll() { | ||
| return ResponseEntity.ok(postService.getPosts()); | ||
| } |
There was a problem hiding this comment.
API마다 응답 형태가 조금씩 다른 것 같은데, ApiResponse 같은 공통 응답 포맷을 만들면 나중에 프론트와 연동할 때 더 편할 것 같아요!
HyeonSeongIM
approved these changes
Apr 9, 2026
There was a problem hiding this comment.
DTO안에 또 다른 형태에 DTO가 존재하는데 이렇게 구현하신 특별한 이유가 있으신가요?!
| User user = userRepository.findById(request.userId()) | ||
| .orElseThrow(() -> new RuntimeException("사용자를 찾을 수 없습니다.")); | ||
|
|
||
| // 2. 게시글 생성 |
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.
1. 과제 요구사항 중 구현한 내용
2. 핵심 변경 사항
3. 실행 및 검증 결과
4. 완료 사항
5. 추가 사항
제출 체크리스트
{이름}/main브랜치다{이름}/{숫자}주차브랜치다Reviewer 참고
어제 branch를 잘못 지정하는 실수가 있었습니다.
한글인식 문제로 브랜치변환이 되지않아 새로 PR을 생성했습니다.