|
|
|
@ -65,7 +65,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
*/ |
|
|
|
|
@Api(tags = "SCHEDULER_TAG") |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping("/projects/{projectName}/schedule") |
|
|
|
|
@RequestMapping("/projects/{projectCode}/schedule") |
|
|
|
|
public class SchedulerController extends BaseController { |
|
|
|
|
|
|
|
|
|
public static final String DEFAULT_WARNING_TYPE = "NONE"; |
|
|
|
@ -81,8 +81,8 @@ public class SchedulerController extends BaseController {
|
|
|
|
|
* create schedule |
|
|
|
|
* |
|
|
|
|
* @param loginUser login user |
|
|
|
|
* @param projectName project name |
|
|
|
|
* @param processDefinitionId process definition id |
|
|
|
|
* @param projectCode project code |
|
|
|
|
* @param processDefinitionCode process definition code |
|
|
|
|
* @param schedule scheduler |
|
|
|
|
* @param warningType warning type |
|
|
|
|
* @param warningGroupId warning group id |
|
|
|
@ -93,7 +93,7 @@ public class SchedulerController extends BaseController {
|
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "createSchedule", notes = "CREATE_SCHEDULE_NOTES") |
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100"), |
|
|
|
|
@ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataType = "Long", example = "100"), |
|
|
|
|
@ApiImplicitParam(name = "schedule", value = "SCHEDULE", dataType = "String", |
|
|
|
|
example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','timezoneId':'America/Phoenix','crontab':'0 0 3/6 * * ? *'}"), |
|
|
|
|
@ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", type = "WarningType"), |
|
|
|
@ -107,15 +107,15 @@ public class SchedulerController extends BaseController {
|
|
|
|
|
@ApiException(CREATE_SCHEDULE_ERROR) |
|
|
|
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
|
|
|
|
public Result createSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, |
|
|
|
|
@ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, |
|
|
|
|
@RequestParam(value = "processDefinitionId") Integer processDefinitionId, |
|
|
|
|
@ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, |
|
|
|
|
@RequestParam(value = "processDefinitionCode") long processDefinitionCode, |
|
|
|
|
@RequestParam(value = "schedule") String schedule, |
|
|
|
|
@RequestParam(value = "warningType", required = false, defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, |
|
|
|
|
@RequestParam(value = "warningGroupId", required = false, defaultValue = DEFAULT_NOTIFY_GROUP_ID) int warningGroupId, |
|
|
|
|
@RequestParam(value = "failureStrategy", required = false, defaultValue = DEFAULT_FAILURE_POLICY) FailureStrategy failureStrategy, |
|
|
|
|
@RequestParam(value = "workerGroup", required = false, defaultValue = "default") String workerGroup, |
|
|
|
|
@RequestParam(value = "processInstancePriority", required = false, defaultValue = DEFAULT_PROCESS_INSTANCE_PRIORITY) Priority processInstancePriority) { |
|
|
|
|
Map<String, Object> result = schedulerService.insertSchedule(loginUser, projectName, processDefinitionId, schedule, |
|
|
|
|
Map<String, Object> result = schedulerService.insertSchedule(loginUser, projectCode, processDefinitionCode, schedule, |
|
|
|
|
warningType, warningGroupId, failureStrategy, processInstancePriority, workerGroup); |
|
|
|
|
|
|
|
|
|
return returnDataList(result); |
|
|
|
|