From 5d01138621ba9388acbe1eaacda035aaf1231524 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Mon, 5 Oct 2020 15:36:05 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E8=A7=84=E8=8C=83=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 3 +++ .github/FUNDING.yml | 2 +- .../demo/wx/mp/error/ErrorController.java | 16 ++++++++-------- .../wx/mp/error/ErrorPageConfiguration.java | 14 +++++++------- src/main/resources/templates/error.html | 18 +++++++++--------- .../wx/mp/controller/BaseControllerTest.java | 10 +++++----- 6 files changed, 33 insertions(+), 30 deletions(-) diff --git a/.editorconfig b/.editorconfig index 775be5ba..54422918 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,3 +12,6 @@ insert_final_newline = true [*.md] trim_trailing_whitespace = false + +[*.yml] +indent_size = 2 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index af87f480..028c881d 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,4 @@ # These are supported funding model platforms -github: [binarywang] +github: [ binarywang ] custom: https://github.com/Wechat-Group/WxJava/blob/master/images/qrcodes/wepay.jpg?raw=true diff --git a/src/main/java/com/github/binarywang/demo/wx/mp/error/ErrorController.java b/src/main/java/com/github/binarywang/demo/wx/mp/error/ErrorController.java index 607ce8ae..b5517753 100644 --- a/src/main/java/com/github/binarywang/demo/wx/mp/error/ErrorController.java +++ b/src/main/java/com/github/binarywang/demo/wx/mp/error/ErrorController.java @@ -16,14 +16,14 @@ @RequestMapping("/error") public class ErrorController { - @GetMapping(value = "/404") - public String error404() { - return "error"; - } + @GetMapping(value = "/404") + public String error404() { + return "error"; + } - @GetMapping(value = "/500") - public String error500() { - return "error"; - } + @GetMapping(value = "/500") + public String error500() { + return "error"; + } } diff --git a/src/main/java/com/github/binarywang/demo/wx/mp/error/ErrorPageConfiguration.java b/src/main/java/com/github/binarywang/demo/wx/mp/error/ErrorPageConfiguration.java index 18fd1a16..21992073 100644 --- a/src/main/java/com/github/binarywang/demo/wx/mp/error/ErrorPageConfiguration.java +++ b/src/main/java/com/github/binarywang/demo/wx/mp/error/ErrorPageConfiguration.java @@ -16,12 +16,12 @@ */ @Component public class ErrorPageConfiguration implements ErrorPageRegistrar { - @Override - public void registerErrorPages(ErrorPageRegistry errorPageRegistry) { - errorPageRegistry.addErrorPages( - new ErrorPage(HttpStatus.NOT_FOUND, "/error/404"), - new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500") - ); - } + @Override + public void registerErrorPages(ErrorPageRegistry errorPageRegistry) { + errorPageRegistry.addErrorPages( + new ErrorPage(HttpStatus.NOT_FOUND, "/error/404"), + new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500") + ); + } } diff --git a/src/main/resources/templates/error.html b/src/main/resources/templates/error.html index 00055b96..d99cf0f9 100644 --- a/src/main/resources/templates/error.html +++ b/src/main/resources/templates/error.html @@ -2,15 +2,15 @@ 出错啦! - + -

-

-

-

-

-

-

+

+

+

+

+

+

+

- \ No newline at end of file + diff --git a/src/test/java/com/github/binarywang/demo/wx/mp/controller/BaseControllerTest.java b/src/test/java/com/github/binarywang/demo/wx/mp/controller/BaseControllerTest.java index b2877b71..aa29dec2 100644 --- a/src/test/java/com/github/binarywang/demo/wx/mp/controller/BaseControllerTest.java +++ b/src/test/java/com/github/binarywang/demo/wx/mp/controller/BaseControllerTest.java @@ -14,11 +14,11 @@ * @date 2019-06-14 */ public abstract class BaseControllerTest { - private static final String ROOT_URL = "http://127.0.0.1:8080/"; + private static final String ROOT_URL = "http://127.0.0.1:8080/"; - @BeforeTest - public void setup() { - RestAssured.baseURI = ROOT_URL; - } + @BeforeTest + public void setup() { + RestAssured.baseURI = ROOT_URL; + } }