From bdf682ea7286dcc1870a2da6048b7e79ea992ddc Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 28 九月 2022 15:31:29 +0800
Subject: [PATCH] 优化代码生成同步后值NULL问题(I5OJDW)

---
 src/main/java/com/ruoyi/framework/web/domain/R.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/ruoyi/framework/web/domain/R.java b/src/main/java/com/ruoyi/framework/web/domain/R.java
index d16cc72..6a97abc 100644
--- a/src/main/java/com/ruoyi/framework/web/domain/R.java
+++ b/src/main/java/com/ruoyi/framework/web/domain/R.java
@@ -1,6 +1,7 @@
 package com.ruoyi.framework.web.domain;
 
 import java.io.Serializable;
+import com.ruoyi.common.constant.HttpStatus;
 
 /**
  * 鍝嶅簲淇℃伅涓讳綋
@@ -12,10 +13,10 @@
     private static final long serialVersionUID = 1L;
 
     /** 鎴愬姛 */
-    public static final int SUCCESS = 0;
+    public static final int SUCCESS = HttpStatus.SUCCESS;
 
     /** 澶辫触 */
-    public static final int FAIL = 500;
+    public static final int FAIL = HttpStatus.ERROR;
 
     private int code;
 
@@ -101,4 +102,14 @@
     {
         this.data = data;
     }
+
+    public Boolean isError()
+    {
+        return !isSuccess();
+    }
+
+    public Boolean isSuccess()
+    {
+        return R.SUCCESS == getCode();
+    }
 }

--
Gitblit v1.9.3