|
@@ -41,7 +41,12 @@ public class StudentFaceInfoApi {
|
|
if(student == null){
|
|
if(student == null){
|
|
return new ResponseEntity(new ErrorMsg("该学生不存在"),HttpStatus.OK);
|
|
return new ResponseEntity(new ErrorMsg("该学生不存在"),HttpStatus.OK);
|
|
}
|
|
}
|
|
- return new ResponseEntity(studentFaceInfoRepo.findByStudentId(student.getId()),HttpStatus.OK);
|
|
|
|
|
|
+ StudentFaceInfo studentFaceInfo = studentFaceInfoRepo.findByStudentId(student.getId());
|
|
|
|
+ if(studentFaceInfo == null){
|
|
|
|
+ studentFaceInfo = new StudentFaceInfo();
|
|
|
|
+ studentFaceInfo.setStudent(student);
|
|
|
|
+ }
|
|
|
|
+ return new ResponseEntity(studentFaceInfo,HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value="按学号查询",notes="查询")
|
|
@ApiOperation(value="按学号查询",notes="查询")
|
|
@@ -51,7 +56,12 @@ public class StudentFaceInfoApi {
|
|
if(student == null){
|
|
if(student == null){
|
|
return new ResponseEntity(new ErrorMsg("该学生不存在"),HttpStatus.OK);
|
|
return new ResponseEntity(new ErrorMsg("该学生不存在"),HttpStatus.OK);
|
|
}
|
|
}
|
|
- return new ResponseEntity(studentFaceInfoRepo.findByStudentId(student.getId()),HttpStatus.OK);
|
|
|
|
|
|
+ StudentFaceInfo studentFaceInfo = studentFaceInfoRepo.findByStudentId(student.getId());
|
|
|
|
+ if(studentFaceInfo == null){
|
|
|
|
+ studentFaceInfo = new StudentFaceInfo();
|
|
|
|
+ studentFaceInfo.setStudent(student);
|
|
|
|
+ }
|
|
|
|
+ return new ResponseEntity(studentFaceInfo,HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value="按ID查询",notes="ID查询")
|
|
@ApiOperation(value="按ID查询",notes="ID查询")
|