package com.house365.web.wechat;

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

/**
 * Description
 * <p>
 * Created by 365 on 2017/3/7 0007.
 */
@Controller
@EnableAutoConfiguration
@RequestMapping("/error")
public class ErrorController {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    @RequestMapping("/403")
    public String customerIndex() {
        return "wechat/403";
    }

    @RequestMapping("/405")
    public ModelAndView customerDetail(String title) {
        ModelAndView view = new ModelAndView();
        view.setViewName("wechat/405");
        if (title.equals("customer")) {
            title = "客户已无效";
        } else if (title.equals("notice")) {
            title = "公告已删除";
        }
        view.addObject("title", title);
        return view;
    }
}
