當(dāng)前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
前后端JSON传值
后端接口實現(xiàn)
@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測試
總結(jié)
- 上一篇: 【排错】IDEA 提示 ‘Optiona
- 下一篇: controller通过map返回减少d