Skip to content

Commit e5020a2

Browse files
author
[Lampart] Nguyen Van Hoai
committed
fix eureka
1 parent c7fcc03 commit e5020a2

File tree

20 files changed

+139
-59
lines changed

20 files changed

+139
-59
lines changed

pom.xml

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>com.example</groupId>
8-
<artifactId>DemoGraphQL</artifactId>
7+
<groupId>com.lampart-vn</groupId>
8+
<artifactId>api-gateway</artifactId>
99
<version>0.0.1-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

12-
<name>DemoGraphQL</name>
13-
<description>Demo project for Spring Boot</description>
12+
<name>Api gateway</name>
13+
<description>Demo project for microservices</description>
14+
<url>https://lampart-vn.com</url>
1415

1516
<parent>
1617
<groupId>org.springframework.boot</groupId>
1718
<artifactId>spring-boot-starter-parent</artifactId>
18-
<version>1.5.9.RELEASE</version>
19+
<version>1.5.19.RELEASE</version>
1920
<relativePath /> <!-- lookup parent from repository -->
2021
</parent>
2122

@@ -27,10 +28,29 @@
2728
<io.grpc.version>1.16.1</io.grpc.version>
2829
<os-maven-plugin.version>1.6.1</os-maven-plugin.version>
2930
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
31+
32+
<spring-cloud.version>Edgware.RELEASE</spring-cloud.version>
3033

3134
</properties>
3235

3336
<dependencies>
37+
<dependency>
38+
<groupId>org.springframework.boot</groupId>
39+
<artifactId>spring-boot-starter-actuator</artifactId>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.springframework.cloud</groupId>
43+
<artifactId>spring-cloud-starter-eureka</artifactId>
44+
<version>1.4.6.RELEASE</version>
45+
</dependency>
46+
47+
<dependency>
48+
<groupId>org.springframework.cloud</groupId>
49+
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
50+
<version>2.1.1.RELEASE</version>
51+
</dependency>
52+
53+
3454
<dependency>
3555
<groupId>org.springframework.boot</groupId>
3656
<artifactId>spring-boot-starter-data-jpa</artifactId>
@@ -99,9 +119,40 @@
99119
<groupId>org.projectlombok</groupId>
100120
<artifactId>lombok</artifactId>
101121
</dependency>
122+
123+
124+
<dependency>
125+
<groupId>com.google.guava</groupId>
126+
<artifactId>guava</artifactId>
127+
<version>23.6-jre</version>
128+
</dependency>
129+
<dependency>
130+
<groupId>org.apache.httpcomponents</groupId>
131+
<artifactId>httpcore</artifactId>
132+
<version>4.4.8</version>
133+
</dependency>
134+
135+
<dependency>
136+
<groupId>org.springframework.cloud</groupId>
137+
<artifactId>spring-cloud-starter-config</artifactId>
138+
<version>1.4.5.RELEASE</version>
139+
</dependency>
140+
102141

103142
</dependencies>
104-
143+
144+
<dependencyManagement>
145+
<dependencies>
146+
<dependency>
147+
<groupId>org.springframework.cloud</groupId>
148+
<artifactId>spring-cloud-dependencies</artifactId>
149+
<version>${spring-cloud.version}</version>
150+
<type>pom</type>
151+
<scope>import</scope>
152+
</dependency>
153+
</dependencies>
154+
</dependencyManagement>
155+
105156
<build>
106157
<extensions>
107158
<extension>

src/main/java/com/example/DemoGraphQL/DemoGraphQlApplication.java renamed to src/main/java/com/lampart/apigateway/Application.java

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
1-
package com.example.DemoGraphQL;
1+
package com.lampart.apigateway;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
import java.util.stream.Collectors;
26

