|
@@ -2,6 +2,7 @@ package cn.com.qmth.examcloud.service.core.api;
|
|
|
|
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
import cn.com.qmth.examcloud.service.core.entity.User;
|
|
import cn.com.qmth.examcloud.service.core.entity.User;
|
|
|
|
+import cn.com.qmth.examcloud.service.core.repo.UserRepo;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -46,6 +47,9 @@ public class StudentApi {
|
|
@Autowired
|
|
@Autowired
|
|
StudentService studentService;
|
|
StudentService studentService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ UserRepo userRepo;
|
|
|
|
+
|
|
@ApiOperation(value="查询所有学生",notes="分页")
|
|
@ApiOperation(value="查询所有学生",notes="分页")
|
|
@GetMapping("/{curPage}/{pageSize}")
|
|
@GetMapping("/{curPage}/{pageSize}")
|
|
public ResponseEntity getAllStudent(HttpServletRequest request,
|
|
public ResponseEntity getAllStudent(HttpServletRequest request,
|
|
@@ -95,6 +99,9 @@ public class StudentApi {
|
|
@PutMapping
|
|
@PutMapping
|
|
public ResponseEntity updateStudent(@RequestBody Student student){
|
|
public ResponseEntity updateStudent(@RequestBody Student student){
|
|
student.setUpdateTime(new Date());
|
|
student.setUpdateTime(new Date());
|
|
|
|
+ User user = userRepo.findOne(student.getUser().getId());
|
|
|
|
+ user.setName(student.getName());
|
|
|
|
+ userRepo.save(user);
|
|
return new ResponseEntity(studentRepo.save(student),HttpStatus.OK);
|
|
return new ResponseEntity(studentRepo.save(student),HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|