Пример #1
0
  public List<KeywordType> setKeywordPrice(List<KeywordType> list) throws ApiException {
    if (list == null || list.size() == 0) {
      return Collections.emptyList();
    }

    UpdateKeywordRequest request = new UpdateKeywordRequest();
    request.setKeywordTypes(list);

    KeywordService keywordService = commonService.getService(KeywordService.class);
    UpdateKeywordResponse response = keywordService.updateKeyword(request);
    if (response == null) {
      return Collections.emptyList();
    }

    return response.getKeywordTypes();
  }
Пример #2
0
  /**
   * 关键词更新
   *
   * @param list 关键词列表
   * @return
   * @throws ApiException
   */
  public List<KeywordType> updateKeyword(List<KeywordType> list) throws ApiException {
    if (list == null || list.isEmpty()) {
      return Collections.emptyList();
    }

    UpdateKeywordRequest request = new UpdateKeywordRequest();
    request.setKeywordTypes(list);

    KeywordService keywordService = commonService.getService(KeywordService.class);
    UpdateKeywordResponse response = keywordService.updateKeyword(request);
    if (response == null) {
      try {
        TimeUnit.SECONDS.sleep(3);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }

      if (response != null) return response.getKeywordTypes();
    }

    return Collections.emptyList();
  }