package xyz.wbsite.action.page.screen;

import xyz.wbsite.frame.base.Screen;
import xyz.wbsite.frame.base.LocalData;
import org.springframework.ui.Model;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 对应resources/templates/screen/index.ftl，访问对应页面时会执行该Screen。
 *
 * @author author
 * @version 0.0.1
 * @since 2020-11-01
 */
public class Index extends Screen {

    @Override
    public void exec(Model model, HttpServletRequest request, HttpServletResponse response) {

        // 获取配置
        HashMap<String, Object> prop = new HashMap<>();
        prop.put("open", true);//是否保持一个子菜单展开
        prop.put("coll", false);//左侧菜单是否收缩
        prop.put("tran", false);//是否展示动画
        prop.put("full", false);//是否全屏
        prop.put("active", LocalData.getActive());//当前激活环境
        model.addAttribute("prop", prop);
        model.addAttribute("token", LocalData.getToken());
    }
}
