Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions config-service/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions config-service/Jenkinsfile

This file was deleted.

44 changes: 0 additions & 44 deletions config-service/pom.xml

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions config-service/src/main/resources/bootstrap.yml

This file was deleted.

11 changes: 0 additions & 11 deletions config-service/src/main/resources/config/department-service.yml

This file was deleted.

11 changes: 0 additions & 11 deletions config-service/src/main/resources/config/discovery-service.yml

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions config-service/src/main/resources/config/employee-service.yml

This file was deleted.

37 changes: 0 additions & 37 deletions config-service/src/main/resources/config/gateway-service.yml

This file was deleted.

11 changes: 0 additions & 11 deletions config-service/src/main/resources/config/organization-service.yml

This file was deleted.

23 changes: 0 additions & 23 deletions config-service/src/main/resources/config/proxy-service.yml

This file was deleted.

8 changes: 8 additions & 0 deletions department-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM openjdk:8-jre-alpine
ENV APP_FILE department-service-1.0-SNAPSHOT.jar
ENV APP_HOME /usr/apps
EXPOSE 8080
COPY target/$APP_FILE $APP_HOME/
WORKDIR $APP_HOME
ENTRYPOINT ["sh", "-c"]
CMD ["exec java -jar $APP_FILE"]
30 changes: 21 additions & 9 deletions department-service/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
Expand All @@ -18,7 +20,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.RC1</version>
<version>Finchley.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -28,11 +30,17 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<artifactId>spring-cloud-starter-kubernetes</artifactId>
<version>0.3.0.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-kubernetes-ribbon</artifactId>
<version>0.3.0.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
Expand All @@ -50,14 +58,18 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
</dependencies>

Expand All @@ -69,5 +81,5 @@
</plugin>
</plugins>
</build>

</project>
3 changes: 3 additions & 0 deletions department-service/src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

import pl.piomin.services.department.model.Department;
import pl.piomin.services.department.repository.DepartmentRepository;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
Expand All @@ -18,9 +17,11 @@
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableMongoRepositories
@EnableSwagger2
//@RibbonClient(name = "employee")
public class DepartmentApplication {

public static void main(String[] args) {
SpringApplication.run(DepartmentApplication.class, args);
}
Expand All @@ -35,14 +36,10 @@ public Docket swaggerPersonApi10() {
.apiInfo(new ApiInfoBuilder().version("1.0").title("Department API").description("Documentation Department API v1.0").build());
}

@Bean
DepartmentRepository repository() {
DepartmentRepository repository = new DepartmentRepository();
repository.add(new Department(1L, "Development"));
repository.add(new Department(1L, "Operations"));
repository.add(new Department(2L, "Development"));
repository.add(new Department(2L, "Operations"));
return repository;
}
// @Bean
// @LoadBalanced
// RestTemplate restTemplate() {
// return new RestTemplate();
// }

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import pl.piomin.services.department.model.Employee;

@FeignClient(name = "employee-service")
@FeignClient(name = "employee")
public interface EmployeeClient {

@GetMapping("/department/{departmentId}")
List<Employee> findByDepartment(@PathVariable("departmentId") Long departmentId);
List<Employee> findByDepartment(@PathVariable("departmentId") String departmentId);

}
Loading