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.
62 lines
1.4 KiB
62 lines
1.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace WebAPI.Models
|
|
{
|
|
public class Response
|
|
{
|
|
/// <summary>
|
|
/// 操作消息【当Status不为 200时,显示详细的错误信息】
|
|
/// </summary>
|
|
public string Message { get; set; }
|
|
|
|
/// <summary>
|
|
/// 操作状态码,200为正常
|
|
/// </summary>
|
|
public int Code { get; set; }
|
|
|
|
public Response()
|
|
{
|
|
Code = 200;
|
|
Message = "操作成功";
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// WEBAPI通用返回泛型基类
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
public class Response<T> : Response
|
|
{
|
|
/// <summary>
|
|
/// 回传的结果
|
|
/// </summary>
|
|
public T Result { get; set; }
|
|
}
|
|
|
|
public class Response2<T>
|
|
{
|
|
/// <summary>
|
|
/// 操作消息【当Status不为 200时,显示详细的错误信息】
|
|
/// </summary>
|
|
public string Message { get; set; }
|
|
|
|
/// <summary>
|
|
/// 操作状态码,200为正常
|
|
/// </summary>
|
|
public int Code { get; set; }
|
|
|
|
public int Count { get; set; }
|
|
public List<T> data { get; set; }
|
|
|
|
public Response2()
|
|
{
|
|
Code = 200;
|
|
Message = "操作成功";
|
|
Count = 0;
|
|
}
|
|
}
|
|
}
|