package cn.com.tenlion.buildingpictures.controller.route.picturestemplatearea;

import cn.com.tenlion.buildingpictures.service.picturestemplatearea.IPicturesTemplateAreaService;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.common.component.SecurityComponent;
import ink.wgink.interfaces.consts.ISystemConstant;
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: PicturesTemplateAreaRouteController
 * @Description: 图片套版模板区域
 * @Author: WenG
 * @Date: 2020-05-07 16:50
 * @Version: 1.0
 **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "图片套版模板区域接口")
@RestController
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/picturestemplatearea")
public class PicturesTemplateAreaRouteController extends DefaultBaseController {

    @Autowired
    private IPicturesTemplateAreaService picturesTemplateService;
    @Autowired
    private SecurityComponent securityComponent;

    @GetMapping("updatepicturestemplateareaall")
    public ModelAndView updatePicturesTemplateAreaAll(@RequestParam("picturesTemplateId") String picturesTemplateId) {
        ModelAndView mv = new ModelAndView("picturestemplatearea/update-picturestemplateareaall");
        mv.addObject("picturesTemplateId", picturesTemplateId);
        return mv;
    }

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

    @GetMapping("listpicturestemplatearea")
    public ModelAndView listPicturesTemplateArea() {
        ModelAndView mv = new ModelAndView("picturestemplatearea/list-picturestemplatearea");
        return mv;
    }

    @GetMapping("savepicturestemplatearea")
    public ModelAndView savePicturesTemplateArea(@RequestParam("picturesTemplateId") String picturesTemplateId) {
        ModelAndView mv = new ModelAndView("picturestemplatearea/save-picturestemplatearea");
        mv.addObject("picturesTemplateId", picturesTemplateId);
        return mv;
    }

    @GetMapping("updatepicturestemplatearea")
    public ModelAndView updatePicturesTemplateArea(@RequestParam("picturesTemplateAreaId") String picturesTemplateAreaId) {
        ModelAndView mv = new ModelAndView("picturestemplatearea/update-picturestemplatearea");
        mv.addObject("picturesTemplateAreaId", picturesTemplateAreaId);
        return mv;
    }

    @GetMapping("updatepicturestemplateareadata")
    public ModelAndView updatePicturesTemplateAreaData(@RequestParam("picturesTemplateAreaId") String picturesTemplateAreaId) {
        ModelAndView mv = new ModelAndView("picturestemplatearea/update-picturestemplateareadata");
        mv.addObject("picturesTemplateAreaId", picturesTemplateAreaId);
        return mv;
    }


}