Skip to content

Commit 3d58057

Browse files
committed
Add APIs project & Utils Project
- store-api project the shared Springy store contracts DTOs and API Interfaces. - store-util project is the shared functionality across microservices.
1 parent 35d9416 commit 3d58057

File tree

23 files changed

+528
-50
lines changed

23 files changed

+528
-50
lines changed

product-composite-service/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<groupId>com.siriusxi.ms.store</groupId>
77
<artifactId>store-chassis</artifactId>
88
<version>0.0.1-SNAPSHOT</version>
9-
<relativePath>/</relativePath> <!-- lookup parent from repository -->
109
</parent>
1110

1211
<artifactId>product-composite-service</artifactId>

product-service/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<groupId>com.siriusxi.ms.store</groupId>
77
<artifactId>store-chassis</artifactId>
88
<version>0.0.1-SNAPSHOT</version>
9-
<relativePath>/</relativePath> <!-- lookup parent from repository -->
109
</parent>
1110

1211
<artifactId>product-service</artifactId>

recommendation-service/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<groupId>com.siriusxi.ms.store</groupId>
77
<artifactId>store-chassis</artifactId>
88
<version>0.0.1-SNAPSHOT</version>
9-
<relativePath>/</relativePath> <!-- lookup parent from repository -->
109
</parent>
1110

1211
<artifactId>recommendation-service</artifactId>

review-service/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<groupId>com.siriusxi.ms.store</groupId>
77
<artifactId>store-chassis</artifactId>
88
<version>0.0.1-SNAPSHOT</version>
9-
<relativePath>/</relativePath> <!-- lookup parent from repository -->
109
</parent>
1110

1211
<artifactId>review-service</artifactId>

store-api/pom.xml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.siriusxi.ms.store</groupId>
8+
<artifactId>store-api</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<packaging>jar</packaging>
11+
12+
<name>Springy Store APIs</name>
13+
<description>Project that define all Springy Store DTOs and REST APIs contracts</description>
14+
15+
<properties>
16+
<java.version>14</java.version>
17+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
19+
<!-- Libraries versions -->
20+
<spring.boot.dependencies.version>2.2.3.BUILD-SNAPSHOT</spring.boot.dependencies.version>
21+
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
22+
<maven.surefire.plugin.version>3.0.0-M4</maven.surefire.plugin.version>
23+
<maven.failsafe.plugin.version>3.0.0-M4</maven.failsafe.plugin.version>
24+
25+
</properties>
26+
27+
<dependencyManagement>
28+
<dependencies>
29+
<dependency>
30+
<groupId>org.springframework.boot</groupId>
31+
<artifactId>spring-boot-dependencies</artifactId>
32+
<version>${spring.boot.dependencies.version}</version>
33+
<scope>import</scope>
34+
<type>pom</type>
35+
</dependency>
36+
</dependencies>
37+
</dependencyManagement>
38+
39+
<dependencies>
40+
<dependency>
41+
<groupId>org.projectlombok</groupId>
42+
<artifactId>lombok</artifactId>
43+
<optional>true</optional>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.springframework</groupId>
47+
<artifactId>spring-web</artifactId>
48+
</dependency>
49+
50+
</dependencies>
51+
52+
<build>
53+
<plugins>
54+
<plugin>
55+
<artifactId>maven-compiler-plugin</artifactId>
56+
<version>${maven.compiler.plugin.version}</version>
57+
<configuration>
58+
<release>${java.version}</release>
59+
<compilerArgs>
60+
--enable-preview
61+
</compilerArgs>
62+
</configuration>
63+
</plugin>
64+
<plugin>
65+
<artifactId>maven-surefire-plugin</artifactId>
66+
<version>${maven.surefire.plugin.version}</version>
67+
<configuration>
68+
<argLine>
69+
--enable-preview
70+
</argLine>
71+
</configuration>
72+
</plugin>
73+
<plugin>
74+
<artifactId>maven-failsafe-plugin</artifactId>
75+
<version>${maven.failsafe.plugin.version}</version>
76+
<configuration>
77+
<argLine>
78+
--enable-preview
79+
</argLine>
80+
</configuration>
81+
</plugin>
82+
</plugins>
83+
84+
</build>
85+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.siriusxi.ms.store.api.composite.product;
2+
3+
import com.siriusxi.ms.store.api.composite.product.dto.ProductAggregate;
4+
import org.springframework.web.bind.annotation.GetMapping;
5+
import org.springframework.web.bind.annotation.PathVariable;
6+
7+
public interface ProductCompositeService {
8+
9+
/**
10+
* Sample usage: curl $HOST:$PORT/product-composite/1
11+
*
12+
* @param productId is the product that you are looking for.
13+
* @return the composite product info, if found, else null.
14+
*/
15+
@GetMapping(
16+
value = "/product-composite/{productId}",
17+
produces = "application/json")
18+
ProductAggregate getProduct(@PathVariable int productId);
19+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.siriusxi.ms.store.api.composite.product.dto;
2+
3+
import java.util.List;
4+
5+
public record ProductAggregate(
6+
int productId,
7+
String name,
8+
int weight,
9+
List<RecommendationSummary> recommendations,
10+
List<ReviewSummary>reviews,
11+
ServiceAddresses serviceAddresses) {
12+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.siriusxi.ms.store.api.composite.product.dto;
2+
3+
public record RecommendationSummary(
4+
int recommendationId,
5+
String author,
6+
int rate) {
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.siriusxi.ms.store.api.composite.product.dto;
2+
3+
public record ReviewSummary(
4+
int reviewId,
5+
String author,
6+
String subject) {
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.siriusxi.ms.store.api.composite.product.dto;
2+
3+
public record ServiceAddresses(
4+
String cmp,
5+
String pro,
6+
String rev,
7+
String rec) {
8+
}

0 commit comments

Comments
 (0)