diff --git a/thain-core/src/main/java/com/xiaomi/thain/core/ThainFacade.java b/thain-core/src/main/java/com/xiaomi/thain/core/ThainFacade.java index 166d6c95..0b4f0de3 100644 --- a/thain-core/src/main/java/com/xiaomi/thain/core/ThainFacade.java +++ b/thain-core/src/main/java/com/xiaomi/thain/core/ThainFacade.java @@ -55,8 +55,8 @@ private ThainFacade(@NonNull ProcessEngineConfiguration processEngineConfigurati schedulerEngine.start(); } - public static ThainFacade getInstance(ProcessEngineConfiguration processEngineConfiguration, - SchedulerEngineConfiguration schedulerEngineConfiguration) + public static ThainFacade getInstance(@NonNull ProcessEngineConfiguration processEngineConfiguration, + @NonNull SchedulerEngineConfiguration schedulerEngineConfiguration) throws ThainSchedulerException, ThainMissRequiredArgumentsException, IOException, SQLException { return new ThainFacade(processEngineConfiguration, schedulerEngineConfiguration); } @@ -64,7 +64,7 @@ public static ThainFacade getInstance(ProcessEngineConfiguration processEngineCo /** * 新建任务, cron为空的则只部署,不调度, 这个flowJson是不含id的,如果含id也没用 */ - public long addFlow(AddRq addRq) throws ThainException { + public long addFlow(@NonNull AddRq addRq) throws ThainException { val flowId = processEngine.addFlow(addRq.flowModel, addRq.jobModelList).orElseThrow(() -> new ThainException("failed to insert flow")); if (StringUtils.isBlank(addRq.flowModel.cron)) { return flowId; @@ -79,7 +79,7 @@ public long addFlow(AddRq addRq) throws ThainException { return flowId; } - public long updateFlow(String flowJson) throws SchedulerException, ThainException, ParseException { + public long updateFlow(@NonNull String flowJson) throws SchedulerException, ThainException, ParseException { val addDto = JSON.parseObject(flowJson, AddRq.class); return updateFlow(addDto); } @@ -87,7 +87,7 @@ public long updateFlow(String flowJson) throws SchedulerException, ThainExceptio /** * 更新flow */ - public long updateFlow(AddRq addRq) throws SchedulerException, ThainException, ParseException { + public long updateFlow(@NonNull AddRq addRq) throws SchedulerException, ThainException, ParseException { val flowModel = addRq.flowModel; val jobModelList = addRq.jobModelList;