Search in sources :

Example 1 with BatchFunctionVO

use of com.dtstack.taier.develop.dto.devlop.BatchFunctionVO in project Taier by DTStack.

the class BatchFunctionService method getFunction.

/**
 * 根据id获取函数
 * @param functionId
 * @return
 */
public BatchFunctionVO getFunction(Long functionId) {
    BatchFunction batchFunction = developFunctionDao.getOne(functionId);
    if (Objects.isNull(batchFunction)) {
        return new BatchFunctionVO();
    }
    BatchFunctionVO vo = BatchFunctionVO.toVO(batchFunction);
    // 如果函数有资源,则设置函数的资源
    BatchFunctionResource resourceFunctionByFunctionId = batchFunctionResourceService.getResourceFunctionByFunctionId(batchFunction.getId());
    if (Objects.nonNull(resourceFunctionByFunctionId)) {
        vo.setResources(resourceFunctionByFunctionId.getResourceId());
    }
    vo.setCreateUser(userService.getById(batchFunction.getCreateUserId()));
    vo.setModifyUser(userService.getById(batchFunction.getModifyUserId()));
    return vo;
}
Also used : BatchFunctionVO(com.dtstack.taier.develop.dto.devlop.BatchFunctionVO) BatchFunction(com.dtstack.taier.dao.domain.BatchFunction) BatchFunctionResource(com.dtstack.taier.dao.domain.BatchFunctionResource)

Aggregations

BatchFunction (com.dtstack.taier.dao.domain.BatchFunction)1 BatchFunctionResource (com.dtstack.taier.dao.domain.BatchFunctionResource)1 BatchFunctionVO (com.dtstack.taier.develop.dto.devlop.BatchFunctionVO)1