後端接口實現
@RequestBody
@PostMapping({"/question/choice/md5"})
public ResponseEntity findExercises(@RequestBody @NotEmpty(message = "{exercises.id.NotEmpty.message}") List<String> cmd5s) {
List<ChoiceQuestion> contentMd5s = service.findAllByContentMd5In(cmd5s);
List<ChoiceRtnDto> repetitions = contentMd5s
.stream()
.map(e -> new ChoiceRtnDto(e.getContentMd5(), e.getTitle(), e.getPid()))
.collect(Collectors.toList());
return ResponseEntity.status(HttpStatus.ALREADY_REPORTED).body(repetitions);
}
POSTMAN測試