/*
   *  Date	 :2015-6-4 14:09
   *  Author:吴梦飞
   *  Desc  :
   */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nirvana.Common.ApiBase
{
    public class ReturnSingleData<T>
    {
        public ReturnStatus status { get; set; }
        public T data { get; set; }
        public ReturnSingleData(ReturnStatus returnstatues, T returndata)
        {
            this.status = returnstatues;
            this.data = returndata;
        }

        public string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }
    }

    public class ReturnSingleDataV2<T>
    {

        public int code { get; set; }
        public string name { get; set; }
        public string message { get; set; }
        public T data { get; set; }

        public ReturnSingleDataV2(APIResult apiresult, string msg, T returndata)
        {
            this.code = (int)apiresult;
            this.name = apiresult.ToString();
            this.message = msg;
            this.data = returndata;
        }

        public string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }
    }

}
