mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
增加爬取小说数据最低分的配置
This commit is contained in:
parent
9f18dd8f2f
commit
587d79c967
14
README.md
14
README.md
@ -15,17 +15,23 @@ Springboot+Mybatis+Mysql+Ehcache+Thymeleaf+Layui
|
||||
|
||||
2. 修改项目application.yml配置文件中的数据库配置。
|
||||
|
||||

|
||||
|
||||
3. 修改项目application.yml配置文件中的首页本站推荐小说配置(修改的小说需要在数据库中存在)。
|
||||
|
||||

|
||||
|
||||
4. 本地直接运行或使用maven插件打包成jar文件上传到服务器上。
|
||||
4. 根据需求,修改项目application.yml配置文件中的爬取小说最低分配置。
|
||||
|
||||
5. `http://ip:port`访问首页。
|
||||

|
||||
|
||||
6. `http://ip:port/books`访问精品小说模块。
|
||||
5. 本地直接运行或使用maven插件打包成jar文件上传到服务器上。
|
||||
|
||||
7. `http://ip:port/book/searchSoftBook.html`访问轻小说模块。
|
||||
6. `http://ip:port`访问首页。
|
||||
|
||||
7. `http://ip:port/books`访问精品小说模块。
|
||||
|
||||
8. `http://ip:port/book/searchSoftBook.html`访问轻小说模块。
|
||||
|
||||
#### 项目截图
|
||||
|
||||
|
BIN
assets/database_config.png
Normal file
BIN
assets/database_config.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.0 KiB |
BIN
assets/score_config.png
Normal file
BIN
assets/score_config.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
@ -3,6 +3,7 @@ package xyz.zinglizingli.common.schedule;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
@ -33,6 +34,9 @@ public class CrawlBooksSchedule {
|
||||
|
||||
RestTemplate restTemplate = RestTemplateUtil.getInstance("utf-8");
|
||||
|
||||
@Value("${books.lowestScore}")
|
||||
private Float lowestScore;
|
||||
|
||||
|
||||
private boolean isExcuting = false;
|
||||
|
||||
@ -485,7 +489,7 @@ public class CrawlBooksSchedule {
|
||||
try {
|
||||
Float score = Float.parseFloat(scoreMatch.group(1));
|
||||
|
||||
if (score < 8.0) {//数据库空间有效暂时爬取7.5分以上的小说
|
||||
if (score < lowestScore) {//数据库空间有限,暂时爬取8.0分以上的小说
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -725,7 +729,7 @@ public class CrawlBooksSchedule {
|
||||
try {
|
||||
Float score = Float.parseFloat(scoreMatch.group(1));
|
||||
|
||||
if (score < 8.0) {//数据库空间有效暂时爬取7.5分以上的小说
|
||||
if (score < lowestScore) {//数据库空间有限,暂时爬取8.0分以上的小说
|
||||
continue;
|
||||
}
|
||||
String bookName = bookNameMatch.group(1);
|
||||
|
@ -62,7 +62,9 @@ index:
|
||||
mysql:
|
||||
charset: utf8mb4
|
||||
|
||||
|
||||
#爬取小说数据的最低评分
|
||||
books:
|
||||
lowestScore: 8.0
|
||||
|
||||
|
||||
search:
|
||||
|
Loading…
x
Reference in New Issue
Block a user