Commit e28ce56e authored by Quxl's avatar Quxl

x

parent c434d4ee
...@@ -2,7 +2,6 @@ package com.egolm.shop.config; ...@@ -2,7 +2,6 @@ package com.egolm.shop.config;
import org.apache.solr.client.solrj.impl.HttpSolrClient; import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.impl.HttpSolrClient.Builder; import org.apache.solr.client.solrj.impl.HttpSolrClient.Builder;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -10,13 +9,12 @@ import org.springframework.context.annotation.Configuration; ...@@ -10,13 +9,12 @@ import org.springframework.context.annotation.Configuration;
@Configuration @Configuration
public class SolrConfig { public class SolrConfig {
@Value("${solr.goods.core-url}") @Value("${solr.baseURL}")
private String houseUrl; private String baseUrl;
@Bean @Bean
@Qualifier("goodsSolrClient") public HttpSolrClient getHttpSolrClient() {
public HttpSolrClient getHouseHttpSolrClient() { return new Builder().withBaseSolrUrl(baseUrl).build();
return new Builder().withBaseSolrUrl(houseUrl).build();
} }
} }
...@@ -5,7 +5,6 @@ import java.util.stream.Collectors; ...@@ -5,7 +5,6 @@ import java.util.stream.Collectors;
import org.apache.solr.client.solrj.impl.HttpSolrClient; import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -16,11 +15,10 @@ import com.egolm.shop.schedules.AbstractSolrApi; ...@@ -16,11 +15,10 @@ import com.egolm.shop.schedules.AbstractSolrApi;
public class GoodsCollectTask extends AbstractSolrApi{ public class GoodsCollectTask extends AbstractSolrApi{
@Autowired @Autowired
JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
@Autowired @Autowired
@Qualifier("solrClient") private HttpSolrClient solrClient;
HttpSolrClient solrClient;
@Value("${solr.goods.offset-minute-for-day}") @Value("${solr.goods.offset-minute-for-day}")
private Long offsetMinuteForDay; private Long offsetMinuteForDay;
......
...@@ -6,7 +6,7 @@ maven.build.timestamp=@maven.build.timestamp@ ...@@ -6,7 +6,7 @@ maven.build.timestamp=@maven.build.timestamp@
sql.house.create-index-query= sql/goods/create-index-query.sql sql.house.create-index-query= sql/goods/create-index-query.sql
sql.house.delete-index-query= sql/goods/delete-index-query.sql sql.house.delete-index-query= sql/goods/delete-index-query.sql
sql.house.update-index-query= sql/goods/update-index-query.sql sql.house.update-index-query= sql/goods/update-index-query.sql
solr.house.core-url= http://10.10.0.15:8983/solr/house solr.house.core-url= http://10.10.0.15:8983/solr/goods
solr.house.offset-minute-for-day: 1500 solr.house.offset-minute-for-day: 1500
solr.house.offset-minute-for-minute: 10 solr.house.offset-minute-for-minute: 10
solr.house.cron-for-day: 0 0 3 * * ? solr.house.cron-for-day: 0 0 3 * * ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment