示例#1
0
  /**
   * 根据条件查询商品类别服务
   *
   * @param request 查询请求对象
   * @return List<ProductCategoryResponseDto> 接口返回的数据对象集合
   */
  @SuppressWarnings("unchecked")
  public List<ProductCategoryResponseDto> getProductCategorys(
      ProductCategoryRequestDto requestDto) {
    //    	Assert.notNull(requestDto);

    ProductCategoryRequest request = new ProductCategoryRequest(super.getKey(), requestDto);

    if (LOG.isDebugEnabled()) {
      LOG.debug("getProductCategorys request: " + JsonHelper.toJson(request));
    }

    String url = super.getServiceUrlDomain() + "services/productCategory/getProductCategorys";

    HbirdResponse<List> response =
        super.getRestTemplate().postForObject(url, request, HbirdResponse.class);

    List<ProductCategoryResponseDto> responseResult =
        JsonHelper.toList(
            JsonHelper.toJson(response.getResult()), ProductCategoryResponseDto.class);
    response.setResult(responseResult);

    if (LOG.isDebugEnabled()) {
      LOG.debug("getProductCategorys url: " + url);
      LOG.debug("getProductCategorys response: " + JsonHelper.toJson(response));
    }
    return super.getResult(response);
  }
示例#2
0
  /**
   * 用户基本信息查询服务根据bean
   *
   * @param request 查询请求对象
   * @return UserProfileResponseDto 接口返回的数据对象
   */
  public UserProfileResponseDto getUserProfileByBean(UserProfileRequestDto requestDto) {
    Assert.notNull(requestDto);

    UserProfileRequest request = new UserProfileRequest(super.getKey(), requestDto);

    if (LOG.isDebugEnabled()) {
      LOG.debug("getUserProfile request: " + JsonHelper.toJson(request));
    }

    String url = super.getServiceUrlDomain() + "services/userProfile/getUserProfileByBean";
    UserProfileResponse response =
        super.getRestTemplate().postForObject(url, request, UserProfileResponse.class);

    if (LOG.isDebugEnabled()) {
      LOG.debug("getUserProfile url: " + url);
      LOG.debug("getUserProfile response: " + JsonHelper.toJson(response));
    }
    return super.getResult(response);
  }
示例#3
0
  /**
   * 商品类别查询服务
   *
   * @param request 查询请求对象
   * @return ProductCategoryResponseDto 接口返回的数据对象
   */
  public ProductCategoryResponseDto getProductCategory(ProductCategoryRequestDto requestDto) {
    Assert.notNull(requestDto);

    ProductCategoryRequest request = new ProductCategoryRequest(super.getKey(), requestDto);

    if (LOG.isDebugEnabled()) {
      LOG.debug("getProductCategory request: " + JsonHelper.toJson(request));
    }

    String url = super.getServiceUrlDomain() + "services/productCategory/getProductCategory";
    ProductCategoryResponse response =
        super.getRestTemplate().postForObject(url, request, ProductCategoryResponse.class);

    if (LOG.isDebugEnabled()) {
      LOG.debug("getProductCategory url: " + url);
      LOG.debug("getProductCategory response: " + JsonHelper.toJson(response));
    }
    return super.getResult(response);
  }
示例#4
0
 /**
  * 添加个人基本资料
  *
  * @param requestDto
  * @return
  */
 public Wrapper<?> add(UserProfileRequestDto requestDto) {
   if (LOG.isDebugEnabled()) {
     LOG.debug("register request: " + JsonHelper.toJson(requestDto));
   }
   UserProfileRequest request = new UserProfileRequest(super.getKey(), requestDto);
   UserProfileResponse response = null;
   String url = null;
   try {
     url = super.getServiceUrlDomain() + "services/userProfile/add";
     response = super.getRestTemplate().postForObject(url, request, UserProfileResponse.class);
   } catch (Exception e) {
     LOG.error("#UserProfileClient.add# ERROR:" + e);
   }
   if (LOG.isDebugEnabled()) {
     LOG.debug("getUserProfile url: " + url);
     LOG.debug("getUserProfile response: " + JsonHelper.toJson(response));
   }
   if (null != response) {
     return WrapMapper.wrap(response.getCode(), response.getMessage());
   } else {
     return WrapMapper.error();
   }
 }