Skip to content

Commit 2e05d86

Browse files
First skeleton for the rest server
1 parent 2af0fe3 commit 2e05d86

File tree

7 files changed

+350
-10
lines changed

7 files changed

+350
-10
lines changed

ledgers-deposit-account/ledgers-deposit-account-rest-api/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
<version>6.1-SNAPSHOT</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
12-
13-
<groupId>de.adorsys.ledgers.deposit.api</groupId>
1412
<artifactId>ledgers-deposit-account-rest-api</artifactId>
1513

1614
<properties>

ledgers-deposit-account/ledgers-deposit-account-rest-api/src/main/java/de/adorsys/ledgers/deposit/api/resource/AccountRestAPI.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.springframework.web.bind.annotation.*;
2222

2323
import java.time.LocalDate;
24+
import java.time.LocalDateTime;
2425
import java.util.List;
2526

2627
import static de.adorsys.ledgers.deposit.api.utils.Constants.ACCOUNT_ID;
@@ -59,16 +60,16 @@ public interface AccountRestAPI {
5960
ResponseEntity<List<TransactionTO>> getTransactionByDates(
6061
@Parameter(name = ACCOUNT_ID)
6162
@PathVariable(ACCOUNT_ID) String accountId,
62-
@RequestParam(name = DATE_FROM_QUERY_PARAM, required = false) @DateTimeFormat(pattern = LOCAL_DATE_YYYY_MM_DD_FORMAT) LocalDate dateFrom,
63-
@RequestParam(name = DATE_TO_QUERY_PARAM) @DateTimeFormat(pattern = LOCAL_DATE_YYYY_MM_DD_FORMAT) LocalDate dateTo);
63+
@RequestParam(name = DATE_FROM_QUERY_PARAM, required = false) @DateTimeFormat(pattern = LOCAL_DATE_YYYY_MM_DD_FORMAT) LocalDateTime dateFrom,
64+
@RequestParam(name = DATE_TO_QUERY_PARAM) @DateTimeFormat(pattern = LOCAL_DATE_YYYY_MM_DD_FORMAT) LocalDateTime dateTo);
6465

6566
@GetMapping(path = "/{accountId}/transactions/page", params = {DATE_FROM_QUERY_PARAM, DATE_TO_QUERY_PARAM, PAGE, SIZE})
6667
@Operation(summary = "Find Transactions By Date", description = "Returns transactions for the given account id for certain dates, paged view")
6768
ResponseEntity<CustomPageImpl<TransactionTO>> getTransactionByDatesPaged(
6869
@Parameter(name = ACCOUNT_ID)
6970
@PathVariable(name = ACCOUNT_ID) String accountId,
70-
@RequestParam(name = DATE_FROM_QUERY_PARAM, required = false) @DateTimeFormat(pattern = LOCAL_DATE_YYYY_MM_DD_FORMAT) LocalDate dateFrom,
71-
@RequestParam(name = DATE_TO_QUERY_PARAM) @DateTimeFormat(pattern = LOCAL_DATE_YYYY_MM_DD_FORMAT) LocalDate dateTo,
71+
@RequestParam(name = DATE_FROM_QUERY_PARAM, required = false) @DateTimeFormat(pattern = LOCAL_DATE_YYYY_MM_DD_FORMAT) LocalDateTime dateFrom,
72+
@RequestParam(name = DATE_TO_QUERY_PARAM) @DateTimeFormat(pattern = LOCAL_DATE_YYYY_MM_DD_FORMAT) LocalDateTime dateTo,
7273
@RequestParam(PAGE) int page,
7374
@RequestParam(SIZE) int size);
7475

ledgers-deposit-account/ledgers-deposit-account-rest-server/pom.xml

Lines changed: 180 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
~ All rights are reserved.
55
-->
66

7+
78
<project xmlns="http://maven.apache.org/POM/4.0.0"
89
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -12,16 +13,191 @@
1213
<groupId>de.adorsys.ledgers</groupId>
1314
<artifactId>ledgers-deposit-account</artifactId>
1415
<version>6.1-SNAPSHOT</version>
16+
<relativePath>../pom.xml</relativePath>
1517
</parent>
1618

17-
<groupId>de.adorsys.ledgers.deposite.rest</groupId>
1819
<artifactId>ledgers-deposit-account-rest-server</artifactId>
1920

