...
|
...
|
@@ -8,6 +8,8 @@ import com.yoho.search.base.utils.MD5Util; |
|
|
import com.yoho.search.consumer.index.common.IIndexBuilder;
|
|
|
import com.yoho.search.consumer.common.ConsumerConfiger;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
...
|
...
|
@@ -18,6 +20,8 @@ import java.util.UUID; |
|
|
@Component
|
|
|
public class TblProductIndexBuilder extends IIndexBuilder {
|
|
|
|
|
|
private final Logger INDEX_REBUILD_LOG = LoggerFactory.getLogger("INDEX_REBULDER");
|
|
|
|
|
|
@Autowired
|
|
|
private ConsumerConfiger configurer;
|
|
|
|
...
|
...
|
@@ -37,6 +41,7 @@ public class TblProductIndexBuilder extends IIndexBuilder { |
|
|
countUrl.append("getproductscountforsearch?client_type=iphone&client_secret=");
|
|
|
String md5 = MD5Util.string2MD5("client_type=iphone&private_key=" + configurer.getTblPrimaryKey());
|
|
|
countUrl.append(md5);
|
|
|
INDEX_REBUILD_LOG.info("TblProductIndexBuilder getCount is [{}]",countUrl.toString());
|
|
|
String countJson = HttpClientUtils.getMethod(countUrl.toString());
|
|
|
if (StringUtils.isNotBlank(countJson)) {
|
|
|
JSONObject jsonObject = JSON.parseObject(countJson);
|
...
|
...
|
@@ -71,6 +76,9 @@ public class TblProductIndexBuilder extends IIndexBuilder { |
|
|
String md5 = MD5Util.string2MD5(param.toString());
|
|
|
|
|
|
url.append("&client_secret=").append(md5);
|
|
|
|
|
|
INDEX_REBUILD_LOG.info("TblProductIndexBuilder getPageList is [{}]",url.toString());
|
|
|
|
|
|
String json = HttpClientUtils.getMethod(url.toString());
|
|
|
if (StringUtils.isBlank(json)) {
|
|
|
return null;
|
...
|
...
|
|