@@ -0,0 +1,1220 @@
+package com.hunantv.fw.result;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport com.alibaba.fastjson.JSON;%0A%0Apublic class RestfulResult %7B%0A%0A%09private Map c = new HashMap();%0A%09private static final int OK = 0;%0A%09private static final String CODE_KEY = %22code%22;%0A%09private static final String MSG_KEY = %22msg%22;%0A%09private static final String DATA_KEY = %22data%22;%0A%0A%09public RestfulResult() %7B%0A%09%09this(RestfulResult.OK);%0A%09%7D%0A%0A%09public RestfulResult(int ret) %7B%0A%09%09this(RestfulResult.OK, null);%0A%09%7D%0A%0A%09public RestfulResult(Object data) %7B%0A%09%09this(RestfulResult.OK, null, data);%0A%09%7D%0A%0A%09public RestfulResult(int ret, String msg) %7B%0A%09%09this(ret, msg, null);%0A%09%7D%0A%0A%09public RestfulResult(int ret, String msg, Object data) %7B%0A%09%09this.setCode(ret);%0A%09%09this.setMsg(msg);%0A%09%09this.setData(data);%0A%09%7D%0A%0A%09public void setCode(int ret) %7B%0A%09%09this.c.put(CODE_KEY, ret);%0A%09%7D%0A%0A%09public void setMsg(String msg) %7B%0A%09%09this.c.put(MSG_KEY, msg);%0A%09%7D%0A%0A%09public void setData(Object data) %7B%0A%09%09this.c.put(DATA_KEY, data);%0A%09%7D%0A%0A%09public int getCode() %7B%0A%09%09return (Integer) this.c.get(CODE_KEY);%0A%09%7D%0A%0A%09public String getMsg() %7B%0A%09%09return (String) this.c.get(MSG_KEY);%0A%09%7D%0A%0A%09public Object getData() %7B%0A%09%09return this.c.get(DATA_KEY);%0A%09%7D%0A%0A%09public String toJson() %7B%0A%09%09return JSON.toJSONString(c);%0A%09%7D%0A%7D%0A

add restful result class