Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ public UpdateEnrollInfo rejectEnroll(@PathVariable Long enrollId,
return enrollService.rejectEnroll(enrollId, userId);
}

@GetMapping("/{enrollId}/description")
@Operation(summary = "보낸 신청 상세 조회 API", description = "보낸 신청의 상세 내용을 조회하는 API 입니다.")
public EnrollDescriptionInfo getEnrollDescriptionById(@PathVariable Long enrollId,
@GetMapping("/{boardId}/description")
@Operation(summary = "보낸 신청 상세 조회 API", description = "내가 특정 게시글에 보낸 신청의 상세 내용을 조회하는 API 입니다.")
public EnrollDescriptionInfo getEnrollDescriptionById(@PathVariable Long boardId,
@JwtValidation Long userId) {
return enrollService.getEnrollDescriptionById(enrollId, userId);
return enrollService.getEnrollDescriptionById(boardId, userId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public UpdateEnrollInfo toUpdateEnrollInfo(Enroll enroll, AcceptStatus acceptSta

public EnrollDescriptionInfo toEnrollDescriptionInfo(Enroll enroll) {
return EnrollDescriptionInfo.builder()
.enrollId(enroll.getId())
.description(enroll.getDescription())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public static class CancelEnrollInfo {
@NoArgsConstructor
@AllArgsConstructor
public static class EnrollDescriptionInfo {
private Long enrollId;
private String description;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ public UpdateEnrollInfo rejectEnroll(Long enrollId, Long userId) throws IOExcept
}

@Override
public EnrollResponse.EnrollDescriptionInfo getEnrollDescriptionById(Long enrollId, Long userId) {
public EnrollResponse.EnrollDescriptionInfo getEnrollDescriptionById(Long boardId, Long userId) {
User user = userRepository.findById(userId)
.orElseThrow(() -> new BaseException(ErrorCode.USER_NOT_FOUND));

Enroll enroll = enrollRepository.findById(enrollId)
Enroll enroll = enrollRepository.findByUserIdAndBoardIdAndDeletedAtIsNull(user.getId(), boardId)
.orElseThrow(() -> new BaseException(ErrorCode.ENROLL_NOT_FOUND));

return enrollConverter.toEnrollDescriptionInfo(enroll);
Expand Down