Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

feature: add product module #59

Merged
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ To manage the microservices of the application, you need to first launch the mod
Then launch the module api_gateway and the module mediator.
You can have access to the Dashboard of the eureka_server at http://localhost:8761. You will see all the microservices.

### For the endpoints documentation
You can access the documentation of each endpoints after launching at this address : http://<localhost:service port>/swagger-ui/index.html#. This page also allow you to try the different endpoints of the concerned service.


# terminal

Expand Down
13 changes: 3 additions & 10 deletions Server/.jpb/jpb-settings.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DatabaseMigrationSettings" lastSelectedDirectory="shop/src/main/resources/db/migration" />
<component name="DatabaseMigrationSettings" lastSelectedDirectory="shop\product\src\main\resources\db\migration" />
<component name="PersistenceUnitSettings">
<persistence-units>
<persistence-unit name="Default">
<persistence-unit moduleName="shop" name="Default">
<packages>
<package value="com.cashmanager.server.product" />
<component name="DatabaseMigrationSettings" lastSelectedDirectory="bank/database/src/main/resources/db/migration" />
<component name="PersistenceUnitSettings">
<persistence-units>
<persistence-unit moduleName="database" name="Default">
<packages>
<package value="com.cashmanager.server.database" />
<package value="com.cashmanager.server.shop" />
</packages>
</persistence-unit>
</persistence-units>
</component>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest()
@SpringBootTest
class DatabaseApplicationTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,16 @@ public class ProductDto {
private UUID id;
private String name;
private BigDecimal price;
private int stock;

public ProductDto(UUID id, String name, BigDecimal price, int stock) {
this.id = id;
this.name = name;
this.price = price;
this.stock = stock;
}

public ProductDto() {

}
}
1 change: 1 addition & 0 deletions Server/init-shop-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
CREATE USER "$SHOP_USER" WITH PASSWORD '$SHOP_PASSWORD';
CREATE DATABASE "$SHOP_DB";
GRANT ALL PRIVILEGES ON DATABASE "$SHOP_DB" TO "$SHOP_USER";
ALTER DATABASE "$SHOP_DB" OWNER TO "$SHOP_USER";
EOSQL
73 changes: 12 additions & 61 deletions Server/shop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,74 +10,25 @@

<artifactId>shop</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>product</name>
<description>product</description>
<name>shop</name>
<description>shop</description>
<properties>
<java.version>17</java.version>
</properties>
<packaging>pom</packaging>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<modules>
<module>shop_database</module>
<module>product</module>
</modules>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-docker-compose</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<groupId>com.cashmanager.server</groupId>
<artifactId>common</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>paketobuildpacks/builder-jammy-base:latest</builder>
</image>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

</project>
33 changes: 33 additions & 0 deletions Server/shop/product/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
Binary file not shown.
2 changes: 2 additions & 0 deletions Server/shop/product/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
Loading
Loading