3-
import com.example.DemoGraphQL.exception.GraphQLErrorAdapter;
4-
import com.example.DemoGraphQL.model.Author;
5-
import com.example.DemoGraphQL.model.Book;
6-
import com.example.DemoGraphQL.repository.AuthorRepository;
7-
import com.example.DemoGraphQL.repository.BookRepository;
8-
import com.example.DemoGraphQL.resolver.BookResolver;
9-
import com.example.DemoGraphQL.resolver.Mutation;
10-
import com.example.DemoGraphQL.resolver.Query;
11-
import graphql.ExceptionWhileDataFetching;
12-
import graphql.GraphQLError;
13-
import graphql.servlet.GraphQLErrorHandler;
147
import org.springframework.boot.CommandLineRunner;
158
import org.springframework.boot.SpringApplication;
169
import org.springframework.boot.autoconfigure.SpringBootApplication;
10+
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
1711
import org.springframework.context.annotation.Bean;
1812

19-
import java.util.ArrayList;
20-
import java.util.List;
21-
import java.util.stream.Collectors;
13+
import com.lampart.apigateway.exception.GraphQLErrorAdapter;
14+
import com.lampart.apigateway.model.Author;
15+
import com.lampart.apigateway.model.Book;
16+
import com.lampart.apigateway.repository.AuthorRepository;
17+
import com.lampart.apigateway.repository.BookRepository;
18+
import com.lampart.apigateway.resolver.BookResolver;
19+
import com.lampart.apigateway.resolver.Mutation;
20+
import com.lampart.apigateway.resolver.Query;
21+
22+
import graphql.ExceptionWhileDataFetching;
23+
import graphql.GraphQLError;
24+
import graphql.servlet.GraphQLErrorHandler;
2225

2326
@SpringBootApplication
24-
public class DemoGraphQlApplication {
27+
@EnableDiscoveryClient
28+
public class Application {
2529

2630
public static void main(String[] args) {
27-
SpringApplication.run(DemoGraphQlApplication.class, args);
31+
SpringApplication.run(Application.class, args);
2832
}
2933

3034
@Bean

src/main/java/com/example/DemoGraphQL/exception/BookNotFoundException.java renamed to src/main/java/com/lampart/apigateway/exception/BookNotFoundException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.DemoGraphQL.exception;
1+
package com.lampart.apigateway.exception;
22

33
import graphql.ErrorType;
44
import graphql.GraphQLError;

src/main/java/com/example/DemoGraphQL/exception/GraphQLErrorAdapter.java renamed to src/main/java/com/lampart/apigateway/exception/GraphQLErrorAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.DemoGraphQL.exception;
1+
package com.lampart.apigateway.exception;
22

33
import graphql.ErrorType;
44
import graphql.ExceptionWhileDataFetching;

src/main/java/com/example/DemoGraphQL/model/AuthData.java renamed to src/main/java/com/lampart/apigateway/model/AuthData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.DemoGraphQL.model;
1+
package com.lampart.apigateway.model;
22

33
public class AuthData {
44
private String authorization;

src/main/java/com/example/DemoGraphQL/model/Author.java renamed to src/main/java/com/lampart/apigateway/model/Author.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.DemoGraphQL.model;
1+
package com.lampart.apigateway.model;
22

33
import javax.persistence.*;
44

src/main/java/com/example/DemoGraphQL/model/Book.java renamed to src/main/java/com/lampart/apigateway/model/Book.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.DemoGraphQL.model;
1+
package com.lampart.apigateway.model;
22

33
import javax.persistence.*;
44

src/main/java/com/example/DemoGraphQL/model/Company.java renamed to src/main/java/com/lampart/apigateway/model/Company.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.DemoGraphQL.model;
1+
package com.lampart.apigateway.model;
22

33
public class Company {
44

src/main/java/com/example/DemoGraphQL/model/CompanyResolver.java renamed to src/main/java/com/lampart/apigateway/model/CompanyResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.DemoGraphQL.model;
1+
package com.lampart.apigateway.model;
22

33
import java.util.List;
44

src/main/java/com/example/DemoGraphQL/model/Department.java renamed to src/main/java/com/lampart/apigateway/model/Department.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.DemoGraphQL.model;
1+
package com.lampart.apigateway.model;
22

33
public class Department {
44

0 commit comments

Comments
 (0)