Skip to content

Commit

Permalink
[FIX] recruit api req, resp data format (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
wken5577 authored Apr 10, 2024
1 parent f18ffd4 commit ced8dc6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class RecruitmentAdminController {
public ResponseEntity<CreatedRecruitmentResponse> createRecruitment(
@RequestBody @Valid RecruitmentRequestDto recruitmentDto) {
Recruitment recruitment = RecruitmentRequestDto.RecruitmentMapper.INSTANCE.dtoToEntity(recruitmentDto);
Long recruitmentId = recruitmentAdminService.createRecruitment(recruitment, recruitmentDto.getForm()).getId();
Long recruitmentId = recruitmentAdminService.createRecruitment(recruitment, recruitmentDto.getForms()).getId();
CreatedRecruitmentResponse createdRecruitmentResponse = new CreatedRecruitmentResponse(recruitmentId);

return ResponseEntity.status(HttpStatus.CREATED).body(createdRecruitmentResponse);
Expand Down Expand Up @@ -148,8 +148,8 @@ public ResponseEntity<Void> deleteRecruitment(@PathVariable @Positive Long recru
public ResponseEntity<Void> updateRecruitment(@PathVariable @Positive Long recruitId,
@RequestBody @Valid RecruitmentRequestDto recruitmentDto) {
Recruitment recruitment = RecruitmentRequestDto.RecruitmentMapper.INSTANCE.dtoToEntity(recruitmentDto);
recruitment = recruitmentAdminService.updateRecruitment(recruitId, recruitment, recruitmentDto.getForm());
recruitmentAdminService.createRecruitment(recruitment, recruitmentDto.getForm());
recruitment = recruitmentAdminService.updateRecruitment(recruitId, recruitment, recruitmentDto.getForms());
recruitmentAdminService.createRecruitment(recruitment, recruitmentDto.getForms());
return ResponseEntity.noContent().build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class RecruitmentRequestDto {

@NotNull(message = "폼을 입력해주세요.")
@Valid
List<FormParam> form;
List<FormParam> forms;

@Builder
public RecruitmentRequestDto(LocalDateTime startDate, LocalDateTime endDate, String title,
Expand All @@ -55,7 +55,7 @@ public RecruitmentRequestDto(LocalDateTime startDate, LocalDateTime endDate, Str
this.title = title;
this.contents = contents;
this.generation = generation;
this.form = form;
this.forms = form;
}

@Mapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void addCheckList(Question question, List<CheckListContent> checkLists)
throw new InvalidCheckListException();
}
for (CheckListContent checkList : checkLists) {
new CheckList(question, checkList.getContent());
new CheckList(question, checkList.getContents());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
public class CheckListContent {
@NotBlank(message = "문항 내용을 입력해주세요.")
@Size(min = 1, max = 100, message = "100자 이내로 입력해주세요.")
String content;
String contents;

public CheckListContent(String content) {
this.content = content;
this.contents = content;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ public class MyApplicationDetailResDto {
private Long applicationId;
private LocalDateTime endTime;
private String title;
private String content;
private List<FormResDto> forms;

public MyApplicationDetailResDto(ApplicationWithAnswerSvcDto applicationWithAnswerSvcDto) {
this.applicationId = applicationWithAnswerSvcDto.getApplicationId();
this.endTime = applicationWithAnswerSvcDto.getEndTime();
this.title = applicationWithAnswerSvcDto.getTitle();
this.content = applicationWithAnswerSvcDto.getContent();
this.forms = applicationWithAnswerSvcDto.getForm().stream()
.map(FormResDto::new)
.collect(toList());
Expand Down

0 comments on commit ced8dc6

Please sign in to comment.