mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-26 17:20:52 +00:00
update
This commit is contained in:
parent
1fba55fd31
commit
a678a8bef2
@ -6,6 +6,7 @@ import com.java2nb.novel.core.utils.RandomBookInfoUtil;
|
||||
import com.java2nb.novel.entity.Book;
|
||||
import com.java2nb.novel.entity.BookContent;
|
||||
import com.java2nb.novel.entity.BookIndex;
|
||||
import com.java2nb.novel.utils.Constants;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@ -116,7 +117,7 @@ public class CrawlParser {
|
||||
book.setScore(RandomBookInfoUtil.getScoreByVisitCount(book.getVisitCount()));
|
||||
} else if (book.getVisitCount() == null && book.getScore() == null) {
|
||||
//都没有,设置成固定值
|
||||
book.setVisitCount(100L);
|
||||
book.setVisitCount(Constants.VISIT_COUNT_DEFAULT);
|
||||
book.setScore(6.5f);
|
||||
}
|
||||
}
|
@ -168,6 +168,9 @@ public class BookServiceImpl implements BookService {
|
||||
book.setUpdateTime(currentDate);
|
||||
book.setBookName(null);
|
||||
book.setAuthorName(null);
|
||||
if(Constants.VISIT_COUNT_DEFAULT.equals(book.getVisitCount())) {
|
||||
book.setVisitCount(null);
|
||||
}
|
||||
if(book.getPicUrl()!=null && book.getPicUrl().startsWith(Constants.LOCAL_PIC_PREFIX)) {
|
||||
//本地图片则不更新
|
||||
book.setPicUrl(null);
|
||||
|
@ -9,4 +9,9 @@ public class Constants {
|
||||
* 本地图片保存前缀
|
||||
* */
|
||||
public static final String LOCAL_PIC_PREFIX = "/localPic/";
|
||||
|
||||
/**
|
||||
* 访问量默认值
|
||||
*/
|
||||
public static final Long VISIT_COUNT_DEFAULT = 100L;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user