File tree 6 files changed +91
-0
lines changed
src/main/java/cn/iocoder/springboot/lab56
6 files changed +91
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
+ <parent >
6
+ <groupId >org.springframework.boot</groupId >
7
+ <artifactId >spring-boot-starter-parent</artifactId >
8
+ <version >2.2.2.RELEASE</version >
9
+ <relativePath /> <!-- lookup parent from repository -->
10
+ </parent >
11
+ <modelVersion >4.0.0</modelVersion >
12
+
13
+ <artifactId >lab-56-demo01</artifactId >
14
+
15
+ <dependencies >
16
+ <!-- 实现对 Spring MVC 的自动化配置 -->
17
+ <dependency >
18
+ <groupId >org.springframework.boot</groupId >
19
+ <artifactId >spring-boot-starter-web</artifactId >
20
+ </dependency >
21
+ </dependencies >
22
+
23
+ </project >
Original file line number Diff line number Diff line change
1
+ package cn .iocoder .springboot .lab56 ;
2
+
3
+ import org .springframework .boot .SpringApplication ;
4
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+
6
+ @ SpringBootApplication
7
+ public class Demo01Application {
8
+
9
+ public static void main (String [] args ) {
10
+ System .setProperty ("server.port" , "18080" ); // 端口 18080
11
+ SpringApplication .run (Demo01Application .class , args );
12
+ }
13
+
14
+ }
Original file line number Diff line number Diff line change
1
+ package cn .iocoder .springboot .lab56 ;
2
+
3
+ import org .springframework .boot .SpringApplication ;
4
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+
6
+ @ SpringBootApplication
7
+ public class Demo02Application {
8
+
9
+ public static void main (String [] args ) {
10
+ System .setProperty ("server.port" , "28080" ); // 端口 28080
11
+ SpringApplication .run (Demo02Application .class , args );
12
+ }
13
+
14
+ }
Original file line number Diff line number Diff line change
1
+ package cn .iocoder .springboot .lab56 .controller ;
2
+
3
+ import org .springframework .beans .factory .annotation .Value ;
4
+ import org .springframework .web .bind .annotation .GetMapping ;
5
+ import org .springframework .web .bind .annotation .RequestMapping ;
6
+ import org .springframework .web .bind .annotation .RestController ;
7
+
8
+ @ RestController
9
+ @ RequestMapping ("/demo" )
10
+ public class DemoController {
11
+
12
+ @ Value ("${server.port}" )
13
+ private Integer serverPort ;
14
+
15
+ @ GetMapping ("/echo" )
16
+ public String echo () {
17
+ return "echo:" + serverPort ;
18
+ }
19
+
20
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
+ <parent >
6
+ <artifactId >labs-parent</artifactId >
7
+ <groupId >cn.iocoder.springboot.labs</groupId >
8
+ <version >1.0-SNAPSHOT</version >
9
+ </parent >
10
+ <modelVersion >4.0.0</modelVersion >
11
+
12
+ <artifactId >lab-56</artifactId >
13
+ <packaging >pom</packaging >
14
+ <modules >
15
+ <module >lab-56-demo01</module >
16
+ </modules >
17
+
18
+
19
+ </project >
Original file line number Diff line number Diff line change 88
88
<module >labx-19</module >
89
89
<module >labx-20</module >
90
90
<module >lab-55</module >
91
+ <module >lab-56</module >
91
92
92
93
</modules >
93
94
You can’t perform that action at this time.
0 commit comments