package com.cm.common.article.controller.route.articlecontent;

import com.cm.common.constants.ISystemConstant;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: ArticleContentRouteController
 * @Description: 文章内容页面
 * @Author: WangGeng
 * @Date: 2020/4/3 16:11
 * @Version: 1.0
 **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "文章内容页面接口")
@Controller
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/articlecontent")
public class ArticleContentRouteController {

    @GetMapping("listarticlecontent")
    public ModelAndView listArticleContent(@RequestParam(name = "articleCategoryId", required = false) String articleCategoryId) {
        ModelAndView mv = new ModelAndView("articlecontent/list-articlecontent");
        mv.addObject("articleCategoryId", articleCategoryId);
        return mv;
    }

    @GetMapping("savearticlecontent")
    public ModelAndView saveArticleContent() {
        ModelAndView mv = new ModelAndView("articlecontent/save-articlecontent");
        return mv;
    }

    @GetMapping("updatearticlecontent")
    public ModelAndView updateArticleContent(@RequestParam("articleContentId") String articleContentId) {
        ModelAndView mv = new ModelAndView("articlecontent/update-articlecontent");
        mv.addObject("articleContentId", articleContentId);
        return mv;
    }

}
