Skip to content

Commit

Permalink
chore: refactored obs module structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Koufan-De-King committed Oct 22, 2024
1 parent 3f45b6c commit 33809a6
Show file tree
Hide file tree
Showing 23 changed files with 511 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/develop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: cd online-banking-service && mvn clean install
run: mvn clean install

#Add pmd check
File renamed without changes.
23 changes: 21 additions & 2 deletions obs/obs-rest-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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>com.adorsys.webank</groupId>
<artifactId>obs</artifactId>
Expand All @@ -20,18 +21,36 @@
</properties>

<dependencies>
<!-- OBS Service API -->
<dependency>
<groupId>com.adorsys.webank</groupId>
<artifactId>obs-service-api</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>

<!-- Swagger Annotations -->
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations-jakarta</artifactId>
<version>2.2.22</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
<!-- Spring Boot Starter for Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.1.4</version>
<scope>compile</scope>
</dependency>

<!-- Spring Boot Starter for Testing -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>3.1.4</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.adorsys.webank.obs;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@RequestMapping("/api/obs")
public interface OBSRestApi {

@GetMapping("/message")
@ResponseBody
String getMessage();
}

24 changes: 24 additions & 0 deletions obs/obs-rest-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,28 @@
<ruleset.basedir>../..</ruleset.basedir>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.adorsys.webank</groupId>
<artifactId>obs-service-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.adorsys.webank</groupId>
<artifactId>obs-rest-api</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Other existing dependencies -->
</dependencies>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.adorsys.webank.obs;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;

@RestController
public class OBSRestServer implements OBSRestApi {

private final OBSServiceApi obsService;

@Autowired
public OBSRestServer(OBSServiceApi obsService) {
this.obsService = obsService;
}

@Override
public String getMessage() {
return obsService.getMessage();
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.adorsys.webank.obs;

public interface OBSServiceApi {
String getMessage();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.adorsys.webank.obs;

import org.springframework.stereotype.Service;

@Service
public class OBSServiceImpl implements OBSServiceApi {

@Override
public String getMessage() {
return "Hello from the OBS Service!";
}
}
9 changes: 8 additions & 1 deletion obs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
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>

<groupId>com.adorsys.webank</groupId>
<parent>
<groupId>com.adorsys.webank</groupId>
<artifactId>webank-OnlineBanking</artifactId>
<version>0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>obs</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
Expand All @@ -12,6 +18,7 @@
<module>obs-rest-server</module>
<module>obs-service-api</module>
<module>obs-service-impl</module>

</modules>


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 28 additions & 2 deletions online-banking-service/pom.xml → online-banking-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.adorsys.webank</groupId>
<artifactId>online-banking-service</artifactId>
<artifactId>online-banking-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>online-banking-service</name>
<name>online-banking-app</name>
<description>online banking service</description>
<url/>
<licenses>
Expand All @@ -31,6 +31,31 @@
<spring-cloud.version>2023.0.3</spring-cloud.version>
</properties>
<dependencies>

<!-- <dependency>-->
<!-- <groupId>com.adorsys.webank</groupId>-->
<!-- <artifactId>obs-rest-api</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- </dependency>-->

<!-- <dependency>-->
<!-- <groupId>com.adorsys.webank</groupId>-->
<!-- <artifactId>obs-rest-server</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- </dependency>-->

<!-- <dependency>-->
<!-- <groupId>com.adorsys.webank</groupId>-->
<!-- <artifactId>obs-service-api</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- </dependency>-->

<!-- <dependency>-->
<!-- <groupId>com.adorsys.webank</groupId>-->
<!-- <artifactId>obs-service-impl</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- </dependency>-->

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down Expand Up @@ -71,6 +96,7 @@
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<mainClass>com.adorsys.webank.OnlineBankingApplication</mainClass>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class OnlineBankingServiceApplication {
public class OnlineBankingApplication {

public static void main(String[] args) {
SpringApplication.run(OnlineBankingServiceApplication.class, args);
SpringApplication.run(OnlineBankingApplication.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.application.name=online-banking-app
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = OnlineBankingServiceApplication.class) // Specify main class
public class OnlineBankingServiceApplicationTests {
@SpringBootTest(classes = OnlineBankingApplication.class) // Specify main class
public class OnlineBankingApplicationTests {

@Test
public void contextLoads() {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 33809a6

Please sign in to comment.