master
parent
9f4fab8e15
commit
d71765cdda
@ -0,0 +1,42 @@
|
|||||||
|
package com.jingcheng.cms.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jingcheng.cms.service.ArticleSerive;
|
||||||
|
import com.jingcheng.cms.util.AjaxResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/article")
|
||||||
|
public class ArticleController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ArticleSerive articleSerive;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增或者更新热门
|
||||||
|
* @param jsonObject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/save-article")
|
||||||
|
public AjaxResult saveArticle(@RequestBody JSONObject jsonObject) {
|
||||||
|
AjaxResult ajaxResult = articleSerive.saveArticle(jsonObject);
|
||||||
|
return ajaxResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取热门标签分页
|
||||||
|
* @param jsonObject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/article-list-by-condition")
|
||||||
|
public AjaxResult getArticleListByPage(@RequestBody JSONObject jsonObject) {
|
||||||
|
AjaxResult ajaxResult = new AjaxResult();
|
||||||
|
JSONObject pageJson= articleSerive.getArticleListByPage(jsonObject);
|
||||||
|
ajaxResult.setData(pageJson);
|
||||||
|
return ajaxResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue