浏览代码

学生底照路径由exchange传递,basic不能自己拼

xiatian 5 年之前
父节点
当前提交
2aab803b0f

+ 7 - 5
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/FaceServiceImpl.java

@@ -5,8 +5,6 @@ import java.net.URI;
 import java.util.List;
 import java.util.Map;
 
-import cn.com.qmth.examcloud.web.filestorage.FileStoragePathEnvInfo;
-import cn.com.qmth.examcloud.web.filestorage.FileStorageUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpStatus;
@@ -40,7 +38,9 @@ import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentFaceReq;
 import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
 import cn.com.qmth.examcloud.core.basic.api.response.GetUsableFacesetListResp;
 import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
-import cn.com.qmth.examcloud.web.upyun.UpyunPathEnvironmentInfo;
+import cn.com.qmth.examcloud.web.filestorage.FileStoragePathEnvInfo;
+import cn.com.qmth.examcloud.web.filestorage.FileStorageUtil;
+import cn.com.qmth.examcloud.web.filestorage.YunPathInfo;
 import cn.com.qmth.examcloud.web.upyun.UpyunService;
 
 /**
@@ -92,8 +92,9 @@ public class FaceServiceImpl implements FaceService {
 		env.setFileSuffix(fileSuffix);
 		env.setRootOrgId(String.valueOf(rootOrgId));
 		env.setUserId(String.valueOf(id));
-
-		String photoUrl = FileStorageUtil.saveFile("studentBasePhoto", env, file, true).getUrl();
+		//通用存储
+		YunPathInfo pi=FileStorageUtil.saveFile("studentBasePhoto", env, file, true);
+		String photoUrl = pi.getUrl();
 
 		String faceToken = detect(photoUrl);
 
@@ -111,6 +112,7 @@ public class FaceServiceImpl implements FaceService {
 		request.setRootOrgId(rootOrgId);
 		request.setStudentId(student.getId());
 		request.setFaceCount(faceCount);
+		request.setPhotoTreatyPath(pi.getRelativePath());
 
 		faceCloudService.saveStudentFace(request);