File tree Expand file tree Collapse file tree 4 files changed +64
-120
lines changed
src/main/java/com/github/binarywang/demo/wx/mp Expand file tree Collapse file tree 4 files changed +64
-120
lines changed Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<groupId >org.springframework.boot</groupId >
8
8
<artifactId >spring-boot-starter-parent</artifactId >
9
- <version >1.5.6 .RELEASE</version >
9
+ <version >2.0.4 .RELEASE</version >
10
10
</parent >
11
11
12
12
<groupId >com.github.binarywang</groupId >
18
18
<description >Spring Boot Demo with wechat MP</description >
19
19
20
20
<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>
22
22
23
23
<maven .compiler.source>1.8</maven .compiler.source>
24
24
<maven .compiler.target>1.8</maven .compiler.target>
49
49
<version >${weixin-java-mp.version} </version >
50
50
</dependency >
51
51
52
+ <dependency >
53
+ <groupId >org.projectlombok</groupId >
54
+ <artifactId >lombok</artifactId >
55
+ <scope >provided</scope >
56
+ </dependency >
57
+
52
58
<!-- Testing Dependencies -->
53
59
<dependency >
54
60
<groupId >org.springframework.boot</groupId >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments