Skip to content

✨ Feat: 게시글 작성 기능 관련 클래스 및 로직 생성#144

Merged
limhb708 merged 4 commits into
DoDo-Project:developfrom
limhb708:feature/142
Apr 17, 2026
Merged

✨ Feat: 게시글 작성 기능 관련 클래스 및 로직 생성#144
limhb708 merged 4 commits into
DoDo-Project:developfrom
limhb708:feature/142

Conversation

@limhb708
Copy link
Copy Markdown
Collaborator

@limhb708 limhb708 commented Apr 16, 2026

📄 작업 내용 (Description)

이번 PR에서 변경되거나 추가된 주요 작업을 간단히 설명해주세요.

  • BoardCreateRequest / BoardCreateResponse DTO 생성
  • 게시글 생성 서비스 로직 생성
  • 게시글 작성 API Controller 생성
  • BoardRepository를 통한 게시글 저장 처리 로직 생성
  • 게시글 관련 예외 처리 및 GlobalExceptionHandler 반영
  • BoardServiceTest 생성

🔗 관련 이슈 (Related Issues)

작업한 이슈 번호를 아래 형식으로 PULL REQUEST BODY에 작성해주세요.
(PR 머지 시 해당 이슈가 자동으로 종료됩니다.)


✅ 체크리스트 (Checklist)

PR을 보내기 전 아래 항목들을 모두 확인해주세요.

  • PR 제목은 커밋 컨벤션을 따랐습니다.
  • 관련 이슈를 연결했습니다.
  • 스스로 코드를 검토하고 불필요한 코드를 제거했습니다.
  • 코드 스타일이 프로젝트 규칙과 일치합니다. (Style)
  • 새로운 기능에 대한 테스트 코드를 추가했거나, 기존 테스트가 모두 통과했습니다. (Test)

📸 스크린샷 (Screenshots)

작업 내용과 관련된 스크린샷이 있다면 첨부해주세요. (UI 변경이 있는 경우)

Before After

💬 기타 사항 (Etc)

리뷰어에게 전달하고 싶은 추가 정보가 있다면 자유롭게 작성해주세요.

@limhb708 limhb708 requested a review from WhiteBin-bin April 16, 2026 12:03
@limhb708 limhb708 self-assigned this Apr 16, 2026
@limhb708 limhb708 added ✨ Feature 새 기능 혹은 요구 사항 🦥 임현빈 임현빈 파트 labels Apr 16, 2026
@github-project-automation github-project-automation Bot moved this to 📝 할 일 in 칸반 보드 Apr 16, 2026
Copy link
Copy Markdown
Contributor

@WhiteBin-bin WhiteBin-bin left a comment

Choose a reason for hiding this comment

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

코드 리뷰 남긴거 확인하고 수정해줘

*/
@Override
@Transactional
public Long createBoard(UUID userId, BoardRequest.BoardCreateRequest request) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이거 자바에 static import 라고 있는데 그거써서 BoardRequest.BoardCreateRequest request 이렇게 하지말고 BoardCreateRequest request 이렇게 짧게 수정해줘

@Transactional
public Long createBoard(UUID userId, BoardRequest.BoardCreateRequest request) {

// 작성자 조회
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

주석은 달지말고 자바독으로 해줘

  • 주석 다는거는 테스트에서 // when //given //then 이정도만

@github-project-automation github-project-automation Bot moved this from 📝 할 일 to 🏃 진행 중 in 칸반 보드 Apr 16, 2026
- BoardCreateRequest / BoardCreateResponse DTO 생성
- 게시글 생성 서비스 로직 생성
- 게시글 작성 API Controller 생성
- BoardRepository를 통한 게시글 저장 처리 로직 생성
- 게시글 관련 예외 처리 및 GlobalExceptionHandler 반영
- BoardServiceTest 생성

Closes DoDo-Project#142
limhb708 added a commit to limhb708/dodo-backend that referenced this pull request Apr 16, 2026
- BoardCreateRequest 타입 import 적용
- createBoard 메서드 시그니처 간소화
- 일반 주석 제거 및 Javadoc으로 변경
- BoardServiceTest 및 BoardControllerTest 수정 (act/테스트 통과)

DoDo-Project#144 코드 리뷰 반영
*/
@Override
@Transactional
public Long createBoard(UUID userId, BoardCreateRequest request) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

수정한거 확인했쓰

return toResponseEntity(e.getErrorCode());
}

/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

GlobalExceptionHandler에 에러 선언 안하면 오류나니깐 다음부턴 확인하고 올립시당

