From 355cb80458cf607a9d03e0d1a0eb5ee5f003207f Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Sat, 12 Dec 2020 10:03:15 +0800 Subject: [PATCH] =?UTF-8?q?restful=20api=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../novel/controller/CrawlController.java | 13 +++---- .../templates/crawl/crawlSingleTask_add.html | 2 +- .../templates/crawl/crawlSingleTask_list.html | 8 ++--- .../templates/crawl/crawlSource_list.html | 2 +- .../novel/controller/AuthorController.java | 21 +++++------- .../novel/controller/BookController.java | 33 ++++++++---------- .../controller/FriendLinkController.java | 3 +- .../novel/controller/NewsController.java | 9 ++--- .../novel/controller/UserController.java | 21 +++++------- .../resources/static/javascript/ycUtils.js | 34 +++---------------- .../main/resources/templates/about/news.html | 2 +- .../templates/author/author_income.html | 2 +- .../author/author_income_detail.html | 2 +- .../templates/author/content_update.html | 6 ++-- .../resources/templates/author/index.html | 2 +- .../templates/author/index_list.html | 8 ++--- .../resources/templates/author/register.html | 2 +- .../templates/book/book_comment.html | 2 +- .../templates/book/book_content.html | 2 +- .../resources/templates/book/book_detail.html | 8 ++--- .../templates/book/book_ranking.html | 2 +- .../resources/templates/book/bookclass.html | 4 +-- .../src/main/resources/templates/index.html | 12 +++---- .../templates/mobile/book/book_detail.html | 4 +-- .../templates/mobile/book/book_ranking.html | 2 +- .../resources/templates/mobile/index.html | 4 +-- .../main/resources/templates/pay/index.html | 2 +- .../resources/templates/user/comment.html | 2 +- .../resources/templates/user/favorites.html | 2 +- .../templates/user/feedback_list.html | 2 +- .../templates/user/read_history.html | 2 +- .../resources/templates/user/set_name.html | 2 +- .../resources/templates/user/set_sex.html | 2 +- .../main/resources/templates/user/setup.html | 2 +- .../resources/templates/user/userinfo.html | 4 +-- 35 files changed, 95 insertions(+), 135 deletions(-) diff --git a/novel-crawl/src/main/java/com/java2nb/novel/controller/CrawlController.java b/novel-crawl/src/main/java/com/java2nb/novel/controller/CrawlController.java index da39ef9..fe0f8d8 100644 --- a/novel-crawl/src/main/java/com/java2nb/novel/controller/CrawlController.java +++ b/novel-crawl/src/main/java/com/java2nb/novel/controller/CrawlController.java @@ -9,10 +9,7 @@ import com.java2nb.novel.service.CrawlService; import com.java2nb.novel.vo.CrawlSingleTaskVO; import com.java2nb.novel.vo.CrawlSourceVO; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * @author Administrator @@ -39,7 +36,7 @@ public class CrawlController { /** * 爬虫源分页列表查询 * */ - @PostMapping("listCrawlByPage") + @GetMapping("listCrawlByPage") public ResultBean listCrawlByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize){ return ResultBean.ok(new PageInfo<>(BeanUtil.copyList(crawlService.listCrawlByPage(page,pageSize), CrawlSourceVO.class) @@ -71,7 +68,7 @@ public class CrawlController { /** * 单本采集任务分页列表查询 * */ - @PostMapping("listCrawlSingleTaskByPage") + @GetMapping("listCrawlSingleTaskByPage") public ResultBean listCrawlSingleTaskByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize){ return ResultBean.ok(new PageInfo<>(BeanUtil.copyList(crawlService.listCrawlSingleTaskByPage(page,pageSize), CrawlSingleTaskVO.class) @@ -81,8 +78,8 @@ public class CrawlController { /** * 删除采集任务 * */ - @PostMapping("delCrawlSingleTask") - public ResultBean delCrawlSingleTask(Long id){ + @DeleteMapping("delCrawlSingleTask/{id}") + public ResultBean delCrawlSingleTask(@PathVariable("id") Long id){ crawlService.delCrawlSingleTask(id); diff --git a/novel-crawl/src/main/resources/templates/crawl/crawlSingleTask_add.html b/novel-crawl/src/main/resources/templates/crawl/crawlSingleTask_add.html index 37e216a..b247301 100644 --- a/novel-crawl/src/main/resources/templates/crawl/crawlSingleTask_add.html +++ b/novel-crawl/src/main/resources/templates/crawl/crawlSingleTask_add.html @@ -96,7 +96,7 @@