using System.Net;

namespace DigitalSchoolApi.Models
{
    /// <summary>
    /// 统一操作结果
    /// </summary>
    public class OperateResult<T>
    {
        /// <summary>
        /// 状态码 
        /// </summary>
        public HttpStatusCode StatusCode { get; set; }

        /// <summary>
        /// 操作结果 1成功 0失败 -1 未找到
        /// </summary>
        public Result Result { get; set; }

        /// <summary>
        /// 自定义消息
        /// </summary>
        public string Message { get; set; }

        /// <summary>
        /// 返回的数据
        /// </summary>
        public T Data { get; set; }
    }
    /// <summary>
    /// 操作结果
    /// </summary>
   public enum Result
    {
        /// <summary>
        /// 成功
        /// </summary>
        Success=1,
        /// <summary>
        /// 失败
        /// </summary>
        Fail=0,
        /// <summary>
        /// 未找到
        /// </summary>
        NotFound=-1
    }
}       