🎨 文章优选接口地址变更
This commit is contained in:
parent
b39112be30
commit
6a1bd7869a
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -95,12 +95,6 @@ public class ArticleController {
|
|||||||
return GlobalResultGenerator.genSuccessResult(map);
|
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")
|
@PostMapping("/thumbs-up")
|
||||||
public GlobalResult thumbsUp(@RequestBody ArticleThumbsUp articleThumbsUp) throws BaseApiException {
|
public GlobalResult thumbsUp(@RequestBody ArticleThumbsUp articleThumbsUp) throws BaseApiException {
|
||||||
Map map = articleThumbsUpService.thumbsUp(articleThumbsUp);
|
Map map = articleThumbsUpService.thumbsUp(articleThumbsUp);
|
||||||
|
Loading…
Reference in New Issue
Block a user