Пример #1
0
  /**
   * 获取指定勘察匹配表完整信息
   *
   * @param currentUser
   * @param dataDefine
   * @return
   */
  public ResultInfo<DataDefine> request(UserInfo currentUser, DataDefine dataDefine) {
    ResultInfo<DataDefine> result = new ResultInfo<DataDefine>();

    String url = currentUser.LatestServer + "/apis/GetAllDataFieldDefine/" + dataDefine.DDID;
    // 填充参数,key-value。key是接口要求传的变量名称
    Hashtable<String, Object> params = new Hashtable<String, Object>(1);
    params.put("token", currentUser.Token);

    CommonRequestPackage requestPackage =
        new CommonRequestPackage(url, RequestTypeEnum.GET, params);
    try {
      YFHttpClient.request(requestPackage, this);
      result = getResponseData();
    } catch (Exception e) {
      result.Success = false;
      result.Message = "服务器异常,获取勘察表失败";
      DataLogOperator.taskHttp("GetDataDefineDataTask=>获取指定勘察匹配表完整信息失败(request)", e.getMessage());
    }

    return result;
  }
  /**
   * 请求小区周边详情
   *
   * @param cityName //城市名称 例如: 北京
   * @param residentialAreaID //小区id 例如:12944
   * @return
   */
  public ResultInfo<AroundResidentialBeen> request(String cityName, int residentialAreaID) {
    ResultInfo<AroundResidentialBeen> result = null;

    String url = Constant.HTTP_ALL + Constant.HTTP_GETAROUNDRESIDENTIALAREAINFO;
    Hashtable<String, Object> params = new Hashtable<String, Object>(2);
    params.put("cityName", cityName);
    params.put("residentialAreaID", residentialAreaID);

    CommonRequestPackage commReauest = new CommonRequestPackage(url, RequestTypeEnum.GET, params);
    try {
      YFHttpClient.request(commReauest, this);
      result = getResponseData();
    } catch (Exception e) {
      if (result == null) {
        result = new ResultInfo<AroundResidentialBeen>();
      }
      result.Success = false;
      result.Message = e.getMessage();
    }

    return result;
  }