Skip to content

Commit d3565af

Browse files
authored
[DDING-000] 지원자 전체 조회 API 누락된 정보 추가 (#246)
1 parent 198b7b7 commit d3565af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1191
-1102
lines changed

src/main/java/ddingdong/ddingdongBE/domain/form/api/CentralFormApi.java

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -29,56 +29,56 @@
2929
@RequestMapping("/server/central")
3030
public interface CentralFormApi {
3131

32-
@Operation(summary = "동아리 지원 폼지 생성 API")
33-
@ApiResponse(responseCode = "201", description = "동아리 지원 폼지 생성 성공")
34-
@ResponseStatus(HttpStatus.CREATED)
35-
@SecurityRequirement(name = "AccessToken")
36-
@PostMapping("/my/forms")
37-
void createForm(
38-
@Valid @RequestBody CreateFormRequest createFormRequest,
39-
@AuthenticationPrincipal PrincipalDetails principalDetails
40-
);
32+
@Operation(summary = "동아리 지원 폼지 생성 API")
33+
@ApiResponse(responseCode = "201", description = "동아리 지원 폼지 생성 성공")
34+
@ResponseStatus(HttpStatus.CREATED)
35+
@SecurityRequirement(name = "AccessToken")
36+
@PostMapping("/my/forms")
37+
void createForm(
38+
@Valid @RequestBody CreateFormRequest createFormRequest,
39+
@AuthenticationPrincipal PrincipalDetails principalDetails
40+
);
4141

42-
@Operation(summary = "동아리 지원 폼지 수정 API")
43-
@ApiResponse(responseCode = "204", description = "동아리 지원 폼지 수정 성공")
44-
@ResponseStatus(HttpStatus.NO_CONTENT)
45-
@SecurityRequirement(name = "AccessToken")
46-
@PutMapping("/my/forms/{formId}")
47-
void updateForm(
48-
@Valid @RequestBody UpdateFormRequest updateFormRequest,
49-
@PathVariable("formId") Long formId,
50-
@AuthenticationPrincipal PrincipalDetails principalDetails
51-
);
42+
@Operation(summary = "동아리 지원 폼지 수정 API")
43+
@ApiResponse(responseCode = "204", description = "동아리 지원 폼지 수정 성공")
44+
@ResponseStatus(HttpStatus.NO_CONTENT)
45+
@SecurityRequirement(name = "AccessToken")
46+
@PutMapping("/my/forms/{formId}")
47+
void updateForm(
48+
@Valid @RequestBody UpdateFormRequest updateFormRequest,
49+
@PathVariable("formId") Long formId,
50+
@AuthenticationPrincipal PrincipalDetails principalDetails
51+
);
5252

53-
@Operation(summary = "동아리 지원 폼지 삭제 API")
54-
@ApiResponse(responseCode = "204", description = "동아리 지원 폼지 삭제 성공")
55-
@ResponseStatus(HttpStatus.NO_CONTENT)
56-
@SecurityRequirement(name = "AccessToken")
57-
@DeleteMapping("/my/forms/{formId}")
58-
void deleteForm(
59-
@PathVariable("formId") Long formId,
60-
@AuthenticationPrincipal PrincipalDetails principalDetails
61-
);
53+
@Operation(summary = "동아리 지원 폼지 삭제 API")
54+
@ApiResponse(responseCode = "204", description = "동아리 지원 폼지 삭제 성공")
55+
@ResponseStatus(HttpStatus.NO_CONTENT)
56+
@SecurityRequirement(name = "AccessToken")
57+
@DeleteMapping("/my/forms/{formId}")
58+
void deleteForm(
59+
@PathVariable("formId") Long formId,
60+
@AuthenticationPrincipal PrincipalDetails principalDetails
61+
);
6262

63-
@Operation(summary = "동아리 지원 폼지 전체조회 API")
64-
@ApiResponse(responseCode = "200", description = "동아리 지원 폼지 전체조회 성공",
65-
content = @Content(
66-
array = @ArraySchema(schema = @Schema(implementation = FormListResponse.class))
67-
))
68-
@ResponseStatus(HttpStatus.OK)
69-
@SecurityRequirement(name = "AccessToken")
70-
@GetMapping("/my/forms")
71-
List<FormListResponse> getAllMyForm(
72-
@AuthenticationPrincipal PrincipalDetails principalDetails
73-
);
63+
@Operation(summary = "동아리 지원 폼지 전체조회 API")
64+
@ApiResponse(responseCode = "200", description = "동아리 지원 폼지 전체조회 성공",
65+
content = @Content(
66+
array = @ArraySchema(schema = @Schema(implementation = FormListResponse.class))
67+
))
68+
@ResponseStatus(HttpStatus.OK)
69+
@SecurityRequirement(name = "AccessToken")
70+
@GetMapping("/my/forms")
71+
List<FormListResponse> getAllMyForm(
72+
@AuthenticationPrincipal PrincipalDetails principalDetails
73+
);
7474

75-
@Operation(summary = "동아리 지원 폼지 상세조회 API")
76-
@ApiResponse(responseCode = "200", description = "동아리 지원 폼지 상세조회 성공",
77-
content = @Content(schema = @Schema(implementation = FormResponse.class)))
78-
@ResponseStatus(HttpStatus.OK)
79-
@SecurityRequirement(name = "AccessToken")
80-
@GetMapping("/my/forms/{formId}")
81-
FormResponse getForm(
82-
@PathVariable("formId") Long formId
83-
);
75+
@Operation(summary = "동아리 지원 폼지 상세조회 API")
76+
@ApiResponse(responseCode = "200", description = "동아리 지원 폼지 상세조회 성공",
77+
content = @Content(schema = @Schema(implementation = FormResponse.class)))
78+
@ResponseStatus(HttpStatus.OK)
79+
@SecurityRequirement(name = "AccessToken")
80+
@GetMapping("/my/forms/{formId}")
81+
FormResponse getForm(
82+
@PathVariable("formId") Long formId
83+
);
8484
}

src/main/java/ddingdong/ddingdongBE/domain/form/controller/CentralFormController.java

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,44 @@
1818
@RequiredArgsConstructor
1919
public class CentralFormController implements CentralFormApi {
2020

21-
private final FacadeCentralFormService facadeCentralFormService;
22-
23-
@Override
24-
public void createForm(
25-
CreateFormRequest createFormRequest,
26-
PrincipalDetails principalDetails
27-
) {
28-
User user = principalDetails.getUser();
29-
facadeCentralFormService.createForm(createFormRequest.toCommand(user));
30-
}
31-
32-
@Override
33-
public void updateForm(
34-
UpdateFormRequest updateFormRequest,
35-
Long formId,
36-
PrincipalDetails principalDetails
37-
) {
38-
facadeCentralFormService.updateForm(updateFormRequest.toCommand(formId));
39-
}
40-
41-
@Override
42-
public void deleteForm(Long formId, PrincipalDetails principalDetails) {
43-
User user = principalDetails.getUser();
44-
facadeCentralFormService.deleteForm(formId, user);
45-
}
46-
47-
@Override
48-
public List<FormListResponse> getAllMyForm(PrincipalDetails principalDetails) {
49-
User user = principalDetails.getUser();
50-
List<FormListQuery> queries = facadeCentralFormService.getAllMyForm(user);
51-
return queries.stream()
52-
.map(FormListResponse::from)
53-
.toList();
54-
}
55-
56-
@Override
57-
public FormResponse getForm(Long formId) {
58-
FormQuery query = facadeCentralFormService.getForm(formId);
59-
return FormResponse.from(query);
60-
}
21+
private final FacadeCentralFormService facadeCentralFormService;
22+
23+
@Override
24+
public void createForm(
25+
CreateFormRequest createFormRequest,
26+
PrincipalDetails principalDetails
27+
) {
28+
User user = principalDetails.getUser();
29+
facadeCentralFormService.createForm(createFormRequest.toCommand(user));
30+
}
31+
32+
@Override
33+
public void updateForm(
34+
UpdateFormRequest updateFormRequest,
35+
Long formId,
36+
PrincipalDetails principalDetails
37+
) {
38+
facadeCentralFormService.updateForm(updateFormRequest.toCommand(formId));
39+
}
40+
41+
@Override
42+
public void deleteForm(Long formId, PrincipalDetails principalDetails) {
43+
User user = principalDetails.getUser();
44+
facadeCentralFormService.deleteForm(formId, user);
45+
}
46+
47+
@Override
48+
public List<FormListResponse> getAllMyForm(PrincipalDetails principalDetails) {
49+
User user = principalDetails.getUser();
50+
List<FormListQuery> queries = facadeCentralFormService.getAllMyForm(user);
51+
return queries.stream()
52+
.map(FormListResponse::from)
53+
.toList();
54+
}
55+
56+
@Override
57+
public FormResponse getForm(Long formId) {
58+
FormQuery query = facadeCentralFormService.getForm(formId);
59+
return FormResponse.from(query);
60+
}
6161
}

src/main/java/ddingdong/ddingdongBE/domain/form/controller/dto/request/CreateFormRequest.java

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -12,79 +12,79 @@
1212

1313

1414
public record CreateFormRequest(
15-
@Schema(description = "폼지 제목", example = "폼지제목입니다")
16-
@NotNull(message = "폼지 제목은 null이 될 수 없습니다.")
17-
String title,
15+
@Schema(description = "폼지 제목", example = "폼지제목입니다")
16+
@NotNull(message = "폼지 제목은 null이 될 수 없습니다.")
17+
String title,
1818

19-
@Schema(description = "폼지 설명", example = "우리 동아리는 띵동입니다.")
20-
String description,
19+
@Schema(description = "폼지 설명", example = "우리 동아리는 띵동입니다.")
20+
String description,
2121

22-
@Schema(description = "폼지 시작일자", example = "2001-01-01")
23-
@NotNull(message = "폼지 시작일자는 null이 될 수 없습니다.")
24-
LocalDate startDate,
22+
@Schema(description = "폼지 시작일자", example = "2001-01-01")
23+
@NotNull(message = "폼지 시작일자는 null이 될 수 없습니다.")
24+
LocalDate startDate,
2525

26-
@Schema(description = "폼지 종료일자", example = "2001-01-02")
27-
@NotNull(message = "폼지 종료일자는 null이 될 수 없습니다.")
28-
LocalDate endDate,
26+
@Schema(description = "폼지 종료일자", example = "2001-01-02")
27+
@NotNull(message = "폼지 종료일자는 null이 될 수 없습니다.")
28+
LocalDate endDate,
2929

30-
@Schema(description = "면접여부", example = "true")
31-
@NotNull(message = "면접여부는 null이 될 수 없습니다.")
32-
boolean hasInterview,
30+
@Schema(description = "면접여부", example = "true")
31+
@NotNull(message = "면접여부는 null이 될 수 없습니다.")
32+
boolean hasInterview,
3333

34-
@ArraySchema(schema = @Schema(implementation = CreateFormFieldRequest.class))
35-
List<CreateFormFieldRequest> formFields
34+
@ArraySchema(schema = @Schema(implementation = CreateFormFieldRequest.class))
35+
List<CreateFormFieldRequest> formFields
3636
) {
3737

38-
record CreateFormFieldRequest(
39-
@Schema(description = "폼지 질문", example = "우리 동아리 들어올겁니까?")
40-
@NotNull(message = "질문는 null이 될 수 없습니다.")
41-
String question,
42-
43-
@Schema(description = "질문 종류", example = "CHECK_BOX")
44-
@NotNull(message = "질문 종류는 null이 될 수 없습니다.")
45-
FieldType type,
46-
47-
@Schema(description = "질문의 선택리스트", example = "[지문1이다., 지문2이다., 지문3이다.]")
48-
List<String> options,
49-
50-
@Schema(description = "필수여부", example = "true")
51-
@NotNull(message = "필수여부는 null이 될 수 없습니다.")
52-
boolean required,
53-
54-
@Schema(description = "질문 순서", example = "1")
55-
@NotNull(message = "질문 순서는 null이 될 수 없습니다.")
56-
int order,
57-
58-
@Schema(description = "질문 섹션 종류", example = "공통")
59-
@NotNull(message = "질문 섹션종류는 null이 될 수 없습니다.")
60-
String section
61-
) {
62-
63-
public CreateFormFieldCommand toCommand() {
64-
return CreateFormFieldCommand.builder()
65-
.question(question)
66-
.type(type)
67-
.options(options)
68-
.required(required)
69-
.order(order)
70-
.section(section)
71-
.build();
72-
}
73-
}
74-
75-
public CreateFormCommand toCommand(User user) {
76-
List<CreateFormFieldCommand> createFormFieldCommands = formFields.stream()
77-
.map(CreateFormFieldRequest::toCommand)
78-
.toList();
79-
return CreateFormCommand.builder()
80-
.user(user)
81-
.title(title)
82-
.description(description)
83-
.startDate(startDate)
84-
.endDate(endDate)
85-
.hasInterview(hasInterview)
86-
.formFieldCommands(createFormFieldCommands)
87-
.build();
38+
record CreateFormFieldRequest(
39+
@Schema(description = "폼지 질문", example = "우리 동아리 들어올겁니까?")
40+
@NotNull(message = "질문는 null이 될 수 없습니다.")
41+
String question,
42+
43+
@Schema(description = "질문 종류", example = "CHECK_BOX")
44+
@NotNull(message = "질문 종류는 null이 될 수 없습니다.")
45+
FieldType type,
46+
47+
@Schema(description = "질문의 선택리스트", example = "[지문1이다., 지문2이다., 지문3이다.]")
48+
List<String> options,
49+
50+
@Schema(description = "필수여부", example = "true")
51+
@NotNull(message = "필수여부는 null이 될 수 없습니다.")
52+
boolean required,
53+
54+
@Schema(description = "질문 순서", example = "1")
55+
@NotNull(message = "질문 순서는 null이 될 수 없습니다.")
56+
int order,
57+
58+
@Schema(description = "질문 섹션 종류", example = "공통")
59+
@NotNull(message = "질문 섹션종류는 null이 될 수 없습니다.")
60+
String section
61+
) {
62+
63+
public CreateFormFieldCommand toCommand() {
64+
return CreateFormFieldCommand.builder()
65+
.question(question)
66+
.type(type)
67+
.options(options)
68+
.required(required)
69+
.order(order)
70+
.section(section)
71+
.build();
8872
}
73+
}
74+
75+
public CreateFormCommand toCommand(User user) {
76+
List<CreateFormFieldCommand> createFormFieldCommands = formFields.stream()
77+
.map(CreateFormFieldRequest::toCommand)
78+
.toList();
79+
return CreateFormCommand.builder()
80+
.user(user)
81+
.title(title)
82+
.description(description)
83+
.startDate(startDate)
84+
.endDate(endDate)
85+
.hasInterview(hasInterview)
86+
.formFieldCommands(createFormFieldCommands)
87+
.build();
88+
}
8989

9090
}

0 commit comments

Comments
 (0)