|
@@ -6,6 +6,7 @@ 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.base.util.PropertiesUtil;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
|
|
|
import cn.com.qmth.examcloud.task.api.request.SyncCourseReq;
|
|
@@ -40,6 +41,11 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
@Autowired
|
|
|
DataSyncService dataSyncService;
|
|
|
|
|
|
+ private Boolean async() {
|
|
|
+ boolean async = PropertiesUtil.getBoolean("$sync.async", true);
|
|
|
+ return async;
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("syncCourse")
|
|
|
@Override
|
|
|
public SyncCourseResp syncCourse(@RequestBody SyncCourseReq req) {
|
|
@@ -51,7 +57,7 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
r.setName(req.getName());
|
|
|
r.setRootOrgId(req.getRootOrgId());
|
|
|
r.setSyncType(req.getSyncType());
|
|
|
- dataSyncService.sync("syncCourse", r, true);
|
|
|
+ dataSyncService.sync("syncCourse", r, async(), true);
|
|
|
|
|
|
SyncCourseResp resp = new SyncCourseResp();
|
|
|
return resp;
|
|
@@ -67,7 +73,7 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
r.setParentId(req.getParentId());
|
|
|
r.setRootId(req.getRootId());
|
|
|
r.setSyncType(req.getSyncType());
|
|
|
- dataSyncService.sync("syncOrg", r, true);
|
|
|
+ dataSyncService.sync("syncOrg", r, async(), true);
|
|
|
|
|
|
SyncOrgResp resp = new SyncOrgResp();
|
|
|
return resp;
|
|
@@ -92,7 +98,7 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
r.setStudentCode(req.getStudentCode());
|
|
|
r.setSyncType(req.getSyncType());
|
|
|
|
|
|
- dataSyncService.sync("syncStudent", r, true);
|
|
|
+ dataSyncService.sync("syncStudent", r, async(), true);
|
|
|
|
|
|
SyncStudentResp resp = new SyncStudentResp();
|
|
|
return resp;
|
|
@@ -122,7 +128,7 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
r.setRootOrgName(req.getRootOrgName());
|
|
|
r.setSyncType(req.getSyncType());
|
|
|
|
|
|
- dataSyncService.sync("syncExam", r, true);
|
|
|
+ dataSyncService.sync("syncExam", r, async(), true);
|
|
|
SyncExamResp resp = new SyncExamResp();
|
|
|
return resp;
|
|
|
}
|
|
@@ -154,7 +160,7 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
r.setInfoCollector(req.getInfoCollector());
|
|
|
r.setExamSite(req.getExamSite());
|
|
|
|
|
|
- dataSyncService.sync("syncExamStudent", r, true);
|
|
|
+ dataSyncService.sync("syncExamStudent", r, async(), true);
|
|
|
SyncExamStudentResp resp = new SyncExamStudentResp();
|
|
|
return resp;
|
|
|
}
|