feat:兼容webflux的日志切面
This commit is contained in:
parent
defcf09d91
commit
23b89d8c56
@ -65,15 +65,9 @@ public class LogAdvice {
|
||||
if (null != result) {
|
||||
// 判断结果是否是publisher
|
||||
if (result instanceof Mono) {
|
||||
((Mono<?>) result).subscribe(data -> {
|
||||
context.setResult(data);
|
||||
context.end();
|
||||
});
|
||||
((Mono<?>) result).subscribe(context::setResult, context::setError, context::end);
|
||||
} else if (result instanceof Flux) {
|
||||
((Flux<?>) result).collectList().subscribe(list -> {
|
||||
context.setResult(list);
|
||||
context.end();
|
||||
});
|
||||
((Flux<?>) result).collectList().subscribe(context::setResult, context::setError, context::end);
|
||||
} else {
|
||||
context.setResult(result);
|
||||
context.end();
|
||||
|
Loading…
Reference in New Issue
Block a user