Commit 3964a800 authored by wzp's avatar wzp

修改返回格式

parent 01f6cb32
...@@ -8,9 +8,9 @@ package cn.wisenergy.chnmuseum.party.common.enums; ...@@ -8,9 +8,9 @@ package cn.wisenergy.chnmuseum.party.common.enums;
*/ */
public enum RESULT_INFO_ENUM { public enum RESULT_INFO_ENUM {
RESULT_CODE("code", "响应码key"), RESULT_CODE("resultCode", "响应码key"),
RESULT_MSG("msg", "响应信息key"), RESULT_MSG("message", "响应信息key"),
RESULT_BODY("body", "响应传输信息key"); RESULT_BODY("data", "响应传输信息key");
/** /**
* 响应结果key * 响应结果key
......
...@@ -58,6 +58,7 @@ public class BaseController implements Serializable { ...@@ -58,6 +58,7 @@ public class BaseController implements Serializable {
protected Map<String, Object> getResult(Object obj) { protected Map<String, Object> getResult(Object obj) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getCode()); map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getCode());
map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getMsg());
map.put(RESULT_INFO_ENUM.RESULT_BODY.getKey(), obj); map.put(RESULT_INFO_ENUM.RESULT_BODY.getKey(), obj);
return map; return map;
} }
...@@ -71,6 +72,7 @@ public class BaseController implements Serializable { ...@@ -71,6 +72,7 @@ public class BaseController implements Serializable {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getCode()); map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getCode());
map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getMsg()); map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getMsg());
map.put(RESULT_INFO_ENUM.RESULT_BODY.getKey(),"");
return map; return map;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment