Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE-32] Record 전체 요청 API 추가 #73

Merged
merged 1 commit into from
Aug 30, 2023
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
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());
}
}