// given
UUID userId = UUID.randomUUID();

BoardRequest.BoardCreateRequest request = BoardRequest.BoardCreateRequest.builder()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이것도 static import 해줘야지

))
.build();

User user = User.builder()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이거는 builder 썼는데 아무것도 조합안할거면 그냥 지워도 되는거 아니야?? 이 부분 이상함

filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이 파일은 뭐야 지워

Copy link
Copy Markdown
Contributor

@WhiteBin-bin WhiteBin-bin left a comment

Choose a reason for hiding this comment

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

리뷰 남긴거 확인하고 다시 수정해서 올려줘

- BoardCreateRequest 타입 import 적용
- createBoard 메서드 시그니처 간소화
- 일반 주석 제거 및 Javadoc으로 변경
- BoardServiceTest 및 BoardControllerTest 수정 (act/테스트 통과)

DoDo-Project#144 코드 리뷰 반영
limhb708 added a commit to limhb708/dodo-backend that referenced this pull request Apr 17, 2026
- BoardCreateRequest 타입 import 적용
- 불필요한 User.builder() 사용 제거 및 mock 기반 객체 생성으로 수정

DoDo-Project#144 코드 리뷰 반영
limhb708 added a commit to limhb708/dodo-backend that referenced this pull request Apr 17, 2026
- BoardCreateRequest 타입 import 적용
- 불필요한 User.builder() 사용 제거 및 mock 기반 객체 생성으로 수정

DoDo-Project#144 코드 리뷰 반영
@PostMapping
public ResponseEntity<?> createBoard(
@RequestBody BoardCreateRequest request,
Authentication authentication
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@AuthenticationPrincipal UserDetails userDetails 이 부분은 이런식으로 선언해서 받아와서

 UUID userId = UUID.fromString(userDetails.getUsername());
 log.info("울타리 거리 범위 설정 요청 - User: {}, PetId: {}", userId, request.getPetId());

  return ResponseEntity.ok(fenceService.setFenceRange(userId, request));

이런식으로 사용하는거야 다 컨트롤러 부분 고쳐줘

Long boardId = boardService.createBoard(userId, request);

return ResponseEntity.status(201)
.body(Map.of(
Copy link
Copy Markdown
Contributor

@WhiteBin-bin WhiteBin-bin Apr 17, 2026

Choose a reason for hiding this comment

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

그리고 우리 status 200종류에서는 200만 사용하기로 했잖어 그것도 수정해줘 내가 컨트롤러에 어떤거 썼는지 보고 참고해서 만들어주고 API 명세도 수정해주고

public class BoardServiceImpl implements BoardService {

/**
* 게시글 저장 / 조회를 위한 JPA Repository
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

JPA Repository라는 말은 빼고 될듯 그냥 Repository로 가면 될거같아

Copy link
Copy Markdown
Contributor

@WhiteBin-bin WhiteBin-bin left a comment

Choose a reason for hiding this comment

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

리뷰 단거 보고 수정해줘

limhb708 added a commit to limhb708/dodo-backend that referenced this pull request Apr 17, 2026
- @AuthenticationPrincipal 기반 사용자 정보 추출로 변경
- 201 → 200 상태코드 변경에 따른 테스트 수정
- Swagger 응답 코드 명세(400, 401, 403, 404, 500) 반영
- 컨트롤러 테스트 인증 방식 및 상태코드 검증 로직 수정

DoDo-Project#144 코드 리뷰 반영
- BoardCreateRequest 타입 import 적용
- 불필요한 User.builder() 사용 제거 및 mock 기반 객체 생성으로 수정
- @AuthenticationPrincipal 기반 사용자 정보 추출로 변경
- 201 → 200 상태코드 변경에 따른 테스트 수정
- Swagger 응답 코드 명세(400, 401, 403, 404, 500) 반영
- 컨트롤러 테스트 인증 방식 및 상태코드 검증 로직 수정

DoDo-Project#144 코드 리뷰 반영
Copy link
Copy Markdown
Contributor

@WhiteBin-bin WhiteBin-bin left a comment

Choose a reason for hiding this comment

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

오케이 머지 해도 될듯

@limhb708 limhb708 merged commit a1e3b17 into DoDo-Project:develop Apr 17, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from 🏃 진행 중 to ☑️ 완료 in 칸반 보드 Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새 기능 혹은 요구 사항 🦥 임현빈 임현빈 파트

Projects

Status: ☑️ 완료

Development

Successfully merging this pull request may close these issues.

[Feat] 게시글 생성 기능 구현

2 participants