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);