|
@@ -36,12 +36,14 @@ public class ResultMap extends HashMap<String, Object> {
|
|
|
|
|
|
public static ResultMap ok() {
|
|
public static ResultMap ok() {
|
|
ResultMap r = new ResultMap();
|
|
ResultMap r = new ResultMap();
|
|
|
|
+ r.put("code", HttpStatusEnum.SUCCESS.getCode());
|
|
r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
|
|
r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
|
|
return r;
|
|
return r;
|
|
}
|
|
}
|
|
|
|
|
|
public static ResultMap ok(Object data) {
|
|
public static ResultMap ok(Object data) {
|
|
ResultMap r = new ResultMap();
|
|
ResultMap r = new ResultMap();
|
|
|
|
+ r.put("code", HttpStatusEnum.SUCCESS.getCode());
|
|
r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
|
|
r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
|
|
r.put("data", data);
|
|
r.put("data", data);
|
|
return r;
|
|
return r;
|
|
@@ -61,7 +63,11 @@ public class ResultMap extends HashMap<String, Object> {
|
|
|
|
|
|
public static ResultMap ok(Map<String, Object> map) {
|
|
public static ResultMap ok(Map<String, Object> map) {
|
|
ResultMap r = new ResultMap();
|
|
ResultMap r = new ResultMap();
|
|
- r.putAll(map);
|
|
|
|
|
|
+ r.put("code", HttpStatusEnum.SUCCESS.getCode());
|
|
|
|
+ r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
|
|
|
|
+ HashMap<String, Object> dataMap = new HashMap<>(2);
|
|
|
|
+ dataMap.putAll(map);
|
|
|
|
+ r.put("data", dataMap);
|
|
return r;
|
|
return r;
|
|
}
|
|
}
|
|
|
|
|