|
@@ -11,13 +11,18 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.StudentFaceCloudService;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.bean.FacesetBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.bean.StudentFaceBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.request.GetStudentFaceReq;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.request.GetUsableFacesetListReq;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentFaceReq;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.response.GetStudentFaceResp;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetUsableFacesetListResp;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentFaceResp;
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.FacesetRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.StudentFaceRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.FacesetEntity;
|
|
@@ -43,7 +48,10 @@ public class StudentFaceCloudServiceProvider extends ControllerSupport
|
|
|
private static final long serialVersionUID = 8674317301051207328L;
|
|
|
|
|
|
@Autowired
|
|
|
- StudentFaceRepo studentFaceInfoRepo;
|
|
|
+ StudentFaceRepo studentFaceRepo;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ FacesetRepo facesetRepo;
|
|
|
|
|
|
@Autowired
|
|
|
StudentRepo studentRepo;
|
|
@@ -95,4 +103,50 @@ public class StudentFaceCloudServiceProvider extends ControllerSupport
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "获取可用的faceset集合")
|
|
|
+ @PostMapping("getStudentFace")
|
|
|
+ @Override
|
|
|
+ public GetStudentFaceResp getStudentFace(GetStudentFaceReq req) {
|
|
|
+ Long studentId = req.getStudentId();
|
|
|
+
|
|
|
+ if (null == studentId) {
|
|
|
+ throw new StatusException("B-710001", "studentId is null");
|
|
|
+ }
|
|
|
+
|
|
|
+ StudentFaceEntity studentFaceEntity = studentFaceRepo.findOne(studentId);
|
|
|
+
|
|
|
+ if (null == studentFaceEntity) {
|
|
|
+ throw new StatusException("B-710001", "studentFaceEntity is null");
|
|
|
+ }
|
|
|
+
|
|
|
+ StudentFaceBean studentFaceBean = new StudentFaceBean();
|
|
|
+
|
|
|
+ studentFaceBean.setCreator(studentFaceEntity.getCreator());
|
|
|
+ studentFaceBean.setFacesetId(studentFaceEntity.getFacesetId());
|
|
|
+ studentFaceBean.setFaceToken(studentFaceEntity.getFaceToken());
|
|
|
+ studentFaceBean.setModifiedBy(studentFaceEntity.getModifiedBy());
|
|
|
+ studentFaceBean.setStudentId(studentFaceEntity.getStudentId());
|
|
|
+
|
|
|
+ GetStudentFaceResp resp = new GetStudentFaceResp();
|
|
|
+ resp.setStudentFaceBean(studentFaceBean);
|
|
|
+
|
|
|
+ if (null != studentFaceEntity.getFacesetId()) {
|
|
|
+ FacesetEntity facesetEntity = facesetRepo.findOne(studentFaceEntity.getFacesetId());
|
|
|
+ if (null != facesetEntity) {
|
|
|
+ FacesetBean facesetBean = new FacesetBean();
|
|
|
+ facesetBean.setDisplayName(facesetEntity.getDisplayName());
|
|
|
+ facesetBean.setFaceCount(facesetEntity.getFaceCount());
|
|
|
+ facesetBean.setFacesetToken(facesetEntity.getFacesetToken());
|
|
|
+ facesetBean.setId(facesetEntity.getId());
|
|
|
+ facesetBean.setOuterId(facesetEntity.getOuterId());
|
|
|
+ facesetBean.setTags(facesetEntity.getTags());
|
|
|
+
|
|
|
+ resp.setFacesetBean(facesetBean);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
}
|