using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
|
namespace MoonExp.Models
|
{
|
public class ResponseMsg<T>
|
{
|
public ResponseMsg()
|
{
|
time = DateTime.Now.Ticks;
|
}
|
|
public ResponseMsg(int code)
|
: this()
|
{
|
this.code = code;
|
}
|
|
public int code { set; get; }
|
|
public String msg { set; get; }
|
|
public long count { set; get; }
|
|
public T result { set; get; }
|
|
public long time { set; get; }
|
|
public static ResponseMsg<T> success(String msg, T result, long count = 0)
|
{
|
ResponseMsg<T> rm = new ResponseMsg<T>(200);
|
rm.msg = msg;
|
rm.result = result;
|
rm.count = count;
|
|
return rm;
|
}
|
|
public static ResponseMsg<T> fail(String msg)
|
{
|
ResponseMsg<T> rm = new ResponseMsg<T>(500);
|
rm.msg = msg;
|
|
return rm;
|
}
|
}
|
}
|