Skip to content

[3주차] 김다인/[feat] 게시글 도메인 API구현#129

Open
kallin1 wants to merge 2 commits intoLeets-Official:김다인/mainfrom
kallin1:dain-final-submission
Open

[3주차] 김다인/[feat] 게시글 도메인 API구현#129
kallin1 wants to merge 2 commits intoLeets-Official:김다인/mainfrom
kallin1:dain-final-submission

Conversation

@kallin1
Copy link
Copy Markdown

@kallin1 kallin1 commented Apr 8, 2026

1. 과제 요구사항 중 구현한 내용

  • 게시글 목록 조회 (Get)
  • 게시글 상세 조회 (Get)
  • 게시글 작성 (Post)
  • 게시글 수정 (Patch)
  • 게시글 삭제 (Delete)

2. 핵심 변경 사항

  • DTO 패턴 적용: PostUpdateRequest, PostDetailResponse 등 전용 DTO를 생성하여 데이터 전송 효율성 및 보안 강화
  • 상속 구조 최적화: BaseEntity를 protected 및 @SuperBuilder 구조로 개선하여 코드 재사용성 확보

3. 실행 및 검증 결과

image image image image image

4. 완료 사항

  1. 게시글 CRUD API 구현
  2. 요청 성공/실패 안내 메시지 처리
  3. JPA 상속 및 빌더 패턴 최적화

5. 추가 사항

제출 체크리스트

  • PR 제목이 규칙에 맞다
  • base가 {이름}/main 브랜치다
  • compare가 {이름}/{숫자}주차 브랜치다
  • 프로젝트가 정상 실행된다
  • 본인을 Assignee로 지정했다
  • 파트 담당 Reviewer를 지정했다
  • 리뷰 피드백을 반영한 뒤 머지/PR close를 진행한다

Reviewer 참고

어제 branch를 잘못 지정하는 실수가 있었습니다.
한글인식 문제로 브랜치변환이 되지않아 새로 PR을 생성했습니다.

@kallin1 kallin1 requested a review from a team April 8, 2026 05:05
@kallin1 kallin1 self-assigned this Apr 8, 2026
@@ -0,0 +1,17 @@
package com.leets.blog.dto;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DTO 패키지를 역할별로 명확하게 분리해서 보기 편한것 같습니다
브런치 문제가 생긴신것 같은데 고생많으셨습니다.

Comment on lines +25 to +26
User user = userRepository.findById(request.userId())
.orElseThrow(() -> new RuntimeException("사용자를 찾을 수 없습니다."));
Copy link
Copy Markdown

@HandoA01 HandoA01 Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API마다 응답 형태가 조금씩 다른 것 같은데, ApiResponse 같은 공통 응답 포맷을 만들면 나중에 프론트와 연동할 때 더 편할 것 같아요!

@HyeonSeongIM HyeonSeongIM self-requested a review April 9, 2026 09:35
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DTO안에 또 다른 형태에 DTO가 존재하는데 이렇게 구현하신 특별한 이유가 있으신가요?!

User user = userRepository.findById(request.userId())
.orElseThrow(() -> new RuntimeException("사용자를 찾을 수 없습니다."));

// 2. 게시글 생성
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주석 처리 너무 좋습니다!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants