WANG 6 years ago
parent
commit
83afc54b75

+ 2 - 2
examcloud-task-api-provider/src/main/java/cn/com/qmth/examcloud/task/api/provider/DataSyncCloudServiceProvider.java

@@ -6,7 +6,6 @@ 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.util.PropertiesUtil;
 import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
 import cn.com.qmth.examcloud.task.api.request.SyncCourseReq;
 import cn.com.qmth.examcloud.task.api.request.SyncExamReq;
@@ -23,6 +22,7 @@ import cn.com.qmth.examcloud.task.api.response.SyncSpecialtyResp;
 import cn.com.qmth.examcloud.task.api.response.SyncStudentResp;
 import cn.com.qmth.examcloud.task.api.response.SyncUserResp;
 import cn.com.qmth.examcloud.task.service.DataSyncService;
+import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
 
 /**
@@ -44,7 +44,7 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
 	DataSyncService dataSyncService;
 
 	private Boolean async() {
-		boolean async = PropertiesUtil.getBoolean("$sync.async", true);
+		boolean async = PropertyHolder.getBoolean("$sync.async", true);
 		return async;
 	}
 

+ 3 - 3
examcloud-task-service/src/main/java/cn/com/qmth/examcloud/task/service/impl/DataSyncServiceImpl.java

@@ -9,13 +9,13 @@ import org.springframework.stereotype.Service;
 
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.util.JsonUtil;
-import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
 import cn.com.qmth.examcloud.commons.util.RegExpUtil;
 import cn.com.qmth.examcloud.global.api.HandleSyncCloudService;
 import cn.com.qmth.examcloud.global.api.request.SyncBaseRequest;
 import cn.com.qmth.examcloud.task.dao.DataSyncRepo;
 import cn.com.qmth.examcloud.task.dao.entity.DataSyncEntity;
 import cn.com.qmth.examcloud.task.service.DataSyncService;
+import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
 
 /**
  * 类注释
@@ -35,7 +35,7 @@ public class DataSyncServiceImpl implements DataSyncService {
 
 	@Override
 	public void sync(String methodName, SyncBaseRequest req, Boolean async, Boolean retry) {
-		String group = PropertiesUtil.getString("$sync." + methodName + ".group");
+		String group = PropertyHolder.getString("$sync." + methodName + ".group");
 		if (StringUtils.isBlank(group)) {
 			throw new StatusException("T-001001", "group is not configured");
 		}
@@ -50,7 +50,7 @@ public class DataSyncServiceImpl implements DataSyncService {
 	@Override
 	public void sync(String component, String methodName, SyncBaseRequest req, Boolean async,
 			Boolean retry) {
-		String url = PropertiesUtil.getString("$sync." + methodName + ".component." + component);
+		String url = PropertyHolder.getString("$sync." + methodName + ".component." + component);
 		req.setUrl(url);
 
 		if (async) {