1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package com.caimei.www.controller.unlimited;
- import com.caimei.www.controller.BaseController;
- import com.caimei.www.pojo.JsonModel;
- import com.caimei.www.pojo.page.BaseLink;
- import com.caimei.www.service.ArticleService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
- import java.util.List;
- /**
- * Description
- *
- * @author : Charles
- * @date : 2020/7/31
- */
- @Controller
- public class ArticleController extends BaseController {
- private static final String ARTICLE_LIST_PATH = "article/list";
- private static final String ARTICLE_DETAIL_PATH = "article/detail";
- private ArticleService articleService;
- @Autowired
- public void setArticleService(ArticleService articleService) {
- this.articleService = articleService;
- }
- /**
- * 文章列表页
- */
- @GetMapping("/article/list.html")
- public String articleList() {
- return ARTICLE_LIST_PATH;
- }
- /**
- * 文章详情页
- */
- @GetMapping("/article/detail.html")
- public String articleDetail() {
- return ARTICLE_DETAIL_PATH;
- }
- /**
- * 获取文章热门标签
- */
- @GetMapping("/article/labels")
- @ResponseBody
- public JsonModel<List<BaseLink>> getArticleLabels() {
- return articleService.getArticleLabels();
- }
- }
|