|
@@ -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.JsonUtil;
|
|
|
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;
|
|
@@ -16,6 +17,8 @@ import cn.com.qmth.examcloud.task.api.response.SyncCourseResp;
|
|
|
import cn.com.qmth.examcloud.task.api.response.SyncOrgResp;
|
|
|
import cn.com.qmth.examcloud.task.api.response.SyncSpecialtyResp;
|
|
|
import cn.com.qmth.examcloud.task.api.response.SyncStudentResp;
|
|
|
+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.task.service.bean.CourseInfo;
|
|
|
import cn.com.qmth.examcloud.task.service.bean.OrgInfo;
|
|
@@ -38,12 +41,23 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
@Autowired
|
|
|
DataSyncService dataSyncService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ DataSyncRepo dataSyncRepo;
|
|
|
+
|
|
|
private static final long serialVersionUID = -2880611326177571371L;
|
|
|
|
|
|
@PostMapping("syncCourse")
|
|
|
@Override
|
|
|
public SyncCourseResp syncCourse(@RequestBody SyncCourseReq req) {
|
|
|
CourseInfo info = new CourseInfo();
|
|
|
+
|
|
|
+ DataSyncEntity entity = new DataSyncEntity();
|
|
|
+ entity.setMethodName("syncCourse");
|
|
|
+ entity.setParamType(CourseInfo.class.getName());
|
|
|
+ entity.setParam(JsonUtil.toJson(info));
|
|
|
+
|
|
|
+ dataSyncRepo.saveAndFlush(entity);
|
|
|
+
|
|
|
dataSyncService.syncCourse(info);
|
|
|
return null;
|
|
|
}
|
|
@@ -52,6 +66,14 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
@Override
|
|
|
public SyncOrgResp syncOrg(@RequestBody SyncOrgReq req) {
|
|
|
OrgInfo info = new OrgInfo();
|
|
|
+
|
|
|
+ DataSyncEntity entity = new DataSyncEntity();
|
|
|
+ entity.setMethodName("syncOrg");
|
|
|
+ entity.setParamType(CourseInfo.class.getName());
|
|
|
+ entity.setParam(JsonUtil.toJson(info));
|
|
|
+
|
|
|
+ dataSyncRepo.saveAndFlush(entity);
|
|
|
+
|
|
|
dataSyncService.syncOrg(info);
|
|
|
return null;
|
|
|
}
|
|
@@ -60,6 +82,14 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
@Override
|
|
|
public SyncStudentResp syncStudent(@RequestBody SyncStudentReq req) {
|
|
|
StudentInfo info = new StudentInfo();
|
|
|
+
|
|
|
+ DataSyncEntity entity = new DataSyncEntity();
|
|
|
+ entity.setMethodName("syncStudent");
|
|
|
+ entity.setParamType(CourseInfo.class.getName());
|
|
|
+ entity.setParam(JsonUtil.toJson(info));
|
|
|
+
|
|
|
+ dataSyncRepo.saveAndFlush(entity);
|
|
|
+
|
|
|
dataSyncService.syncStudent(info);
|
|
|
return null;
|
|
|
}
|
|
@@ -68,6 +98,14 @@ public class DataSyncCloudServiceProvider extends ControllerSupport
|
|
|
@Override
|
|
|
public SyncSpecialtyResp syncSpecialty(@RequestBody SyncSpecialtyReq req) {
|
|
|
SpecialtyInfo info = new SpecialtyInfo();
|
|
|
+
|
|
|
+ DataSyncEntity entity = new DataSyncEntity();
|
|
|
+ entity.setMethodName("syncSpecialty");
|
|
|
+ entity.setParamType(CourseInfo.class.getName());
|
|
|
+ entity.setParam(JsonUtil.toJson(info));
|
|
|
+
|
|
|
+ dataSyncRepo.saveAndFlush(entity);
|
|
|
+
|
|
|
dataSyncService.syncSpecialty(info);
|
|
|
return null;
|
|
|
}
|