From c7caa3049ccbe13336ccead8ae55c32879954c75 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Tue, 21 Apr 2020 13:00:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8C=87=E5=AE=9A=E5=8D=95?= =?UTF-8?q?=E6=9C=AC=E5=B0=8F=E8=AF=B4=E7=88=AC=E5=8F=96=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../books/web/BookController.java | 31 +++++-- .../templates/books/book_submit.html | 88 +++++++++++++++++++ script/crawlbook/application.yml | 8 +- 3 files changed, 115 insertions(+), 12 deletions(-) create mode 100644 novel-front/src/main/resources/templates/books/book_submit.html diff --git a/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java b/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java index 7c0af91..0fa5bf7 100644 --- a/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java +++ b/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java @@ -8,15 +8,9 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import xyz.zinglizingli.books.core.config.SeoConfig; -import xyz.zinglizingli.books.po.Book; -import xyz.zinglizingli.books.po.BookContent; -import xyz.zinglizingli.books.po.BookIndex; -import xyz.zinglizingli.books.po.ScreenBullet; +import xyz.zinglizingli.books.po.*; import xyz.zinglizingli.books.service.BookService; import xyz.zinglizingli.books.service.UserService; import xyz.zinglizingli.books.vo.BookVO; @@ -50,6 +44,27 @@ public class BookController { private final CommonCacheUtil commonCacheUtil; + /** + * 单本小说提交页 + * */ + @RequestMapping("submit.html") + public String bookSubmitPage(){ + return "books/book_submit"; + } + + /** + * 单本小说提交 + * */ + @RequestMapping(method = RequestMethod.POST,value = "submit") + @ResponseBody + public Map bookSubmit(String bookUrl, String bookName, Float score){ + Map result = new HashMap<>(2); + bookService.addBookParseLog(bookUrl, bookName, score); + result.put("code", 1); + return result; + } + + /** * 精品小说搜索页 diff --git a/novel-front/src/main/resources/templates/books/book_submit.html b/novel-front/src/main/resources/templates/books/book_submit.html new file mode 100644 index 0000000..b420e63 --- /dev/null +++ b/novel-front/src/main/resources/templates/books/book_submit.html @@ -0,0 +1,88 @@ + + + + + + + + 小说提交 + +
+ + + + + + + + +
+ +
+ + +
+ 单本小说提交 +
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+
+
+
+ +
+
+ + + +
+ + + + + + \ No newline at end of file diff --git a/script/crawlbook/application.yml b/script/crawlbook/application.yml index c44c400..cd84373 100644 --- a/script/crawlbook/application.yml +++ b/script/crawlbook/application.yml @@ -1,7 +1,7 @@ server: {port: 8083} spring: - datasource: {url: 'jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai', - username: root, password: test123456} + datasource: {url: 'jdbc:mysql://47.106.243.172:3306/books?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai', + username: books, password: books!8888} mybatis: mapper-locations: classpath:mybatis/mapping/*.xml type-aliases-package: xyz.zinglizingli.books.po @@ -10,6 +10,6 @@ mysql: {charset: utf8mb4} books: {lowestScore: 9.0} crawl: website: {type: '4'} - soft-novel: '0' - manhua: '0' + soft-novel: '1' + manhua: '1' logging: {config: 'classpath:logback-boot.xml'}