make aggregation step optional
This commit is contained in:
@@ -95,6 +95,9 @@ public class Pipeline {
|
||||
return Mono.just(aggregateResult);
|
||||
}
|
||||
|
||||
if(CollectionUtils.isEmpty(steps)) {
|
||||
return handleOutput(input);
|
||||
}else {
|
||||
LinkedList<Step> opSteps = (LinkedList<Step>) steps.clone();
|
||||
Step step1 = opSteps.removeFirst();
|
||||
step1.beforeRun(stepContext, null);
|
||||
@@ -107,6 +110,12 @@ public class Pipeline {
|
||||
return createStep(step);
|
||||
}).flatMap(response -> Flux.just(response)).collectList();
|
||||
return result.flatMap(clientResponse -> {
|
||||
return handleOutput(input);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private Mono<AggregateResult> handleOutput(Input input){
|
||||
// 数据转换
|
||||
long t3 = System.currentTimeMillis();
|
||||
AggregateResult aggResult = this.doInputDataMapping(input, null);
|
||||
@@ -118,7 +127,6 @@ public class Pipeline {
|
||||
LOGGER.info("stepContext {}", JSON.toJSONString(stepContext));
|
||||
}
|
||||
return Mono.just(aggResult);
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user