Skip to content

Commit 7c15eaf

Browse files
committed
spring boot版本升级2.0.4
1 parent fd9fb68 commit 7c15eaf

File tree

4 files changed

+64
-120
lines changed

4 files changed

+64
-120
lines changed

pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>1.5.6.RELEASE</version>
9+
<version>2.0.4.RELEASE</version>
1010
</parent>
1111

1212
<groupId>com.github.binarywang</groupId>
@@ -18,7 +18,7 @@
1818
<description>Spring Boot Demo with wechat MP</description>
1919

2020
<properties>
21-
<weixin-java-mp.version>3.1.0</weixin-java-mp.version>
21+
<weixin-java-mp.version>3.1.6.BETA</weixin-java-mp.version>
2222

2323
<maven.compiler.source>1.8</maven.compiler.source>
2424
<maven.compiler.target>1.8</maven.compiler.target>
@@ -49,6 +49,12 @@
4949
<version>${weixin-java-mp.version}</version>
5050
</dependency>
5151

52+
<dependency>
53+
<groupId>org.projectlombok</groupId>
54+
<artifactId>lombok</artifactId>
55+
<scope>provided</scope>
56+
</dependency>
57+
5258
<!-- Testing Dependencies -->
5359
<dependency>
5460
<groupId>org.springframework.boot</groupId>

src/main/java/com/github/binarywang/demo/wx/mp/controller/WxErrorController.java

Lines changed: 0 additions & 118 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.github.binarywang.demo.wx.mp.error;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.web.bind.annotation.GetMapping;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
7+
/**
8+
* <pre>
9+
* 出错页面控制器
10+
* Created by Binary Wang on 2018/8/25.
11+
* </pre>
12+
*
13+
* @author <a href="https://github.com/binarywang">Binary Wang</a>
14+
*/
15+
@Controller
16+
@RequestMapping("/error")
17+
public class ErrorController {
18+
19+
@GetMapping(value = "/404")
20+
public String error404() {
21+
return "error";
22+
}
23+
24+
@GetMapping(value = "/500")
25+
public String error500() {
26+
return "error";
27+
}
28+
29+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.github.binarywang.demo.wx.mp.error;
2+
3+
import org.springframework.boot.web.server.ErrorPage;
4+
import org.springframework.boot.web.server.ErrorPageRegistrar;
5+
import org.springframework.boot.web.server.ErrorPageRegistry;
6+
import org.springframework.http.HttpStatus;
7+
import org.springframework.stereotype.Component;
8+
9+
/**
10+
* <pre>
11+
* 配置错误状态与对应访问路径
12+
* Created by Binary Wang on 2018/8/25.
13+
* </pre>
14+
*
15+
* @author <a href="https://github.com/binarywang">Binary Wang</a>
16+
*/
17+
@Component
18+
public class ErrorPageConfiguration implements ErrorPageRegistrar {
19+
@Override
20+
public void registerErrorPages(ErrorPageRegistry errorPageRegistry) {
21+
errorPageRegistry.addErrorPages(
22+
new ErrorPage(HttpStatus.NOT_FOUND, "/error/404"),
23+
new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500")
24+
);
25+
}
26+
27+
}

0 commit comments

Comments
 (0)