feat:兼容webflux的日志切面

This commit is contained in:
wangyu 2021-12-07 19:53:33 +08:00
parent defcf09d91
commit 23b89d8c56

View File

@ -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();