Skip to content

Commit

Permalink
🎨 规范统一代码格式
Browse files Browse the repository at this point in the history
  • Loading branch information
binarywang committed Oct 5, 2020
1 parent a58e8a0 commit 5d01138
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
);
}

}
18 changes: 9 additions & 9 deletions src/main/resources/templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>出错啦!</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p th:text="'Url:' + ${URL}" />
<p th:text="'Error:' + ${error}" />
<p th:text="'Message:' + ${message}" />
<p th:text="'Exception:' + ${exception}" />
<p th:text="'Path:' + ${path}" />
<p th:text="'Status:' + ${status}" />
<p th:text="'Timestamp:' + ${timestamp}" />
<p th:text="'Url:' + ${URL}"/>
<p th:text="'Error:' + ${error}"/>
<p th:text="'Message:' + ${message}"/>
<p th:text="'Exception:' + ${exception}"/>
<p th:text="'Path:' + ${path}"/>
<p th:text="'Status:' + ${status}"/>
<p th:text="'Timestamp:' + ${timestamp}"/>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}

0 comments on commit 5d01138

Please sign in to comment.