package com.lemon.lifecenter.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.lemon.lifecenter.common.LifeCenterController;
import com.lemon.lifecenter.common.LifeCenterSessionController;

@Controller
@RequestMapping("/mobile")
public class MobileMenuController extends LifeCenterController {
    
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    
    @RequestMapping("/menu")
    public ModelAndView menu(
            HttpServletRequest request, HttpServletResponse response) {
        String patientId = LifeCenterSessionController.getSession(request, "sesMId");
        String roomId = LifeCenterSessionController.getSession(request, "sesMRoomNum");
        String patientName = LifeCenterSessionController.getSession(request, "sesMName");
        
        ModelAndView mv = setMobileMV("menu/menu");
        mv.addObject("patientId", patientId);
        mv.addObject("roomId", roomId);
        mv.addObject("name", patientName);
        return mv;
    }
    
    @RequestMapping("/guide")
    public ModelAndView guide(
            HttpServletRequest request, HttpServletResponse response) {
        ModelAndView mv = setMobileMV("menu/guide");
        return mv;
    }
}