mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
解决book_index的主键生成冲突
This commit is contained in:
parent
4c42ac0d29
commit
e1e1310b9e
@ -30,6 +30,8 @@ import static java.util.regex.Pattern.compile;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class CrawlParser {
|
public class CrawlParser {
|
||||||
|
|
||||||
|
private static IdWorker idWorker = new IdWorker();
|
||||||
|
|
||||||
public static final Integer BOOK_INDEX_LIST_KEY = 1;
|
public static final Integer BOOK_INDEX_LIST_KEY = 1;
|
||||||
|
|
||||||
public static final Integer BOOK_CONTENT_LIST_KEY = 2;
|
public static final Integer BOOK_CONTENT_LIST_KEY = 2;
|
||||||
@ -202,7 +204,7 @@ public class CrawlParser {
|
|||||||
if(hasIndexs.size() == 0){
|
if(hasIndexs.size() == 0){
|
||||||
//新书入库
|
//新书入库
|
||||||
//设置目录和章节内容
|
//设置目录和章节内容
|
||||||
Long indexId = new IdWorker().nextId();
|
Long indexId = idWorker.nextId();
|
||||||
lastIndexId = indexId;
|
lastIndexId = indexId;
|
||||||
lastIndexName = indexName;
|
lastIndexName = indexName;
|
||||||
bookIndex.setId(indexId);
|
bookIndex.setId(indexId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user