use of com.dtstack.taier.dao.domain.TaskParamTemplate 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