harbor run -t openthoughts/tasktrove-exp-rpt-crosscodeeval-java-crosscodeeval-java-1265harbor download openthoughts/tasktrove-exp-rpt-crosscodeeval-java-crosscodeeval-java-1265solution file
package uk.gov.justice.laa.crime.dces.report.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.xml.bind.JAXBException;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.http.ProblemDetail;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import uk.gov.justice.laa.crime.dces.report.service.ContributionFilesService;
import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
import java.util.List;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/api/internal/v1/dces/report")
@Tag(name = "DCES Contribution files report", description = "Rest API to retrieve and generate contribution files report")
public class ContributionsReportController {
private ContributionFilesService contributionFilesService;
@GetMapping(value = "/contributions/{start}/{finish}")
@Operation(description = "Retrieve information regarding contribution files sent during the given period and generate a report")
@ApiResponse(responseCode = "200")
@ApiResponse(responseCode = "400",
description = "Bad request.",
content = @Content(mediaType = MediaType.APPLICATION_PROBLEM_JSON_VALUE,
schema = @Schema(implementation = ProblemDetail.class)
)
)
@ApiResponse(responseCode = "500",
description = "Server Error.",
content = @Content(mediaType = MediaType.APPLICATION_PROBLEM_JSON_VALUE,
schema = @Schema(implementation = ProblemDetail.class)
)
)
public File getContributionFiles(@PathVariable("start") LocalDate start, @PathVariable("finish") LocalDate finish) throws JAXBException, IOException {
List<String> contributionFiles = contributionFilesService.getFiles(start, finish);
String reportFileName = contributionFilesService.getFileName(start, finish);
return
Complete the code above, taking into account the cross-file context provided. Your solution must work correctly with the related files in the project.
Place your complete solution in /app/solution.py