Skip to content

Commit

Permalink
[feat] : 지원자 면접 기록 전체 조회
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackBean99 committed Aug 30, 2023
1 parent 15b719f commit 2a63b09
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 0 deletions.
Binary file modified server/.gradle/7.6.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified server/.gradle/7.6.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified server/.gradle/7.6.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified server/.gradle/7.6.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified server/.gradle/7.6.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified server/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.econovation.recruitdomain.domains.record.domain.Record;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand Down Expand Up @@ -41,4 +42,12 @@ public ResponseEntity<RecordResponseDto> findByApplicantId(@RequestParam String
Record record = recordUseCase.findByApplicantId(applicantId);
return new ResponseEntity(RecordResponseDto.from(record), HttpStatus.OK);
}

@Operation(summary = "지원자의 면접기록을 전부 조회합니다")
@ApiErrorExceptionsExample(RecordExceptionDocs.class)
@GetMapping("/records/all")
public ResponseEntity<List<RecordResponseDto>> findAll() {
List<Record> records = recordUseCase.findAll();
return new ResponseEntity(RecordResponseDto.from(records), HttpStatus.OK);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.econovation.recruitdomain.domains.dto;

import com.econovation.recruitdomain.domains.record.domain.Record;
import java.util.List;
import java.util.stream.Collectors;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -15,4 +17,8 @@ public class RecordResponseDto {
public static RecordResponseDto from(Record record) {
return RecordResponseDto.builder().url(record.getUrl()).record(record.getRecord()).build();
}

public static List<RecordResponseDto> from(List<Record> records) {
return records.stream().map(RecordResponseDto::from).collect(Collectors.toList());
}
}

0 comments on commit 2a63b09

Please sign in to comment.