|
@@ -61,7 +61,7 @@ public class PaperStructController {
|
|
*/
|
|
*/
|
|
@ApiOperation(value="获取试卷结构",notes="获取试卷结构")
|
|
@ApiOperation(value="获取试卷结构",notes="获取试卷结构")
|
|
@GetMapping(value = "/paperStruct/{id}")
|
|
@GetMapping(value = "/paperStruct/{id}")
|
|
- public ResponseEntity getPaperStructureById(@PathVariable String id){
|
|
|
|
|
|
+ public ResponseEntity getPaperStructById(@PathVariable String id){
|
|
return new ResponseEntity(paperStructRepo.findOne(id),HttpStatus.OK);
|
|
return new ResponseEntity(paperStructRepo.findOne(id),HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -73,9 +73,8 @@ public class PaperStructController {
|
|
*/
|
|
*/
|
|
@ApiOperation(value="更新试卷结构",notes="更新试卷结构")
|
|
@ApiOperation(value="更新试卷结构",notes="更新试卷结构")
|
|
@PutMapping(value = "/paperStruct")
|
|
@PutMapping(value = "/paperStruct")
|
|
- public ResponseEntity updatePaperStructure(@RequestBody PaperStruct ps){
|
|
|
|
- ps.setDetailCount(ps.getPaperDetailStructs().size());
|
|
|
|
- PaperStruct paperStruct = paperStructRepo.save(ps);
|
|
|
|
|
|
+ public ResponseEntity updatePaperStruct(@RequestBody PaperStruct ps){
|
|
|
|
+ PaperStruct paperStruct = paperStructService.save(ps);
|
|
return new ResponseEntity(paperStruct,HttpStatus.OK);
|
|
return new ResponseEntity(paperStruct,HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -86,9 +85,8 @@ public class PaperStructController {
|
|
*/
|
|
*/
|
|
@ApiOperation(value="新增试卷结构",notes="新增试卷结构")
|
|
@ApiOperation(value="新增试卷结构",notes="新增试卷结构")
|
|
@PostMapping(value = "/paperStruct")
|
|
@PostMapping(value = "/paperStruct")
|
|
- public ResponseEntity addPaperStructure(@RequestBody PaperStruct ps){
|
|
|
|
- ps.setDetailCount(ps.getPaperDetailStructs().size());
|
|
|
|
- PaperStruct paperStruct = paperStructRepo.save(ps);
|
|
|
|
|
|
+ public ResponseEntity addPaperStruct(@RequestBody PaperStruct ps){
|
|
|
|
+ PaperStruct paperStruct = paperStructService.save(ps);
|
|
return new ResponseEntity(paperStruct,HttpStatus.OK);
|
|
return new ResponseEntity(paperStruct,HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -99,7 +97,7 @@ public class PaperStructController {
|
|
*/
|
|
*/
|
|
@ApiOperation(value="删除试卷结构",notes="删除试卷结构")
|
|
@ApiOperation(value="删除试卷结构",notes="删除试卷结构")
|
|
@DeleteMapping(value = "/paperStruct/{ids}")
|
|
@DeleteMapping(value = "/paperStruct/{ids}")
|
|
- public ResponseEntity removePaperStructure(@PathVariable String ids){
|
|
|
|
|
|
+ public ResponseEntity removePaperStruct(@PathVariable String ids){
|
|
List<String> paperList = Stream.of(ids.split(",")).collect(Collectors.toList());
|
|
List<String> paperList = Stream.of(ids.split(",")).collect(Collectors.toList());
|
|
paperStructRepo.delete(paperStructRepo.findAll(paperList));
|
|
paperStructRepo.delete(paperStructRepo.findAll(paperList));
|
|
return new ResponseEntity(HttpStatus.OK);
|
|
return new ResponseEntity(HttpStatus.OK);
|