using System;
using System.Collections.Generic;
using System.Text;

namespace Nirvana.Common
{
    public class ResultInfo
    {
        public int code { get; set; }
        public string message { get; set; }
        public object data { get; set; }

        public ResultInfo()
        {

        }
        public ResultInfo(int codes,string msg,object datas=null)
        {
            this.code = codes;
            this.message = msg;
            this.data = datas;
        }

    }
    public class ResultState
    {
        /// <summary>
        /// 失败 1
        /// </summary>
        public static readonly int FAIL = 1;
        /// <summary>
        /// 成功 0
        /// </summary>
        public static readonly int SUCCESS = 0;
        /// <summary>
        /// 微信获取不到用户信息
        /// </summary>
        public static readonly int WXUNAUTHORITY = 2;
        /// <summary>
        /// 登录成功
        /// </summary>
        public static readonly int LOGINSUCCESS = 3;

        /// <summary>
        /// 今日还未测测量
        /// </summary>
        public static readonly int NORESULT = 4;
        /// <summary>
        /// 未找到
        /// </summary>
        public static readonly int REDIRECT = 404;
        /// <summary>
        /// 系统异常
        /// </summary>
        public static readonly int SYSTEMERROR = 500;
        /// <summary>
        /// 没有访问权限
        /// </summary>
        public static readonly int NOAUTH = 40001;
        /// <summary>
        /// TOKEN验证未通过
        /// </summary>
        public static readonly int TOKEN = -100;
        /// <summary>
        /// 请求禁用资源请求
        /// </summary>
        public static readonly int DISAblEDRESOURCE = 100001;
        /// <summary>
        /// 无资源
        /// </summary>
        public static readonly int NORESOURCE = 100002;
    }

    public class ApiResultState
    {
        /// <summary>
        /// 系统繁忙
        /// </summary>
        public static readonly int SYSTEMBUSY = -1;
        /// <summary>
        /// 成功 0
        /// </summary>
        public static readonly int SUCCESS = 0;
        /// <summary>
        /// 参数有误
        /// </summary>
        public static readonly int PARAMERROR = 40000;
        /// <summary>
        /// appid无效
        /// </summary>
        public static readonly int NONAPPID = 40001;

        /// <summary>
        /// IP不合法
        /// </summary>
        public static readonly int IPNOALLOW = 40003;
        /// <summary>
        /// 缺少appid参数
        /// </summary>
        public static readonly int NOAPPID = 41001;
        /// <summary>
        /// 无可用数据
        /// </summary>
        public static readonly int NODATA = 50001;
    }

    public class ResultInfoV1
    {
        public string state { get; set; }
        public string message { get; set; }
        public object data { get; set; }
    }
    public enum ResultStateV1
    {
        //失败
        FAIL = 1,
        //成功
        SUCCESS = 0,
        //100段资源相关
        //请求禁用资源请求
        DISAblEDRESOURCE = 100001,
    }
}
