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

import com.cm.common.base.AbstractController;
import com.cm.common.component.SecurityComponent;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.service.bigdatatemplatearea.IBigdataTemplateAreaService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
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.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

/**
 * @ClassName: BigdataTemplateAreaRouteController
 * @Description: 大数据展示模板区域
 * @Author: WenG
 * @Date: 2020-05-07 16:50
 * @Version: 1.0
 **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "大数据展示模板区域接口")
@RestController
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/bigdatatemplatearea")
public class BigdataTemplateAreaRouteController extends AbstractController {

    @Autowired
    private IBigdataTemplateAreaService bigdataTemplateService;
    @Autowired
    private SecurityComponent securityComponent;

    @GetMapping("savebigdatatemplateareajson")
    public ModelAndView saveBigdataTemplateAreaJson() {
        Map<String, Object> params = requestParams();
        ModelAndView mv = new ModelAndView("bigdatatemplatearea/save-bigdatatemplatearea-json");
        for(Map.Entry<String, Object> map : params.entrySet()) {
            mv.addObject(map.getKey(), map.getValue());
        }
        return mv;
    }

    @GetMapping("listbigdatatemplatearea")
    public ModelAndView listBigdataTemplateArea() {
        ModelAndView mv = new ModelAndView("bigdatatemplatearea/list-bigdatatemplatearea");
        return mv;
    }

    @GetMapping("savebigdatatemplatearea")
    public ModelAndView saveBigdataTemplateArea(@RequestParam("bigdataTemplateId") String bigdataTemplateId) {
        ModelAndView mv = new ModelAndView("bigdatatemplatearea/save-bigdatatemplatearea");
        mv.addObject("bigdataTemplateId", bigdataTemplateId);
        return mv;
    }

    @GetMapping("updatebigdatatemplatearea")
    public ModelAndView updateBigdataTemplateArea(@RequestParam("bigdataTemplateAreaId") String bigdataTemplateAreaId) {
        ModelAndView mv = new ModelAndView("bigdatatemplatearea/update-bigdatatemplatearea");
        mv.addObject("bigdataTemplateAreaId", bigdataTemplateAreaId);
        return mv;
    }


}