package ink.wgink.module.map.controller.route.grid;

import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.properties.map.BaiduMapProperties;
import io.swagger.annotations.Api;
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.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @ClassName: GridRouteController
 * @Description: 网格路由
 * @Author: wanggeng
 * @Date: 2021/10/20 9:33 上午
 * @Version: 1.0
 */
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "网格")
@Controller
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/grid")
public class GridRouteController {

    @Autowired
    private BaiduMapProperties baiduMapProperties;

    @GetMapping("save")
    public ModelAndView save() {
        ModelAndView mv = new ModelAndView("grid/grid/default/save");
        mv.addObject("baiduMapProperties", baiduMapProperties);
        return mv;
    }

    @GetMapping("update")
    public ModelAndView update() {
        ModelAndView mv = new ModelAndView("grid/grid/default/update");
        mv.addObject("baiduMapProperties", baiduMapProperties);
        return mv;
    }

    @GetMapping("get")
    public ModelAndView get() {
        ModelAndView mv = new ModelAndView("grid/grid/default/get");
        mv.addObject("baiduMapProperties", baiduMapProperties);
        return mv;
    }

    @GetMapping("show-grid")
    public ModelAndView showGrid() {
        ModelAndView mv = new ModelAndView("grid/grid/default/show-grid");
        mv.addObject("baiduMapProperties", baiduMapProperties);
        return mv;
    }

    @GetMapping("list")
    public ModelAndView list() {
        return new ModelAndView("grid/grid/default/list");
    }

    @GetMapping("list-select")
    public ModelAndView listSelect() {
        return new ModelAndView("grid/grid/default/list-select");
    }

}
