當前位置:
首頁 >
前后端JSON传值
發布時間:2024/9/30
38
豆豆
后端接口實現
@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測試
總結
- 上一篇: 【排错】IDEA 提示 ‘Optiona
- 下一篇: SpringBoot-@PathVari