From 6a1bd7869a7e61c2654f9d49b4aac2fb6785e63b Mon Sep 17 00:00:00 2001 From: ronger Date: Mon, 3 Jan 2022 16:23:39 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=96=87=E7=AB=A0=E4=BC=98=E9=80=89?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/api/admin/AdminArticleController.java | 33 +++++++++++++++++++ .../web/api/article/ArticleController.java | 6 ---- 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/rymcu/forest/web/api/admin/AdminArticleController.java diff --git a/src/main/java/com/rymcu/forest/web/api/admin/AdminArticleController.java b/src/main/java/com/rymcu/forest/web/api/admin/AdminArticleController.java new file mode 100644 index 0000000..8d14194 --- /dev/null +++ b/src/main/java/com/rymcu/forest/web/api/admin/AdminArticleController.java @@ -0,0 +1,33 @@ +package com.rymcu.forest.web.api.admin; + +import com.rymcu.forest.core.result.GlobalResult; +import com.rymcu.forest.core.result.GlobalResultGenerator; +import com.rymcu.forest.entity.Article; +import com.rymcu.forest.service.ArticleService; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * Created on 2022/1/3 10:11. + * + * @author ronger + * @email ronger-x@outlook.com + */ +@RestController +@RequestMapping("/api/v1/admin/article") +public class AdminArticleController { + + @Resource + private ArticleService articleService; + + @PatchMapping("/update-perfect") + public GlobalResult updatePerfect(@RequestBody Article article) { + Map map = articleService.updatePerfect(article.getIdArticle(), article.getArticlePerfect()); + return GlobalResultGenerator.genSuccessResult(map); + } +} diff --git a/src/main/java/com/rymcu/forest/web/api/article/ArticleController.java b/src/main/java/com/rymcu/forest/web/api/article/ArticleController.java index 69a6d98..09a798d 100644 --- a/src/main/java/com/rymcu/forest/web/api/article/ArticleController.java +++ b/src/main/java/com/rymcu/forest/web/api/article/ArticleController.java @@ -95,12 +95,6 @@ public class ArticleController { return GlobalResultGenerator.genSuccessResult(map); } - @PatchMapping("/update-perfect") - public GlobalResult updatePerfect(@RequestBody Article article) { - Map map = articleService.updatePerfect(article.getIdArticle(), article.getArticlePerfect()); - return GlobalResultGenerator.genSuccessResult(map); - } - @PostMapping("/thumbs-up") public GlobalResult thumbsUp(@RequestBody ArticleThumbsUp articleThumbsUp) throws BaseApiException { Map map = articleThumbsUpService.thumbsUp(articleThumbsUp);