|
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -30,6 +32,8 @@ import cn.com.qmth.examcloud.service.core.service.StudentFaceInfoService;
|
|
@RequestMapping("${app.api.root}/studentFaceInfo")
|
|
@RequestMapping("${app.api.root}/studentFaceInfo")
|
|
public class StudentFaceInfoApi {
|
|
public class StudentFaceInfoApi {
|
|
|
|
|
|
|
|
+ private static final Logger LOG = LoggerFactory.getLogger(StudentFaceInfoApi.class);
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
StudentFaceInfoRepo studentFaceInfoRepo;
|
|
StudentFaceInfoRepo studentFaceInfoRepo;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -82,8 +86,14 @@ public class StudentFaceInfoApi {
|
|
@ApiOperation(value = "更新学生照片信息", notes = "更新")
|
|
@ApiOperation(value = "更新学生照片信息", notes = "更新")
|
|
@PutMapping
|
|
@PutMapping
|
|
public ResponseEntity update(@RequestBody StudentFaceInfo studentFaceInfo) {
|
|
public ResponseEntity update(@RequestBody StudentFaceInfo studentFaceInfo) {
|
|
- studentFaceInfo.setUpdateTime(new Date());
|
|
|
|
- return new ResponseEntity(studentFaceInfoRepo.save(studentFaceInfo), HttpStatus.OK);
|
|
|
|
|
|
+ StudentFaceInfo studentFaceInfo4Update = studentFaceInfoRepo.findByStudentId(studentFaceInfo.getStudent().getId());
|
|
|
|
+ LOG.info("根据学生id" + studentFaceInfo.getStudent().getId() + "找到照片信息:" + studentFaceInfo4Update.getId());
|
|
|
|
+ studentFaceInfo4Update.setUpdateTime(new Date());
|
|
|
|
+ studentFaceInfo4Update.setPhotoMD5(studentFaceInfo.getPhotoMD5());
|
|
|
|
+ studentFaceInfo4Update.setFaceToken(studentFaceInfo.getFaceToken());
|
|
|
|
+ studentFaceInfo4Update.setFaceSetToken(studentFaceInfo.getFaceSetToken());
|
|
|
|
+
|
|
|
|
+ return new ResponseEntity(studentFaceInfoRepo.save(studentFaceInfo4Update), HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|