Skip to content

Commit 03f7e66

Browse files
zihongzihong
zihong
authored and
zihong
committed
测试自定义starter
1 parent 538be77 commit 03f7e66

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

SpringBoot-Builder-Docker/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ tasks.withType(JavaCompile) {
2323
options.encoding = 'UTF-8'
2424
}
2525
dependencies {
26+
compile group: 'com.dashuai.learning', name: 'SpringBoot-Test-Starter', version: '1.0.0'
2627
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.0.4.RELEASE'
2728
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.0.4.RELEASE'
2829
}

SpringBoot-Builder-Docker/src/main/java/com/dashuai/learning/docker/DockerApplication.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package com.dashuai.learning.docker;
22

3+
import com.dashuai.learning.autostarter.service.ExampleService;
4+
import org.springframework.beans.factory.annotation.Autowired;
35
import org.springframework.boot.SpringApplication;
46
import org.springframework.boot.autoconfigure.SpringBootApplication;
7+
import org.springframework.web.bind.annotation.PathVariable;
58
import org.springframework.web.bind.annotation.RequestMapping;
69
import org.springframework.web.bind.annotation.RestController;
710

@@ -11,11 +14,18 @@
1114
@RestController
1215
public class DockerApplication {
1316

17+
@Autowired
18+
ExampleService exampleService;
1419
@RequestMapping("/")
1520
public String getDate(){
1621
return new Date().toString();
1722
}
1823

24+
@RequestMapping("/auto/{name}")
25+
public String getWap(@PathVariable String name){
26+
return exampleService.wrap(name);
27+
}
28+
1929
public static void main(String[] args) {
2030
SpringApplication.run(DockerApplication.class, args);
2131
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
example.service.enable=true
2+
example.service.prefix=web
3+
example.service.suffix=aaa

0 commit comments

Comments
 (0)