Launcher
This commit is contained in:
69
ms-launcher/pom.xml
Normal file
69
ms-launcher/pom.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<parent>
|
||||
<artifactId>ms-library</artifactId>
|
||||
<groupId>org.example</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ms-launcher</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.example</groupId>
|
||||
<artifactId>domain</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.example</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.example</groupId>
|
||||
<artifactId>infrastructure</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.example;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class LibraryApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(LibraryApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.example.configuration;
|
||||
|
||||
import org.example.adapters.BookJpaAdapter;
|
||||
import org.exemple.ports.api.BookServicePort;
|
||||
import org.exemple.ports.spi.BookPersistencePort;
|
||||
import org.exemple.service.BookServiceImpl;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class BookConfig {
|
||||
|
||||
@Bean
|
||||
public BookPersistencePort bookPersistence(){
|
||||
return new BookJpaAdapter();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BookServicePort bookService(){
|
||||
return new BookServiceImpl(bookPersistence());
|
||||
}
|
||||
}
|
||||
1
ms-launcher/src/main/resources/application.properties
Normal file
1
ms-launcher/src/main/resources/application.properties
Normal file
@@ -0,0 +1 @@
|
||||
server.port=8090
|
||||
7
ms-launcher/src/main/resources/data.sql
Normal file
7
ms-launcher/src/main/resources/data.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
insert into BOOK (id, title, description, price) values (1,'Clean Code','A handbook of agile Software',30);
|
||||
insert into BOOK (id, title, description, price) values (2,'Playing with Java Microservices','Microservices Book',20);
|
||||
insert into BOOK (id, title, description, price) values (3,'Spring in actions','spring Book',25);
|
||||
insert into BOOK (id, title, description, price) values (4,'Head First java','java book',25);
|
||||
insert into BOOK (id, title, description, price) values (5,'Hands-on spring boot','spring boot book',40);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user