package cn.momia.common.webapp.controller;

import cn.momia.common.api.http.MomiaHttpResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/error")
public class ErrorController {
    @RequestMapping(value = "/400")
    public MomiaHttpResponse badRequest() {
        return MomiaHttpResponse.BAD_REQUEST;
    }

    @RequestMapping(value = "/403")
    public MomiaHttpResponse forbidden() {
        return MomiaHttpResponse.FORBIDDEN;
    }

    @RequestMapping(value = "/404")
    public MomiaHttpResponse notFound() {
        return MomiaHttpResponse.NOT_FOUND;
    }

    @RequestMapping(value = "/405")
    public MomiaHttpResponse methodNotAllowed() {
        return MomiaHttpResponse.METHOD_NOT_ALLOWED;
    }

    @RequestMapping(value = "/500")
    public MomiaHttpResponse internalServerError() {
        return MomiaHttpResponse.INTERNAL_SERVER_ERROR;
    }
}

@@ -286,16 +286,39 @@
 troller 
+extends BaseController 
 %7B%0A    @R

add base controller