using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace MoonExp.Models { public class ResponseMsg { 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 success(String msg, T result, long count = 0) { ResponseMsg rm = new ResponseMsg(200); rm.msg = msg; rm.result = result; rm.count = count; return rm; } public static ResponseMsg fail(String msg) { ResponseMsg rm = new ResponseMsg(500); rm.msg = msg; return rm; } } }