From 5c7724c81363e66dc9c6d2b1a0a825cd7bb444da Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Mon, 29 Jun 2020 16:43:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java2nb/novel/service/impl/FriendLinkServiceImpl.java | 2 +- .../com/java2nb/novel/service/impl/NewsServiceImpl.java | 2 +- sql/novel_plus.sql | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/novel-front/src/main/java/com/java2nb/novel/service/impl/FriendLinkServiceImpl.java b/novel-front/src/main/java/com/java2nb/novel/service/impl/FriendLinkServiceImpl.java index 6e88d34..b065016 100644 --- a/novel-front/src/main/java/com/java2nb/novel/service/impl/FriendLinkServiceImpl.java +++ b/novel-front/src/main/java/com/java2nb/novel/service/impl/FriendLinkServiceImpl.java @@ -40,7 +40,7 @@ public class FriendLinkServiceImpl implements FriendLinkService { .build() .render(RenderingStrategies.MYBATIS3); result = friendLinkMapper.selectMany(selectStatement); - cacheService.setObject(CacheKey.INDEX_LINK_KEY,result); + cacheService.setObject(CacheKey.INDEX_LINK_KEY,result,60 * 60 * 24); } return result; } diff --git a/novel-front/src/main/java/com/java2nb/novel/service/impl/NewsServiceImpl.java b/novel-front/src/main/java/com/java2nb/novel/service/impl/NewsServiceImpl.java index 7793a4d..6507243 100644 --- a/novel-front/src/main/java/com/java2nb/novel/service/impl/NewsServiceImpl.java +++ b/novel-front/src/main/java/com/java2nb/novel/service/impl/NewsServiceImpl.java @@ -42,7 +42,7 @@ public class NewsServiceImpl implements NewsService { .build() .render(RenderingStrategies.MYBATIS3); result = newsMapper.selectMany(selectStatement); - cacheService.setObject(CacheKey.INDEX_NEWS_KEY,result); + cacheService.setObject(CacheKey.INDEX_NEWS_KEY,result,60 * 60 * 12); } return result; } diff --git a/sql/novel_plus.sql b/sql/novel_plus.sql index 6601b32..a0ef191 100644 --- a/sql/novel_plus.sql +++ b/sql/novel_plus.sql @@ -1831,4 +1831,8 @@ CREATE TABLE `crawl_single_task` ( -- ---------------------------- INSERT INTO `crawl_single_task` VALUES ('6', '2', '百书斋', '1', '1', '1', '1', '0', '5', '2020-06-15 14:36:07'); INSERT INTO `crawl_single_task` VALUES ('7', '5', '笔趣阁', '108_108291', '1', '衍天志之不朽仙', '白衣少年丶', '1', '1', '2020-06-15 14:46:08'); -UPDATE `crawl_source` SET `source_name` = '书趣阁', `crawl_rule` = '{\n \"bookListUrl\": \"http://m.shuquge.com/sort/{catId}/0_{page}.html\",\n \"catIdRule\": {\n \"catId1\": \"1\",\n \"catId2\": \"2\",\n \"catId3\": \"3\",\n \"catId4\": \"4\",\n \"catId5\": \"7\",\n \"catId6\": \"6\",\n \"catId7\": \"8\"\n },\n \"bookIdPatten\": \"href=\\\"/s/(\\\\d+)\\\\.html\\\"\",\n \"pagePatten\": \"第(\\\\d+)/\\\\d+页\",\n \"totalPagePatten\": \"第\\\\d+/(\\\\d+)页\",\n \"bookDetailUrl\": \"http://m.shuquge.com/s/{bookId}.html\",\n \"bookNamePatten\": \"

([^/]+)

\",\n \"authorNamePatten\": \"

作者:([^/]+)

\",\n \"picUrlPatten\": \"src=\\\"(http://www.shuquge.com/files/article/image/\\\\d+/\\\\d+/\\\\d+s\\\\.jpg)\\\"\",\n \"statusPatten\": \"

状态:([^/]+)

\",\n \"bookStatusRule\": {\n \"连载中\": 0,\n \"完本\": 1\n },\n \"descStart\": \"
\",\n \"descEnd\": \"最新章节推荐地址\",\n \"bookIndexUrl\": \"http://www.shuquge.com/txt/{bookId}/index.html\",\n \"bookIndexStart\": \"
《\",\n \"indexIdPatten\": \"
[^/]+
\",\n \"indexNamePatten\": \"
([^/]+)
\",\n \"bookContentUrl\": \"http://www.shuquge.com/txt/{bookId}/{indexId}.html\",\n \"contentStart\": \"
\",\n \"contentEnd\": \"http://www.shuquge.com\"\n}', `source_status` = 1, `create_time` = '2020-05-18 12:02:34', `update_time` = '2020-05-18 12:02:34' WHERE `id` = 4; \ No newline at end of file +UPDATE `crawl_source` SET `source_name` = '书趣阁', `crawl_rule` = '{\n \"bookListUrl\": \"http://m.shuquge.com/sort/{catId}/0_{page}.html\",\n \"catIdRule\": {\n \"catId1\": \"1\",\n \"catId2\": \"2\",\n \"catId3\": \"3\",\n \"catId4\": \"4\",\n \"catId5\": \"7\",\n \"catId6\": \"6\",\n \"catId7\": \"8\"\n },\n \"bookIdPatten\": \"href=\\\"/s/(\\\\d+)\\\\.html\\\"\",\n \"pagePatten\": \"第(\\\\d+)/\\\\d+页\",\n \"totalPagePatten\": \"第\\\\d+/(\\\\d+)页\",\n \"bookDetailUrl\": \"http://m.shuquge.com/s/{bookId}.html\",\n \"bookNamePatten\": \"

([^/]+)

\",\n \"authorNamePatten\": \"

作者:([^/]+)

\",\n \"picUrlPatten\": \"src=\\\"(http://www.shuquge.com/files/article/image/\\\\d+/\\\\d+/\\\\d+s\\\\.jpg)\\\"\",\n \"statusPatten\": \"

状态:([^/]+)

\",\n \"bookStatusRule\": {\n \"连载中\": 0,\n \"完本\": 1\n },\n \"descStart\": \"
\",\n \"descEnd\": \"最新章节推荐地址\",\n \"bookIndexUrl\": \"http://www.shuquge.com/txt/{bookId}/index.html\",\n \"bookIndexStart\": \"
《\",\n \"indexIdPatten\": \"
[^/]+
\",\n \"indexNamePatten\": \"
([^/]+)
\",\n \"bookContentUrl\": \"http://www.shuquge.com/txt/{bookId}/{indexId}.html\",\n \"contentStart\": \"
\",\n \"contentEnd\": \"http://www.shuquge.com\"\n}', `source_status` = 1, `create_time` = '2020-05-18 12:02:34', `update_time` = '2020-05-18 12:02:34' WHERE `id` = 4; + +INSERT INTO `friend_link` ( `link_name`, `link_url`, `sort`, `is_open`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES +('小羊影视', 'http://video.java2nb.com/', 11, 1, NULL, NULL, NULL, NULL), +('官方论坛', 'http://bbs.java2nb.com', 21, 1, NULL, NULL, NULL, NULL); \ No newline at end of file