using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudGaming.DtoModel.JY
{

    /// <summary>
    /// 鲸云api
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class JYResponseCode<T> where T : class, new()
    {
        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 消息
        /// </summary>
        public string Msg { get; set; }

        /// <summary>
        /// 数据源
        /// </summary>
        public T? Data { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public bool IsSuccess
        {
            get
            {
                return this.Status == 200;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool IsLineUp
        {
            get
            {
                return this.Status == 201;
            }
        }

        public MessageBox ToMessageBox()
        {
            return MessageBox.ErrorShow(this.Msg);
        }
    }
}
