Skip to content

Commit 57aa1b3

Browse files
committed
added example code for spring data rest with Springfox and Swagger
1 parent a454c81 commit 57aa1b3

File tree

16 files changed

+527
-3
lines changed

16 files changed

+527
-3
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include 'spring-data-rest-associations'
22
include 'feign-with-spring-data-rest'
3+
include 'spring-data-rest-springfox'
34

spring-data-rest-associations/src/main/java/com/example/demo/manytoone/ManyToOneAddress.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class ManyToOneAddress {
1313
private String street;
1414

1515
@ManyToOne
16-
private ManyToOneAddress customer;
16+
private ManyToOneCustomer customer;
1717

1818
public Long getId() {
1919
return id;
@@ -31,11 +31,11 @@ public void setStreet(String street) {
3131
this.street = street;
3232
}
3333

34-
public ManyToOneAddress getCustomer() {
34+
public ManyToOneCustomer getCustomer() {
3535
return customer;
3636
}
3737

38-
public void setCustomer(ManyToOneAddress customer) {
38+
public void setCustomer(ManyToOneCustomer customer) {
3939
this.customer = customer;
4040
}
4141
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.gradle
2+
/build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
5+
### STS ###
6+
.apt_generated
7+
.classpath
8+
.factorypath
9+
.project
10+
.settings
11+
.springBeans
12+
13+
### IntelliJ IDEA ###
14+
.idea
15+
*.iws
16+
*.iml
17+
*.ipr
18+
19+
### NetBeans ###
20+
nbproject/private/
21+
build/
22+
nbbuild/
23+
dist/
24+
nbdist/
25+
.nb-gradle/
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
buildscript {
2+
ext {
3+
springBootVersion = '1.5.4.RELEASE'
4+
}
5+
repositories {
6+
mavenCentral()
7+
}
8+
dependencies {
9+
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10+
}
11+
}
12+
13+
apply plugin: 'java'
14+
apply plugin: 'eclipse'
15+
apply plugin: 'org.springframework.boot'
16+
17+
version = '0.0.1-SNAPSHOT'
18+
sourceCompatibility = 1.8
19+
20+
repositories {
21+
mavenLocal()
22+
mavenCentral()
23+
}
24+
25+
26+
dependencies {
27+
compile('org.springframework.boot:spring-boot-starter-data-jpa')
28+
compile('org.springframework.boot:spring-boot-starter-data-rest')
29+
compile('io.springfox:springfox-data-rest:2.7.0')
30+
compile('io.springfox:springfox-swagger2:2.7.0')
31+
compile('io.springfox:springfox-swagger-ui:2.7.0')
32+
compile('com.h2database:h2:1.4.196')
33+
testCompile('org.springframework.boot:spring-boot-starter-test')
34+
}
35+
36+
bootRun{
37+
jvmArgs = ["-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"]
38+
}
53.4 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-bin.zip

spring-data-rest-springfox/gradlew

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spring-data-rest-springfox/gradlew.bat

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)