Skip to content

Conversation

@jucheonsu
Copy link
Contributor

@jucheonsu jucheonsu commented Oct 17, 2025

[feat] 솜커톤 API GitHub & 포트폴리오 링크 추가

😺 Issue

🔄 변경 내용

[ feat ]

  • 엔티티 : SomParticipant - githubLink, portfolioLink 필드 추가
  • 요청 DTO : SomParticipantRequestDto - githubLink, portfolioLink 필드 추가
  • 응답 DTO : SomParticipantResponseDto - githubLink, portfolioLink 필드 추가
  • 서비스 : SomParticipantService - githubLink, portfolioLink 필드 추가

[ test ]

  • 테스트 : SomParticipantServiceTest - 참가자 생성, 조회, 삭제 기능 테스트
  • 테스트 : SomParticipantServiceTest - Setter 방식 -> Builder 방식, Update 테스트 코드 추가

[ refactor ]

  • 엔티티 : SomParticipant - githubLink 필수 제약 조건 제거, toResponseDto 메서드 추가 및 구조 개선
  • 요청 DTO : SomParticipantRequestDto - githubLink 필수 제약 조건 제거, 불변 객체 및 빌더 패턴으로 변경
  • 서비스 : SomParticipantService - DTO 변환 로직 엔티티로 위임

✅ 체크리스트

  • 커밋 메시지가 컨벤션을 따르는가?
  • GitHub/포트폴리오 링크 필드가 추가되었는가?

🧪 테스트

  • 참가자 생성, 조회, 삭제 기능 정상 동작 확인
  • 로컬에서 테스트 완료
  • 기존 기능에 영향 없음 확인

💻 테스트 화면

< 초기 >

image

< 수정 >

image

si-zero and others added 6 commits August 31, 2025 01:18
- SomParticipant (엔티티)
- SomParticipantRequestDto (요청 DTO)
- SomParticipantResponseDto (응답 DTO)
- SomParticipantService (서비스)
@jucheonsu jucheonsu requested a review from hodoon October 17, 2025 16:43
@jucheonsu jucheonsu self-assigned this Oct 17, 2025
@jucheonsu jucheonsu added the FEAT label Oct 17, 2025
@jucheonsu jucheonsu linked an issue Oct 17, 2025 that may be closed by this pull request
@jucheonsu
Copy link
Contributor Author

시간 되실 때 코드 리뷰 한 번만 부탁드리겠습니다!

@Schema(description = "이메일 주소", example = "[email protected]", required = true)
private String email; // 이메일

@NotBlank(message = "GitHub 주소는 필수 입력 값입니다.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Github 주소는 필수입력값이 아니라 있으면 넣는걸로 바꿔주세요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

수정 완료했습니다!

@Column(nullable = false)
private String email; // 이메일

@Column(nullable = false)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nullable 제약조건 없애주세요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

수정 완료했습니다!

@hodoon hodoon requested review from dohy-eon and ysw789 October 18, 2025 05:14
- SomParticipant (엔티티)
- SomParticipantRequestDto (요청 DTO)
@jucheonsu jucheonsu changed the base branch from main to dev October 18, 2025 05:40
@jucheonsu jucheonsu requested a review from hodoon October 18, 2025 05:40
import org.hibernate.validator.constraints.URL;

@Getter
@Setter
Copy link
Member

Choose a reason for hiding this comment

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

requestDto는 객체 생성 후 변하면 안되어서 @Setter 제거 후 내부 필드 전부 final로 수정해주시면 감사하겠습니다. 그리고 추가로 @AllArgsConstructor 추가해서 빌더 패턴 유지해주시면 될 것 같습니다. 이 내용은 불변성 관련 내용이라서 DTO 불변성 이나 불변 객체 DTO 이런식으로 검색하시면 자료가 많을겁니다. (umc 워크북에서도 하셨던 내용이라 보시면 바로 이해하실거에요)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 리뷰 감사합니다! 수정 완료했습니다!

Copy link
Member

Choose a reason for hiding this comment

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

/**
 * Entity → Response DTO 변환 메서드
 */
private SomParticipantResponseDto toResponseDto(SomParticipant participant) {
    return SomParticipantResponseDto.builder()
            .id(participant.getId())
            .participantName(participant.getParticipantName())
            .studentId(participant.getStudentId())
            .department(participant.getDepartment())
            .grade(participant.getGrade())
            .contact(participant.getContact())
            .email(participant.getEmail())
            .githubLink(participant.getGithubLink())
            .portfolioLink(participant.getPortfolioLink())
            .build();

이 부분을 서비스단에서 처리하는게 아니라 엔티티 단계에서 처리하도록 수정해주세요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 리뷰 감사합니다! 수정 완료했습니다!

Copy link
Member

Choose a reason for hiding this comment

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

SomParticipantService.toResponseDto() 로직을 여기 하단에 추가해주심 됩니다. 엔티티 캡슐화나 책임 분리? 라는 내용으로 찾아보심 될 것 같아요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 리뷰 감사합니다! 수정 완료했습니다!

- SomParticipantServiceTest
- Setter 방식 -> Builder 방식
- Update 테스트 코드 추가
- SomParticipant : toResponseDto 메서드 추가 및 구조 개선
- SomParticipantRequestDto : 불변 객체 및 빌더 패턴으로 변경
- SomParticipantService : DTO 변환 로직 엔티티로 위임
@jucheonsu jucheonsu requested a review from dohy-eon October 19, 2025 05:02
@dohy-eon dohy-eon merged commit 69167bd into dev Oct 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 솜커톤 API GitHub & 포트폴리오 링크 추가

5 participants