Procházet zdrojové kódy

调试主页接口

Administrator před 2 roky
rodič
revize
d5c4626b4b

+ 1 - 1
mhotel/src/com/happy/Model/AdminManager.java

@@ -98,7 +98,7 @@ public class AdminManager {
 	private Integer status;
 
 	/**
-	 * 备注
+	 * 备注\
 	 */
 	private String remark;
 

+ 8 - 1
mhotel/src/com/happy/action/AppHomePageAction.java

@@ -166,9 +166,16 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
         }
 
         Hotel hotel = hotelService.getById(Func.parseInt(hotelId));
+        if (hotel == null)
+        {
+            jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
+            jsonObject.put(B.message,"无法查询到当前酒店信息");
+            ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
+            return null;
+        }
 
         jsonObject.put(B.code,ResultStatusCode.OK.getStatus());
-        jsonObject.put(B.message,ResultUtil.ok(hotel));
+        jsonObject.put(B.data,hotel);
         ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
         return null;
     }