package com.lightinit.hsdatashow.controller;
import com.lightinit.hsdatashow.common.DateUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

/**
 * Created by Mr.Yao on 2017/3/22.
 */
@Controller
public class HomeController {
    @RequestMapping(method = RequestMethod.GET)
    public String printWelcome(ModelMap model, HttpServletRequest request) {
//        return "index";
        return  "admin/account/login";
    }
    @RequestMapping(value = "main.action",method = RequestMethod.GET)
    public String printMain(ModelMap model) {
        String begin= DateUtils.weekBeginDate(new Date());
        String end=DateUtils.weekEndDate(new Date());
        int year=DateUtils.YearOfDate();
        int month=DateUtils.MonthOfDate();
        model.addAttribute("mbegin",begin);
        model.addAttribute("mend",end);
        model.addAttribute("myear",year);
        model.addAttribute("mmonth",month);
        return "main";
    }
}
