package com.cm.common.controller.route.templateconfig;

import com.cm.common.base.AbstractController;
import com.cm.common.component.SecurityComponent;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.service.templateconfig.ITemplateConfigService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

/**
 * @ClassName: TemplateRecordController
 * @Description: 模板页面
 * @Author: WenG
 * @Date: 2020-05-07 16:50
 * @Version: 1.0
 **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "模板页面接口")
@RestController
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/templateconfig")
public class TemplateConfigRouteController extends AbstractController {

    @Autowired
    private ITemplateConfigService templateConfigService;
    @Autowired
    private SecurityComponent securityComponent;

    @GetMapping("listtemplateconfig")
    public ModelAndView listTemplateConfig() {
        ModelAndView mv = new ModelAndView("templateconfig/list-templateconfig");
        return mv;
    }

    @GetMapping("savetemplateconfig")
    public ModelAndView saveTemplateConfig() {
        ModelAndView mv = new ModelAndView("templateconfig/save-templateconfig");
        return mv;
    }

    @GetMapping("updatetemplateconfig")
    public ModelAndView updateTemplateConfig(@RequestParam("templateConfigId") String templateConfigId) {
        ModelAndView mv = new ModelAndView("templateconfig/update-templateconfig");
        mv.addObject("templateConfigId", templateConfigId);
        return mv;
    }

    @GetMapping("updatetemplateconfigcontent")
    public ModelAndView updateTemplateconfigContent(@RequestParam("templateConfigId") String templateConfigId, @RequestParam("templateAllGenerate") String templateAllGenerate, @RequestParam("templateCode") String templateCode) {
        ModelAndView mv = new ModelAndView("templateconfig/update_templateconfig_content");
        mv.addObject("templateConfigId", templateConfigId);
        mv.addObject("templateAllGenerate", templateAllGenerate);
        mv.addObject("templateCode", templateCode);
        return mv;
    }

}