|
@@ -1,5 +1,7 @@
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
|
|
+import cn.com.qmth.examcloud.service.core.entity.User;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -28,6 +30,8 @@ import cn.com.qmth.examcloud.service.core.enums.LoginType;
|
|
import cn.com.qmth.examcloud.service.core.repo.StudentRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.StudentRepo;
|
|
import cn.com.qmth.examcloud.service.core.service.StudentService;
|
|
import cn.com.qmth.examcloud.service.core.service.StudentService;
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 学生服务API
|
|
* 学生服务API
|
|
* Created by songyue on 17/1/14.
|
|
* Created by songyue on 17/1/14.
|
|
@@ -44,13 +48,25 @@ public class StudentApi {
|
|
|
|
|
|
@ApiOperation(value="查询所有学生",notes="分页")
|
|
@ApiOperation(value="查询所有学生",notes="分页")
|
|
@GetMapping("/{curPage}/{pageSize}")
|
|
@GetMapping("/{curPage}/{pageSize}")
|
|
- public ResponseEntity getAllStudent(@ModelAttribute Student studentCriteria, @PathVariable Integer curPage, @PathVariable Integer pageSize){
|
|
|
|
|
|
+ public ResponseEntity getAllStudent(HttpServletRequest request,
|
|
|
|
+ @ModelAttribute Student studentCriteria,
|
|
|
|
+ @PathVariable Integer curPage,
|
|
|
|
+ @PathVariable Integer pageSize){
|
|
|
|
+ AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
|
|
+ if(accessUser != null){
|
|
|
|
+ studentCriteria.setOrgId(accessUser.getRootOrgId());
|
|
|
|
+ }
|
|
return new ResponseEntity(studentService.getAllStudent(studentCriteria,new PageRequest(curPage,pageSize)),HttpStatus.OK);
|
|
return new ResponseEntity(studentService.getAllStudent(studentCriteria,new PageRequest(curPage,pageSize)),HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value="查询所有学生",notes="不分页")
|
|
@ApiOperation(value="查询所有学生",notes="不分页")
|
|
@GetMapping
|
|
@GetMapping
|
|
- public ResponseEntity getAllStudent(@ModelAttribute Student studentCriteria){
|
|
|
|
|
|
+ public ResponseEntity getAllStudent(HttpServletRequest request,
|
|
|
|
+ @ModelAttribute Student studentCriteria){
|
|
|
|
+ AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
|
|
+ if(accessUser != null){
|
|
|
|
+ studentCriteria.setOrgId(accessUser.getRootOrgId());
|
|
|
|
+ }
|
|
return new ResponseEntity(studentService.getAllStudent(studentCriteria),HttpStatus.OK);
|
|
return new ResponseEntity(studentService.getAllStudent(studentCriteria),HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|