修改 Apiresult 的返回 Success->ok
This commit is contained in:
1 parent
db4f030c17
commit
ecba3b7ee6
4 files changed
+11
-12
No files matched your search
@@ -1,5 +1,4 @@
|
||||
using MAX.Framework.Commons;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace MAX.Framework.Dtos
|
||||
{
|
||||
@@ -47,7 +46,7 @@ namespace MAX.Framework.Dtos
|
||||
{
|
||||
public T? Data { get; set; }
|
||||
|
||||
public static ApiResult<T> Success(T data, string msg = "操作成功")
|
||||
public static ApiResult<T> Ok(T data, string msg = "操作成功")
|
||||
=> new ApiResult<T> { Code = ResultCode.Success, Data = data, Msg = msg };
|
||||
|
||||
public static ApiResult<T> Fail(string msg = "操作失败", int code = ResultCode.Fail, T? data = default)
|
||||
@@ -57,9 +56,9 @@ namespace MAX.Framework.Dtos
|
||||
/// <summary>
|
||||
/// 响应
|
||||
/// </summary>
|
||||
public class ApiResult : ApiResult<object>
|
||||
public class ApiResult : ApiResultBase
|
||||
{
|
||||
public static ApiResult Success(string msg = "操作成功")
|
||||
public static ApiResult Ok(string msg = "操作成功")
|
||||
=> new ApiResult { Code = ResultCode.Success, Msg = msg };
|
||||
|
||||
public static ApiResult Fail(string msg = "操作失败", int code = ResultCode.Fail)
|
||||
|
||||
Reference in new issue
Block a user