WANG 5 tahun lalu
induk
melakukan
e586122073

+ 6 - 6
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/StudentController.java

@@ -36,9 +36,9 @@ import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.api.commons.security.enums.RoleMeta;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
+import cn.com.qmth.examcloud.commons.util.UrlUtil;
 import cn.com.qmth.examcloud.core.basic.api.controller.bean.StudentDomain;
 import cn.com.qmth.examcloud.core.basic.base.constants.BasicConsts;
-import cn.com.qmth.examcloud.core.basic.base.constants.PropKeys;
 import cn.com.qmth.examcloud.core.basic.dao.OrgRepo;
 import cn.com.qmth.examcloud.core.basic.dao.StudentCodeRepo;
 import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
@@ -186,10 +186,9 @@ public class StudentController extends ControllerSupport {
 
 		List<StudentDomain> studentDomainList = Lists.newArrayList();
 
-		String urlPrefix = PropertyHolder.getString(PropKeys.STUDENT_PHOTO_URL_PREFIX);
-		if (StringUtils.isBlank(urlPrefix)) {
-			throw new StatusException("560111",
-					"property[$studentPhoto.url.prefix] is not configured");
+		String upyunDomain = PropertyHolder.getString("$upyun.site.1.domain");
+		if (StringUtils.isBlank(upyunDomain)) {
+			throw new StatusException("560111", "property[$upyun.site.1.domain] is not configured");
 		}
 
 		while (iterator.hasNext()) {
@@ -212,7 +211,8 @@ public class StudentController extends ControllerSupport {
 
 			bean.setIdentityNumber(next.getIdentityNumber());
 			if (StringUtils.isNotBlank(next.getPhotoPath())) {
-				bean.setPhotoPath(urlPrefix + next.getPhotoPath());
+				bean.setPhotoPath(
+						UrlUtil.joinUrl(upyunDomain, "student_base_photo", next.getPhotoPath()));
 			}
 			bean.setPhoneNumber(next.getPhoneNumber());
 			bean.setSecurityPhone(next.getSecurityPhone());

+ 0 - 24
examcloud-core-basic-base/src/main/java/cn/com/qmth/examcloud/core/basic/base/constants/PropKeys.java

@@ -14,28 +14,4 @@ public interface PropKeys {
 	 */
 	String SESSION_TIMEOUT = "$core.basic.sessionTimeout";
 
-	/**
-	 * 又拍云学生底照路径
-	 */
-	String STUDENT_PHOTO_URL_PREFIX = "$studentPhoto.url.prefix";
-
-	/**
-	 * 短信验证码签名
-	 */
-	String SEND_VERIFICATION_CODE_SIGN = "$sendVerificationCode.sign";
-
-	/**
-	 * 短信验证码模板
-	 */
-	String SEND_VERIFICATION_CODE_TEMPLATE_CODE = "$sendVerificationCode.templatecode";
-
-	/**
-	 * 短信验证码有效期/秒
-	 */
-	String SEND_VERIFICATION_CODE_EFFECTIVE_TIME = "$sendVerificationCode.effectivetime";
-
-	/**
-	 * 短信验证码 发送间隔时间/秒
-	 */
-	String SEND_VERIFICATION_CODE_INTERVAL_SECONDS = "$sendVerificationCode.intervalseconds";
 }

+ 5 - 5
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/cache/StudentCache.java

@@ -6,7 +6,6 @@ import org.springframework.stereotype.Service;
 
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.util.UrlUtil;
-import cn.com.qmth.examcloud.core.basic.base.constants.PropKeys;
 import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
 import cn.com.qmth.examcloud.core.basic.dao.entity.StudentEntity;
 import cn.com.qmth.examcloud.support.cache.bean.StudentCacheBean;
@@ -39,11 +38,12 @@ public class StudentCache extends RandomObjectRedisCache<StudentCacheBean> {
 		b.setSecurityPhone(s.getSecurityPhone());
 
 		if (StringUtils.isNotBlank(s.getPhotoPath())) {
-			String basePath = PropertyHolder.getString(PropKeys.STUDENT_PHOTO_URL_PREFIX);
-			if (StringUtils.isBlank(basePath)) {
-				throw new StatusException("160212", "照片根路径未配置");
+			String upyunDomain = PropertyHolder.getString("$upyun.site.1.domain");
+			if (StringUtils.isBlank(upyunDomain)) {
+				throw new StatusException("560111",
+						"property[$upyun.site.1.domain] is not configured");
 			}
-			String path = UrlUtil.joinUrl(basePath, s.getPhotoPath());
+			String path = UrlUtil.joinUrl(upyunDomain, "student_base_photo", s.getPhotoPath());
 			b.setPhotoPath(path);
 		}
 

+ 5 - 5
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/StudentServiceImpl.java

@@ -16,7 +16,6 @@ import com.google.common.collect.Maps;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.util.UrlUtil;
 import cn.com.qmth.examcloud.core.basic.base.constants.BasicConsts;
-import cn.com.qmth.examcloud.core.basic.base.constants.PropKeys;
 import cn.com.qmth.examcloud.core.basic.dao.OrgRepo;
 import cn.com.qmth.examcloud.core.basic.dao.StudentCodeRepo;
 import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
@@ -302,11 +301,12 @@ public class StudentServiceImpl implements StudentService {
 		info.setPhoneNumber(s.getPhoneNumber());
 
 		if (StringUtils.isNotBlank(s.getPhotoPath())) {
-			String basePath = PropertyHolder.getString(PropKeys.STUDENT_PHOTO_URL_PREFIX);
-			if (StringUtils.isBlank(basePath)) {
-				throw new StatusException("160212", "照片根路径未配置");
+			String upyunDomain = PropertyHolder.getString("$upyun.site.1.domain");
+			if (StringUtils.isBlank(upyunDomain)) {
+				throw new StatusException("560111",
+						"property[$upyun.site.1.domain] is not configured");
 			}
-			String path = UrlUtil.joinUrl(basePath, s.getPhotoPath());
+			String path = UrlUtil.joinUrl(upyunDomain, "student_base_photo", s.getPhotoPath());
 			info.setPhotoPath(path);
 		}