use of com.dtstack.taier.common.enums.EScheduleJobType in project Taier by DTStack.
the class TaskService method querySupportJobTypes.
/**
* 获得所有任务类型
*
* @return 任务类型
*/
public List<ReturnTaskSupportTypesVO> querySupportJobTypes() {
List<ReturnTaskSupportTypesVO> returnTaskSupportTypesVOS = Lists.newArrayList();
EScheduleJobType[] eScheduleJobTypes = EScheduleJobType.values();
for (EScheduleJobType eScheduleJobType : eScheduleJobTypes) {
ReturnTaskSupportTypesVO vo = new ReturnTaskSupportTypesVO();
vo.setTaskTypeName(eScheduleJobType.getName());
vo.setTaskTypeCode(eScheduleJobType.getType());
returnTaskSupportTypesVOS.add(vo);
}
return returnTaskSupportTypesVOS;
}
use of com.dtstack.taier.common.enums.EScheduleJobType in project Taier by DTStack.
the class BatchTaskService method getDefaultTaskParam.
/**
* 获取任务的默认参数
*
* @param tenantId 租户ID
* @param taskType 任务类型
* @return
*/
private String getDefaultTaskParam(Long tenantId, Integer taskType) {
EScheduleJobType eScheduleJobType = EScheduleJobType.getByTaskType(taskType);
List<Component> componentList = componentService.listComponentsByComponentType(tenantId, eScheduleJobType.getComponentType().getTypeCode());
if (CollectionUtils.isEmpty(componentList)) {
return Strings.EMPTY_STRING;
}
// todo 后续多版本再进行扩展
String version = componentList.get(0).getVersionName();
TaskParamTemplate taskParamTemplate = taskParamTemplateService.getTaskParamTemplate(version, taskType);
return Objects.isNull(taskParamTemplate) ? Strings.EMPTY_STRING : taskParamTemplate.getParams();
}
Aggregations