Skip to content

feat:크루 참여 요청 질문 등록#32

Merged
ekfrehd merged 12 commits intodevelopfrom
feature-26-aply-question
Jun 29, 2025
Merged

feat:크루 참여 요청 질문 등록#32
ekfrehd merged 12 commits intodevelopfrom
feature-26-aply-question

Conversation

@ekfrehd
Copy link
Contributor

@ekfrehd ekfrehd commented Mar 29, 2025

🔍 PR 타입 선택

아래 타입 중 해당하는 하나를 선택해 주세요. 반드시 하나만 선택해 주세요.

  • feat: 새로운 기능 추가

📝 변경 사항 요약

변경 사항을 간단히 요약해 주세요.

  • 크루 참여 요청 질문 등록

🛠 관련 이슈

Resolves: #26
Ref: #26

추가 설명 (선택 사항)

변경 사항에 대한 추가 설명을 작성해 주세요.

@mandykr
Copy link
Contributor

mandykr commented Mar 31, 2025

작성하신 기능과 함께 추가되어야 할 부분은 별도의 이슈로 등록해주세요.
예를 들어,

  • 질문 수정 및 삭제
  • 사용자가 크루에 참여 요청 시 질문 목록 조회
  • 답변 저장

List<String> crewQuestions
) {

public List<String> toList() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

toList 보단 범용적인 메서드를 사용하는게 좋을거 같습니다.

@Schema(description = "크루 참여 질문 리스트")
CreateCrewQuestionRequest questions // 질문 리스트 추가
) {
@Schema(description = "크루 참여 요청 질문 등록 Request")
Copy link
Collaborator

Choose a reason for hiding this comment

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

등록 문구가 빠져도 될 거 같네요!

@xjvmdutl
Copy link
Collaborator

xjvmdutl commented Mar 31, 2025

작성하신 기능과 함께 추가되어야 할 부분은 별도의 이슈로 등록해주세요. 예를 들어,

  • 질문 수정 및 삭제
  • 사용자가 크루에 참여 요청 시 질문 목록 조회
  • 답변 저장

@mandykr 님 궁금한게 있는데요.!
해당 이슈에 아래 작업할 내용이 포함이 되어 있으면 크루 참여 요청 시, 답변을 파라미터로 받아서 저장까지는 해당 이슈에 포함되어야 할까요?
-> 사용자는 크루에 참여 요청할 때, 크루 참여 요청에 필요한 질문에 대한 답변을 작성할 수 있다.

@xjvmdutl
단순히 생각나는 기능을 적은 것이고, 반드시 이슈를 3개 작성해야 한다는건 아닙니다.
질문 주신대로 답변과 관련된 기능은 하나의 이슈에 포함되는게 좋겠네요.

Comment on lines +30 to +31
@Embedded
private Questions questions;
Copy link
Contributor

Choose a reason for hiding this comment

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

질문은 사용자 모집과 관련 있다고 생각되는데요.
Recruitment로 이동하는 게 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recruitment로 이동하고 클래스명은 RecruitmentQuestion 이 좋겠네요

@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED, force = true)
@Getter
public class Question {
Copy link
Contributor

@mandykr mandykr Mar 31, 2025

Choose a reason for hiding this comment

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

RecruitmentQuestion 등으로 의미가 명확하게 변경하는게 좋겠네요

Comment on lines +29 to +32
// 질문의 개수 체크 (최소 1개, 최대 10개)
if (values.size() > 10) {
throw new IllegalArgumentException("질문은 10개 이하로 입력해야 합니다.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

불필요한 주석은 지워도 될거 같아요.
10과 같은 매직 넘버는 상수(static final)로 관리하는게 좋겠네요

this.values = values.stream().map(s -> Question.create(s, crew)).toList();
}

private void valid(List<String> values) {
Copy link
Contributor

Choose a reason for hiding this comment

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

메서드 이름은 동사로 작성해주세요

Comment on lines +34 to +40
// 각 질문의 길이 체크 (최소 1자 이상, 최대 200자 이하)
for (String question : values) {
if (question.length() < 1 || question.length() > 200) {
throw new IllegalArgumentException("각 질문은 최소 50자 이상, 200자 이하로 입력해야 합니다.");
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

질문의 길이를 체크하는 부분은 QuestionContent의 책임인 것 같네요

Comment on lines +28 to +29
@Schema(description = "크루 참여 질문 리스트")
CreateCrewQuestionRequest questions // 질문 리스트 추가
Copy link
Contributor

Choose a reason for hiding this comment

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

불필요한 주석은 지워주세요


public Questions(List<String> values, Crew crew) {
valid(values);
this.values = values.stream().map(s -> Question.create(s, crew)).toList();
Copy link
Collaborator

Choose a reason for hiding this comment

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

map 안에 변수를 s로 사용한 이유가 있을까요?

private void valid(List<String> values) {
// 질문의 개수 체크 (최소 1개, 최대 10개)
if (values.size() > 10) {
throw new IllegalArgumentException("질문은 10개 이하로 입력해야 합니다.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Crew는 에러 메시지가 있는거로 알고 있는데 그걸 활용하는게 좋을 거 같습니다.!(신규 등록)


// 각 질문의 길이 체크 (최소 1자 이상, 최대 200자 이하)
for (String question : values) {
if (question.length() < 1 || question.length() > 200) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Validation 로직과 에러 내용이 다른거 같습니다.

description,
maxMembers
maxMembers,
new CrewCreateRequest.CreateCrewQuestionRequest(questions)
Copy link
Collaborator

Choose a reason for hiding this comment

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

해당 값을 반환하는 Fixture를 별도로 분리해도 될 거 같습니다.

5,
UUID.randomUUID());
UUID.randomUUID(),
List.of("질문1"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

테스트에 결과가 추가한 질문에 대한 검증이 없는것 같아요!

Comment on lines 47 to 56
private Crew(String name, String description, int maxMembers, UUID leader,List<String> questions) {
this.id = UUID.randomUUID();
this.title = new CrewTitle(name);
this.description = new CrewDescription(description);
this.recruitment = new Recruitment(maxMembers);
this.recruitment = Recruitment.of(maxMembers,questions,this);
this.crewMembers = new CrewMembers(this, leader);
this.posts = new Posts();
this.announcements = new Announcements();
this.introductions = new Introductions();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

중요한건 아니지만 콤마 뒤에 띄어쓰가 없네요

Comment on lines +58 to +61
public static Crew create(String title, String description, int maxMembers, UUID leader, List<String> questions) {
Crew crew =new Crew(title, description, maxMembers, leader, questions);
crew.recruitment = Recruitment.of(maxMembers, questions, crew);
return crew;
Copy link
Contributor

Choose a reason for hiding this comment

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

마찬가지로 플러그인등을 적용해서 코드 포맷팅 하시면 편할듯 해요

}

private void validate(String value) {
if (value == null || value.trim().length() < MIN_LENGTH || value.length() > MAX_LENGTH) {
Copy link
Contributor

Choose a reason for hiding this comment

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

몇가지 사항 권유 드립니다.

  • Strings.isEmpty() 활용
  • 최소 길이 체크에만 적용되어 있는 trim() 을 최대 길이 체크에도 적용할지 선택

junhokim and others added 9 commits June 3, 2025 11:25
* feat: Crew 생성

* feat: Code 리뷰 반영, Exception 추가

* feat: 주석 제거 및 코드 수정

---------

Co-authored-by: junhokim <junhokim@gmarket.com>
* feat: 비즈니스 예외와 API 공통 응답 모듈 추가
- vo 검증에서 발생하는 비즈니스 예외 삭제 및 InvalidValueException 으로 변경
Co-authored-by: junhokim <junhokim@gmarket.com>
* [feat] 크루 리스트 조회 API 기능 구현 및 테스트코드 리팩토링 (#4)

* [feat] 크루 상세 조회 API 기능 구현 (#4)

* feat: 스웨거 추가 작업 (#24)

Co-authored-by: junhokim <junhokim@gmarket.com>

* [fix] 크루 상세 조회 API 코드리뷰 반영 (#4)

* [fix] 단위테스트 SpringBootTest -> DataJpaTest 사용하도록 수정 (#4)

---------

Co-authored-by: Kimjunho <39546306+xjvmdutl@users.noreply.github.com>
Co-authored-by: junhokim <junhokim@gmarket.com>
* feat: 크루 모집상태 변경시 최대 인원수 검증 추가
- IllegalStateException 추가
- common exception 생성자 수정

* refactor: CrewMembers size 조회 메서드 추가

* fix: conflict repair
@ekfrehd ekfrehd force-pushed the feature-26-aply-question branch from 93b7ad8 to 5f8dd9a Compare June 3, 2025 02:50
ekfrehd added 3 commits June 13, 2025 16:33
# Conflicts:
#	build.gradle
#	src/main/java/com/retrip/crew/application/in/CrewService.java
#	src/main/java/com/retrip/crew/application/in/request/CrewCreateRequest.java
#	src/main/java/com/retrip/crew/application/in/response/CrewCreateResponse.java
#	src/main/java/com/retrip/crew/application/in/usecase/GetCrewUseCase.java
#	src/main/java/com/retrip/crew/application/in/usecase/ManageCrewUseCase.java
#	src/main/java/com/retrip/crew/application/in/usecase/ManageDemandUseCase.java
#	src/main/java/com/retrip/crew/application/in/usecase/UpdateRecruitmentUseCase.java
#	src/main/java/com/retrip/crew/application/out/repository/CrewMemberRepository.java
#	src/main/java/com/retrip/crew/application/out/repository/CrewQueryRepository.java
#	src/main/java/com/retrip/crew/domain/entity/Announcements.java
#	src/main/java/com/retrip/crew/domain/entity/Crew.java
#	src/main/java/com/retrip/crew/domain/entity/CrewMember.java
#	src/main/java/com/retrip/crew/domain/entity/CrewMemberRole.java
#	src/main/java/com/retrip/crew/domain/entity/CrewMembers.java
#	src/main/java/com/retrip/crew/domain/entity/Demand.java
#	src/main/java/com/retrip/crew/domain/entity/Introduction.java
#	src/main/java/com/retrip/crew/domain/entity/Introductions.java
#	src/main/java/com/retrip/crew/domain/entity/Post.java
#	src/main/java/com/retrip/crew/domain/entity/Posts.java
#	src/main/java/com/retrip/crew/domain/entity/Recruitment.java
#	src/main/java/com/retrip/crew/domain/exception/common/ErrorCode.java
#	src/main/java/com/retrip/crew/domain/vo/PostContent.java
#	src/main/java/com/retrip/crew/domain/vo/RecruitmentStatus.java
#	src/main/java/com/retrip/crew/infra/adapter/in/presentation/rest/CrewController.java
#	src/main/java/com/retrip/crew/infra/adapter/in/presentation/rest/common/ApiResponse.java
#	src/main/java/com/retrip/crew/infra/adapter/out/persistence/mysql/query/CrewQuerydslRepository.java
#	src/test/java/com/retrip/crew/application/in/CrewServiceTest.java
#	src/test/java/com/retrip/crew/common/ServiceTest.java
#	src/test/java/com/retrip/crew/common/config/QuerydslConfig.java
#	src/test/java/com/retrip/crew/common/fixture/CrewFixture.java
#	src/test/java/com/retrip/crew/domain/entity/CrewTest.java
#	src/test/java/com/retrip/crew/domain/entity/RecruitmentTest.java
@ekfrehd ekfrehd merged commit 6b95183 into develop Jun 29, 2025
@ekfrehd ekfrehd deleted the feature-26-aply-question branch June 29, 2025 08:36
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.

크루 참여 요청에 필요한 질문 등록

5 participants