Files
SecMPS/api_sqlsugar/VolPro.Core/Extensions/Response/ApiResponseExtension.cs
2026-05-15 23:22:48 +08:00

44 lines
1.7 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using VolPro.Core.Enums;
using VolPro.Core.Utilities;
namespace VolPro.Core.Extensions
{
public static class ApiResponseExtension
{
//public static ApiResponseData ApiResponseOK(this ApiResponseData responseData, string msg=null)
//{
// return responseData.ApiSetResponse(ResponseType.OperSuccess, msg, ApiStatutsCode.Ok);
//}
//public static ApiResponseData ApiSetResponse(this ApiResponseData responseData, ResponseType responseType, ApiStatutsCode? status = null)
//{
// return responseData.ApiSetResponse(responseType, null, status);
//}
///// <summary>
/////
///// </summary>
///// <param name="responseData"></param>
///// <param name="responseType">返回消息类型</param>
///// <param name="msg">返回消息若msg为null,则取responseType的描述信息</param>
///// <param name="status">返回状态目前只有0、失败1、成功2、token过期</param>
//public static ApiResponseData ApiSetResponse(this ApiResponseData responseData, ResponseType responseType, string msg,ApiStatutsCode? status=null)
//{
// if (status != null)
// {
// responseData.Status = (int)status;
// }
// if (!string.IsNullOrEmpty(msg))
// {
// responseData.Message = msg;
// return responseData;
// }
// if (!string.IsNullOrEmpty(responseData.Message))
// return responseData;
// responseData.Message = responseType.GetMsg();
// return responseData;
//}
}
}