2021
<properties>
21-
<maven.compiler.source>17</maven.compiler.source>
22-
<maven.compiler.target>17</maven.compiler.target>
23-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2422
<ruleset.basedir>../..</ruleset.basedir>
2523
</properties>
2624

25+
<dependencies>
26+
27+
<!-- project dependencies -->
28+
<dependency>
29+
<groupId>de.adorsys.ledgers</groupId>
30+
<artifactId>ledgers-deposit-account-rest-api</artifactId>
31+
<version>${project.version}</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>de.adorsys.ledgers</groupId>
35+
<artifactId>ledgers-deposit-account-service-api</artifactId>
36+
<version>${project.version}</version>
37+
</dependency>
38+
<dependency>
39+
<groupId>de.adorsys.ledgers</groupId>
40+
<artifactId>ledgers-utils</artifactId>
41+
<version>${project.version}</version>
42+
</dependency>
43+
44+
<!-- spring dependencies -->
45+
46+
<dependency>
47+
<groupId>org.springframework.boot</groupId>
48+
<artifactId>spring-boot-starter-web</artifactId>
49+
</dependency>
50+
51+
<!-- <dependency>-->
52+
<!-- <groupId>org.springframework.security</groupId>-->
53+
<!-- <artifactId>spring-security-web</artifactId>-->
54+
<!-- </dependency>-->
55+
56+
<!-- <dependency>-->
57+
<!-- <groupId>org.springframework.boot</groupId>-->
58+
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
59+
<!-- </dependency>-->
60+
61+
<!-- Keycloak dependencies
62+
63+
<dependency>
64+
<groupId>org.keycloak</groupId>
65+
<artifactId>keycloak-adapter-core</artifactId>
66+
</dependency>
67+
68+
<dependency>
69+
<groupId>org.keycloak</groupId>
70+
<artifactId>keycloak-core</artifactId>
71+
<version>${keycloak.version}</version>
72+
</dependency>
73+
-->
74+
<!-- other dependencies -->
75+
76+
<dependency>
77+
<groupId>org.mapstruct</groupId>
78+
<artifactId>mapstruct</artifactId>
79+
</dependency>
80+
81+
<dependency>
82+
<groupId>org.hibernate.validator</groupId>
83+
<artifactId>hibernate-validator</artifactId>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>org.springdoc</groupId>
88+
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
89+
</dependency>
90+
91+
<dependency>
92+
<groupId>org.apache.commons</groupId>
93+
<artifactId>commons-lang3</artifactId>
94+
</dependency>
95+
96+
<dependency>
97+
<groupId>commons-io</groupId>
98+
<artifactId>commons-io</artifactId>
99+
</dependency>
100+
101+
<!-- test dependencies -->
102+
103+
<dependency>
104+
<groupId>org.springframework.boot</groupId>
105+
<artifactId>spring-boot-starter-test</artifactId>
106+
<scope>test</scope>
107+
</dependency>
108+
<dependency>
109+
<groupId>com.jayway.jsonpath</groupId>
110+
<artifactId>json-path</artifactId>
111+
<scope>test</scope>
112+
</dependency>
113+
<dependency>
114+
<groupId>org.springframework</groupId>
115+
<artifactId>spring-test</artifactId>
116+
<scope>test</scope>
117+
</dependency>
118+
<dependency>
119+
<groupId>org.springframework</groupId>
120+
<artifactId>spring-webmvc</artifactId>
121+
<scope>test</scope>
122+
</dependency>
123+
<dependency>
124+
<groupId>org.dbunit</groupId>
125+
<artifactId>dbunit</artifactId>
126+
<scope>test</scope>
127+
<exclusions>
128+
<exclusion>
129+
<artifactId>junit</artifactId>
130+
<groupId>junit</groupId>
131+
</exclusion>
132+
</exclusions>
133+
</dependency>
134+
135+
<dependency>
136+
<groupId>com.github.springtestdbunit</groupId>
137+
<artifactId>spring-test-dbunit</artifactId>
138+
<scope>test</scope>
139+
</dependency>
140+
141+
<!-- <dependency>-->
142+
<!-- <groupId>org.springframework.security</groupId>-->
143+
<!-- <artifactId>spring-security-test</artifactId>-->
144+
<!-- <scope>test</scope>-->
145+
<!-- </dependency>-->
146+
<dependency>
147+
<groupId>pro.javatar.commons</groupId>
148+
<artifactId>javatar-commons</artifactId>
149+
<scope>test</scope>
150+
</dependency>
151+
152+
<!-- Need these service because we are activating the module from their
153+
implementation packages.
154+
<dependency>
155+
<groupId>de.adorsys.ledgers</groupId>
156+
<artifactId>ledgers-sca-service-impl</artifactId>
157+
<version>${project.version}</version>
158+
<scope>test</scope>
159+
</dependency>
160+
-->
161+
<dependency>
162+
<groupId>de.adorsys.ledgers</groupId>
163+
<artifactId>ledgers-deposit-account-service-impl</artifactId>
164+
<version>${project.version}</version>
165+
<scope>test</scope>
166+
</dependency>
167+
<dependency>
168+
<groupId>de.adorsys.ledgers</groupId>
169+
<artifactId>ledgers-postings-service-impl</artifactId>
170+
<version>${project.version}</version>
171+
<scope>test</scope>
172+
</dependency>
173+
174+
<dependency>
175+
<groupId>de.adorsys.ledgers</groupId>
176+
<artifactId>ledgers-postings-repository</artifactId>
177+
<version>${project.version}</version>
178+
<scope>test</scope>
179+
</dependency>
180+
<dependency>
181+
<groupId>de.adorsys.ledgers</groupId>
182+
<artifactId>ledgers-deposit-account-repository</artifactId>
183+
<version>${project.version}</version>
184+
<scope>test</scope>
185+
</dependency>
186+
187+
188+
<dependency>
189+
<groupId>commons-validator</groupId>
190+
<artifactId>commons-validator</artifactId>
191+
</dependency>
192+
</dependencies>
193+
<!-- <build>-->
194+
<!-- <plugins>-->
195+
<!-- <plugin>-->
196+
<!-- <groupId>org.springframework.boot</groupId>-->
197+
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
198+
<!-- &lt;!&ndash; Use the latest version if available &ndash;&gt;-->
199+
<!-- </plugin>-->
200+
<!-- </plugins>-->
201+
<!-- </build>-->
202+
27203
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG
3+
* All rights are reserved.
4+
*/
5+
6+
package de.adorsys.ledgers.deposit.rest.annotation;
7+
8+
import java.lang.annotation.Documented;
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.RetentionPolicy;
11+
import java.lang.annotation.Target;
12+
13+
/**
14+
* Marks a resource public so the swagger documentation can be exported.
15+
*
16+
* @author dmi
17+
*/
18+
@Target({java.lang.annotation.ElementType.TYPE})
19+
@Retention(RetentionPolicy.RUNTIME)
20+
@Documented
21+
public @interface DepositResetResource {
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2018-2023 adorsys GmbH and Co. KG
3+
* All rights are reserved.
4+
*/
5+
6+
package de.adorsys.ledgers.deposit.rest.annotation;
7+
8+
import java.lang.annotation.Documented;
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.RetentionPolicy;
11+
import java.lang.annotation.Target;
12+
13+
/**
14+
* Marks a resource public so the swagger documentation can be exported.
15+
*
16+
* @author fpo
17+
*
18+
*/
19+
@Target({ java.lang.annotation.ElementType.TYPE })
20+
@Retention(RetentionPolicy.RUNTIME)
21+
@Documented
22+
public @interface DepositUserResource {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2018-2024 adorsys GmbH and Co. KG
3+
* All rights are reserved.
4+
*/
5+
6+
package de.adorsys.ledgers.deposit.rest.resource;
7+
8+
import de.adorsys.ledgers.deposit.api.domain.account.AccountDetailsTO;
9+
import de.adorsys.ledgers.deposit.api.resource.AccountMgmResourceAPI;
10+
import de.adorsys.ledgers.deposit.api.service.DepositAccountService;
11+
import lombok.RequiredArgsConstructor;
12+
import org.springframework.context.annotation.ComponentScan;
13+
import org.springframework.http.ResponseEntity;
14+
import org.springframework.stereotype.Service;
15+
import org.springframework.web.bind.annotation.RequestMapping;
16+
import org.springframework.web.bind.annotation.RestController;
17+
18+
@RestController
19+
@RequiredArgsConstructor
20+
@Service
21+
@RequestMapping("/AccountManagement" )
22+
public class AccountMgmResource implements AccountMgmResourceAPI {
23+
private final DepositAccountService depositAccountService;
24+
25+
@Override
26+
public ResponseEntity<AccountDetailsTO> createDepositAccount(String authorizationHeader, AccountDetailsTO accountDetailsTO) {
27+
return null;
28+
}
29+
}

0 commit comments

Comments
 (0)