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
c381b1d7
Commit
c381b1d7
authored
Sep 18, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
aae64de0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
GoodsCollectTask.java
...java/com/egolm/shop/schedules/goods/GoodsCollectTask.java
+29
-0
application-dev.properties
src/main/resources/application-dev.properties
+0
-2
application.properties
src/main/resources/application.properties
+2
-1
No files found.
src/main/java/com/egolm/shop/schedules/goods/GoodsCollectTask.java
View file @
c381b1d7
...
...
@@ -12,12 +12,20 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.egolm.common.FileUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.shop.schedules.AbstractSolrApi
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"搜索引擎更新工具"
})
@Controller
@RequestMapping
(
"util/search/goods"
)
public
class
GoodsCollectTask
extends
AbstractSolrApi
{
@Autowired
...
...
@@ -52,6 +60,27 @@ public class GoodsCollectTask extends AbstractSolrApi{
deleteIndexQuerySql
=
FileUtil
.
fileToString
(
updateIndexQueryFilePath
);
}
@ApiOperation
(
"更新全量索引"
)
@PostMapping
(
"createFullIndex"
)
public
String
createFullIndex
()
{
this
.
createIndex
();
return
Rjx
.
jsonOk
().
toJson
();
}
@ApiOperation
(
"更新当天索引"
)
@PostMapping
(
"updateTodayIndex"
)
public
String
updateTodayIndex
()
{
this
.
dayExecute
();
return
Rjx
.
jsonOk
().
toJson
();
}
@ApiOperation
(
"更新最新索引"
)
@PostMapping
(
"updateIndex"
)
public
String
updateIndex
()
{
this
.
minuteExecute
();
return
Rjx
.
jsonOk
().
toJson
();
}
@Scheduled
(
cron
=
"${solr.goods.cron-for-day}"
)
public
void
dayExecute
()
{
Date
date
=
new
Date
(
System
.
currentTimeMillis
()
-
(
offsetMinuteForDay
*
60L
*
1000L
));
...
...
src/main/resources/application-dev.properties
View file @
c381b1d7
...
...
@@ -33,8 +33,6 @@ spring.redis.pool.max-wait=2000
spring.redis.pool.max-idle
=
5
spring.redis.pool.min-idle
=
0
solr.baseURL
=
http://10.10.0.15:8983/solr/goods
### 游客 用户生成用户的前缀
redis.guest.key
=
B2B_Guest
#### 用户验证码存储的前缀
...
...
src/main/resources/application.properties
View file @
c381b1d7
...
...
@@ -10,4 +10,5 @@ solr.goods.core-url= http://10.10.0.15:8983/solr/goods
solr.goods.offset-minute-for-day
:
1500
solr.goods.offset-minute-for-minute
:
10
solr.goods.cron-for-day
:
0 0 3 * * ?
solr.goods.cron-for-minute
:
0 * * * * ?
\ No newline at end of file
solr.goods.cron-for-minute
:
0 * * * * ?
solr.baseURL
=
http://10.10.0.15:8983/solr/goods
\ No newline at end of file
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