From 732071ef58665cacfd284a9c29bca5702137a2d3 Mon Sep 17 00:00:00 2001 From: runphp Date: Wed, 7 Sep 2022 08:52:23 +0000 Subject: [PATCH] feat: add isError and isSuccess method Signed-off-by: runphp --- .../src/main/java/com/ruoyi/common/core/domain/R.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/R.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/R.java index 8f055531..787a4170 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/R.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/domain/R.java @@ -102,4 +102,12 @@ public class R implements Serializable { this.data = data; } + + public Boolean isError() { + return !isSuccess(); + } + + public Boolean isSuccess() { + return R.SUCCESS == getCode(); + } }