Example #1
0
 /**
  * 删除菜单
  *
  * @param AgentID
  * @return
  */
 public static Result<String> deleteMenu(String token, int AgentID) {
   Result<String> result = new Result<String>();
   JSONObject jo = MenuAPI.deleteMenu(token, AgentID);
   if (jo != null) {
     result.setErrmsg(ErrorCodeText.errorMsg(jo.getString("errcode")));
     result.setErrcode(jo.getString("errcode"));
     result.setObject("");
   }
   return result;
 }
Example #2
0
  /**
   * 获取菜单列表
   *
   * @param AgentID
   * @return
   */
  public static Result<JSONObject> getMenu(String token, int AgentID) {
    Result<JSONObject> result = new Result<JSONObject>();
    JSONObject jo = MenuAPI.getMenu(token, AgentID);
    if (jo != null) {

      String errmsg = null;
      String errcode = null;
      try {
        errmsg = ErrorCodeText.errorMsg(jo.getString("errcode"));
        errcode = jo.getString("errcode");
        System.out.println("errmsg=" + errmsg);
        System.out.println("errcode=" + errcode);
        result.setErrmsg(errmsg);
        result.setErrcode(errcode);
      } catch (Exception e) {
      }

      if (result.getErrcode() == null && result.getErrmsg() == null) {
        result.setObject(jo.getJSONObject("menu"));
      }
    }
    return result;
  }