|
@@ -6,6 +6,7 @@ import cn.com.qmth.examcloud.service.core.service.LearnCenterService;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
+import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -35,6 +36,12 @@ public class LearnCenterApi {
|
|
return learnCenterService.getAllLearnCenter(learnCenterCriteria);
|
|
return learnCenterService.getAllLearnCenter(learnCenterCriteria);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value="查询所有学习中心",notes="不分页不带查询")
|
|
|
|
+ @GetMapping
|
|
|
|
+ public ResponseEntity getAllLearnCenter(){
|
|
|
|
+ return new ResponseEntity(learnCenterRepo.findAll(), HttpStatus.OK);
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value="按ID查询学习中心",notes="ID查询")
|
|
@ApiOperation(value="按ID查询学习中心",notes="ID查询")
|
|
@GetMapping("/{id}")
|
|
@GetMapping("/{id}")
|
|
public ResponseEntity<LearnCenter> getLearnCenterById(@PathVariable Long id){
|
|
public ResponseEntity<LearnCenter> getLearnCenterById(@PathVariable Long id){
|
|
@@ -43,13 +50,13 @@ public class LearnCenterApi {
|
|
|
|
|
|
@ApiOperation(value="新增学习中心",notes="新增")
|
|
@ApiOperation(value="新增学习中心",notes="新增")
|
|
@PostMapping
|
|
@PostMapping
|
|
- public ResponseEntity addLearnCenter(@ModelAttribute LearnCenter learnCenter){
|
|
|
|
|
|
+ public ResponseEntity addLearnCenter(@RequestBody LearnCenter learnCenter){
|
|
return learnCenterService.saveLearnCenter(learnCenter);
|
|
return learnCenterService.saveLearnCenter(learnCenter);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value="更新学习中心",notes="更新")
|
|
@ApiOperation(value="更新学习中心",notes="更新")
|
|
@PutMapping
|
|
@PutMapping
|
|
- public ResponseEntity updateLearnCenter(@ModelAttribute LearnCenter learnCenter){
|
|
|
|
|
|
+ public ResponseEntity updateLearnCenter(@RequestBody LearnCenter learnCenter){
|
|
return learnCenterService.saveLearnCenter(learnCenter);
|
|
return learnCenterService.saveLearnCenter(learnCenter);
|
|
}
|
|
}
|
|
|
|
|