using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IStation.Model.Api { /// /// 执行返回的通用类,该类带有详细的业务数据,除了告诉用户此次调用是否成功与否,以及一个表示提示信息的字符串外,还带的详细的业务数据 /// /// 业务数据的类型 public class Result : Result { /// /// 构造函数 /// public Result() { } /// /// 构造函数 /// public Result(T data, Code type, string message) : base(type, message) { this.Data = data; } /// /// 构造函数 /// public Result(T data, string message) : base(string.IsNullOrEmpty(message) ? Code.Success : Code.Error, message) { this.Data = data; } /// /// 构造函数 /// public Result(T data, Code type) : this(data, type, "") { } /// /// 构造函数 /// public Result(T data) : this(data, Code.Success, "") {} /// /// 业务数据 /// public T Data { get; set; } } }