|
@@ -15,8 +15,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -76,27 +74,32 @@ public class StudentController extends ControllerSupport {
|
|
|
return new ResponseEntity(studentService.getAllStudent(studentCriteria), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "按ID查询学生", notes = "ID查询")
|
|
|
@GetMapping("/{id}")
|
|
|
- public ResponseEntity getStudentById(@PathVariable Long id) {
|
|
|
- return new ResponseEntity(studentRepo.findOne(id), HttpStatus.OK);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "新增学生", notes = "新增")
|
|
|
- @PostMapping
|
|
|
- public void addStudent(@RequestBody Student student) {
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "更新学生", notes = "更新")
|
|
|
- @PutMapping
|
|
|
- public void updateStudent(@RequestBody Student student) {
|
|
|
+ public Student getStudentById(@PathVariable Long id) {
|
|
|
+ Student s = studentRepo.findOne(id);
|
|
|
+ return s;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "按ID删除学生", notes = "删除")
|
|
|
@DeleteMapping("/{id}")
|
|
|
- public ResponseEntity deleteStudent(@PathVariable Long id) {
|
|
|
+ public Long deleteStudent(@PathVariable Long id) {
|
|
|
studentRepo.delete(id);
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return id;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "学生照片绑定", notes = "照片绑定")
|