返回码500BUG修复

This commit is contained in:
tanghc
2019-04-03 19:07:44 +08:00
parent 9dc60a9b53
commit 8473be825f
2 changed files with 4 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import com.gitee.sop.gatewaycommon.result.ResultExecutor;
import com.netflix.zuul.context.RequestContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -27,6 +28,7 @@ public class ZuulErrorController implements ErrorController {
@ResponseBody
public Object error() {
RequestContext ctx = RequestContext.getCurrentContext();
ctx.setResponseStatusCode(HttpStatus.OK.value());
Throwable throwable = ctx.getThrowable();
return this.buildResult(throwable);
}

View File

@@ -28,7 +28,7 @@ public class AlipayController {
StoryVO storyVO = new StoryVO();
storyVO.id = 1L;
storyVO.name = "白雪公主";
storyVO.gmtCreate = new Date();
storyVO.gmt_create = new Date();
return storyVO;
}
@@ -41,6 +41,6 @@ public class AlipayController {
public static class StoryVO {
private Long id;
private String name;
private Date gmtCreate;
private Date gmt_create;
}
}