From 78b0b58d0c0fa4a50b5767136f3bbee8f364fe61 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期五, 26 九月 2025 09:11:08 +0800
Subject: [PATCH] yys 新增配置文件
---
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..bd4f69f 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 static <T> Boolean isError(R<T> ret)
+ {
+ return !isSuccess(ret);
+ }
+
+ public static <T> Boolean isSuccess(R<T> ret)
+ {
+ return R.SUCCESS == ret.getCode();
+ }
}
--
Gitblit v1.9.3