From b9b919bac7a4144f92d8dc301d5a7d7f03253e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Wed, 12 Apr 2023 22:06:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE=E8=BF=94?= =?UTF-8?q?=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Infrastructure/CustomException/ResultCode.cs | 3 +++ ZR.Admin.WebApi/Controllers/BaseController.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Infrastructure/CustomException/ResultCode.cs b/Infrastructure/CustomException/ResultCode.cs index 374b97a..b8296e7 100644 --- a/Infrastructure/CustomException/ResultCode.cs +++ b/Infrastructure/CustomException/ResultCode.cs @@ -7,6 +7,9 @@ namespace Infrastructure [Description("success")] SUCCESS = 200, + [Description("no data")] + NO_DATA = 210, + [Description("参数错误")] PARAM_ERROR = 101, diff --git a/ZR.Admin.WebApi/Controllers/BaseController.cs b/ZR.Admin.WebApi/Controllers/BaseController.cs index 62aed77..a6df96a 100644 --- a/ZR.Admin.WebApi/Controllers/BaseController.cs +++ b/ZR.Admin.WebApi/Controllers/BaseController.cs @@ -22,7 +22,7 @@ namespace ZR.Admin.WebApi.Controllers /// protected IActionResult SUCCESS(object data, string timeFormatStr = "yyyy-MM-dd HH:mm:ss") { - string jsonStr = GetJsonStr(GetApiResult(data != null ? ResultCode.SUCCESS : ResultCode.FAIL, data), timeFormatStr); + string jsonStr = GetJsonStr(GetApiResult(data != null ? ResultCode.SUCCESS : ResultCode.NO_DATA, data), timeFormatStr); return Content(jsonStr, "application/json"); }