use of com.dtstack.taier.dao.domain.Component 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();
}
use of com.dtstack.taier.dao.domain.Component in project Taier by DTStack.
the class ComponentVO method toVOS.
public static List<ComponentVO> toVOS(List<Component> components) {
List<ComponentVO> vos = new ArrayList<>();
if (CollectionUtils.isEmpty(components)) {
return vos;
}
for (Component component : components) {
ComponentVO vo = new ComponentVO();
BeanUtils.copyProperties(component, vo);
vos.add(vo);
}
return vos;
}
Aggregations