You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
using Apewer.Models; using System; using System.IO; using System.Net;
namespace Apewer.Web {
/// <summary></summary>
[Serializable] public sealed class ApiResponse {
#region internal
private ApiModel _model = null; private Json _data = Json.NewObject();
internal bool StopReturn = false;
/// <summary>API 的执行时间。</summary>
public string Duration { get; set; }
/// <summary>Application。</summary>
public string Application { get; set; }
/// <summary>Function。</summary>
public string Function { get; set; }
/// <summary>Random。</summary>
public string Random { get; set; }
#endregion
#region user
/// <summary>头。</summary>
public StringPairs Headers { get; set; } = new StringPairs();
/// <summary>Cookies。</summary>
public CookieCollection Cookies { get; set; } = new CookieCollection();
/// <summary>获取或设置输出模型。</summary>
public ApiModel Model { get { return _model; } set { var old = _model; _model = value; RuntimeUtility.Dispose(old); } }
/// <summary>当响应 Json 时,强制缩进排版。</summary>
public bool Indented { get; set; }
/// <summary>状态。</summary>
public string Status { get; set; }
/// <summary>消息。</summary>
public string Message { get; set; }
/// <summary>自定义数据。</summary>
public Json Data { get { return _data; } set { _data = value ?? Json.NewObject(); } }
/// <summary>设置 Data 的属性。</summary>
public string this[string name] { get => Data[name]; set => Data[name] = value; }
#endregion
#region Function
/// <summary>设置输出前的检查。</summary>
public ApiPreOutput PreOutput { get; set; }
#endregion
}
}
|