From f5bec709111dcf7a2d9900b19e8b8c5b1162c55c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 12 Sep 2022 17:22:07 +0800 Subject: [PATCH] R add isError and isSuccess method --- .../src/main/java/com/ruoyi/common/core/domain/R.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java index c3df6ae..d877460 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java @@ -102,4 +102,14 @@ public class R implements Serializable { this.data = data; } + + public Boolean isError() + { + return !isSuccess(); + } + + public Boolean isSuccess() + { + return R.SUCCESS == getCode(); + } }