wangwei 6 tahun lalu
induk
melakukan
3d3b4b9de0

+ 20 - 1
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/FaceController.java

@@ -5,11 +5,13 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+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.controller.bean.StudentFaceDomain;
 import cn.com.qmth.examcloud.core.basic.dao.StudentFaceRepo;
@@ -33,7 +35,7 @@ import io.swagger.annotations.ApiOperation;
 public class FaceController extends ControllerSupport {
 
 	@Autowired
-	StudentFaceRepo studentFaceInfoRepo;
+	StudentFaceRepo studentFaceRepo;
 
 	@Autowired
 	StudentRepo studentRepo;
@@ -65,4 +67,21 @@ public class FaceController extends ControllerSupport {
 		return facesetList;
 	}
 
+	@ApiOperation(value = "获取可用的faceset集合")
+	@GetMapping("studentFacre/{studentId}")
+	public StudentFaceEntity getStudentFacre(@PathVariable Long studentId) {
+
+		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");
+		}
+
+		return studentFaceEntity;
+	}
+
 }