🎨 文章优选接口地址变更

This commit is contained in:
ronger 2022-01-03 16:23:39 +08:00
parent b39112be30
commit 6a1bd7869a
2 changed files with 33 additions and 6 deletions

View File

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

View File

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