Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
e28ce56e
Commit
e28ce56e
authored
Sep 17, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
c434d4ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
11 deletions
+7
-11
SolrConfig.java
src/main/java/com/egolm/shop/config/SolrConfig.java
+4
-6
GoodsCollectTask.java
...java/com/egolm/shop/schedules/goods/GoodsCollectTask.java
+2
-4
application.properties
src/main/resources/application.properties
+1
-1
No files found.
src/main/java/com/egolm/shop/config/SolrConfig.java
View file @
e28ce56e
...
...
@@ -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.Builder
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -10,13 +9,12 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public
class
SolrConfig
{
@Value
(
"${solr.
goods.core-url
}"
)
private
String
hou
seUrl
;
@Value
(
"${solr.
baseURL
}"
)
private
String
ba
seUrl
;
@Bean
@Qualifier
(
"goodsSolrClient"
)
public
HttpSolrClient
getHouseHttpSolrClient
()
{
return
new
Builder
().
withBaseSolrUrl
(
houseUrl
).
build
();
public
HttpSolrClient
getHttpSolrClient
()
{
return
new
Builder
().
withBaseSolrUrl
(
baseUrl
).
build
();
}
}
src/main/java/com/egolm/shop/schedules/goods/GoodsCollectTask.java
View file @
e28ce56e
...
...
@@ -5,7 +5,6 @@ import java.util.stream.Collectors;
import
org.apache.solr.client.solrj.impl.HttpSolrClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
@@ -16,11 +15,10 @@ import com.egolm.shop.schedules.AbstractSolrApi;
public
class
GoodsCollectTask
extends
AbstractSolrApi
{
@Autowired
JdbcTemplate
jdbcTemplate
;
private
JdbcTemplate
jdbcTemplate
;
@Autowired
@Qualifier
(
"solrClient"
)
HttpSolrClient
solrClient
;
private
HttpSolrClient
solrClient
;
@Value
(
"${solr.goods.offset-minute-for-day}"
)
private
Long
offsetMinuteForDay
;
...
...
src/main/resources/application.properties
View file @
e28ce56e
...
...
@@ -6,7 +6,7 @@ maven.build.timestamp=@maven.build.timestamp@
sql.house.create-index-query
=
sql/goods/create-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
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-minute
:
10
solr.house.cron-for-day
:
0 0 3 * * ?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment