优化数据返回
This commit is contained in:
parent
cabdf0eaf9
commit
b9b919bac7
@ -7,6 +7,9 @@ namespace Infrastructure
|
||||
[Description("success")]
|
||||
SUCCESS = 200,
|
||||
|
||||
[Description("no data")]
|
||||
NO_DATA = 210,
|
||||
|
||||
[Description("参数错误")]
|
||||
PARAM_ERROR = 101,
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
/// <returns></returns>
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user