Commit c6268406 authored by mcb's avatar mcb

no message

parent 330d5784
...@@ -228,6 +228,10 @@ public class RealTimeSyncController { ...@@ -228,6 +228,10 @@ public class RealTimeSyncController {
if (StringUtils.isEmpty(params.get("targetDataSourceId").toString())) { if (StringUtils.isEmpty(params.get("targetDataSourceId").toString())) {
return new JsonResult(ResultCode.PARAMS_ERROR, "目标数据源id不能为空!"); return new JsonResult(ResultCode.PARAMS_ERROR, "目标数据源id不能为空!");
} }
if (StringUtils.isEmpty(params.get("treeId").toString())) {
return new JsonResult(ResultCode.PARAMS_ERROR, "业务节点id不能为空!");
}
//异步提交 //异步提交
Thread thread = new Thread(new Runnable() { Thread thread = new Thread(new Runnable() {
@Override @Override
...@@ -243,4 +247,43 @@ public class RealTimeSyncController { ...@@ -243,4 +247,43 @@ public class RealTimeSyncController {
return new JsonResult(); return new JsonResult();
} }
/**
* 编辑实时同步任务
*
* @return
* @author Bellamy
* @since 2021-01-08
*/
@ApiOperation(value = "编辑实时同步任务", notes = "编辑实时同步任务")
@PostMapping(value = "/updateTask")
public JsonResult updateTask(@RequestBody Map<String, Object> params, HttpServletRequest httpRequest) throws Exception {
logger.info("################请求参数{}" + params.toString() + "############");
if (StringUtils.isEmpty(params.get("projectId").toString())) {
return new JsonResult(ResultCode.PARAMS_ERROR, "项目id不能为空!");
}
if (StringUtils.isEmpty(params.get("srcDataSourceId").toString())) {
return new JsonResult(ResultCode.PARAMS_ERROR, "来源数据源id不能为空!");
}
if (StringUtils.isEmpty(params.get("targetDataSourceId").toString())) {
return new JsonResult(ResultCode.PARAMS_ERROR, "目标数据源id不能为空!");
}
if (StringUtils.isEmpty(params.get("taskId").toString())) {
return new JsonResult(ResultCode.PARAMS_ERROR, "任务id不能为空!");
}
//异步提交
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
dmpRealtimeSyncInfoService.updateRealTimeTask(params);
} catch (Exception e) {
e.printStackTrace();
}
}
});
thread.start();
return new JsonResult();
}
} }
\ No newline at end of file
...@@ -111,5 +111,14 @@ public interface DmpRealtimeSyncInfoService { ...@@ -111,5 +111,14 @@ public interface DmpRealtimeSyncInfoService {
* @author Bellamy * @author Bellamy
* @since 2021-01-08 * @since 2021-01-08
*/ */
boolean addRealTimeTask(Map<String, Object> params) throws Exception; JsonResult addRealTimeTask(Map<String, Object> params) throws Exception;
/**
* 编辑实时同步任务
*
* @return
* @author Bellamy
* @since 2021-01-08
*/
JsonResult updateRealTimeTask(Map<String, Object> params) throws Exception;
} }
\ No newline at end of file
{ {
"projectId":31, "projectId":31,
"treeId": 1,
"srcDataSourceId":205, "srcDataSourceId":205,
"targetDataSourceId":202, "targetDataSourceId":202,
"sourceName":"test34", "sourceName":"test34",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment