Skip to content

Commit fc24f37

Browse files
Adding jpa configurer and updating feign base urls (#5)
2 parents 7a19578 + 48b6927 commit fc24f37

File tree

5 files changed

+30
-5
lines changed

5 files changed

+30
-5
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package br.com.grupo63.techchallenge.payment.config;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.data.auditing.DateTimeProvider;
6+
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
7+
8+
import java.time.LocalDateTime;
9+
import java.util.Optional;
10+
11+
@Configuration
12+
@EnableJpaAuditing(dateTimeProviderRef = "auditingDateTimeProvider")
13+
public class JPAConfigurer {
14+
15+
@Bean(name = "auditingDateTimeProvider")
16+
public DateTimeProvider dateTimeProvider() {
17+
return () -> Optional.of(LocalDateTime.now());
18+
}
19+
20+
}

src/main/java/br/com/grupo63/techchallenge/payment/gateway/order/IOrderGateway.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import java.util.Optional;
1010

11-
@FeignClient(name = "orders", url = "${urls.baseurl}")
11+
@FeignClient(name = "orders", url = "${urls.baseurl-order}")
1212
public interface IOrderGateway {
1313

1414
@RequestMapping(method = RequestMethod.GET, value = "${urls.orders}/{orderId}")

src/main/java/br/com/grupo63/techchallenge/payment/gateway/status/IStatusGateway.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.springframework.web.bind.annotation.RequestMethod;
66
import org.springframework.web.bind.annotation.RequestParam;
77

8-
@FeignClient(name = "status", url = "${urls.baseurl}")
8+
@FeignClient(name = "status", url = "${urls.baseurl-production}")
99
public interface IStatusGateway {
1010

1111
@RequestMapping(method = RequestMethod.POST, value = "${urls.status}/advance-status", consumes = "application/json")

src/main/resources/application-dev.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@ jwt:
2323
key:
2424
public: "${JWT_PUBLIC_KEY:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqStd8n4SGNM0eZhV/hzU+urHA5/IMZPoP9YQ9ZcLKWiX33nI6bSuZMCrLZcJExf63xS+uxDpGxM8Mnk2zOdl+lPwANXLzP1us5P1PyA3YPycW9J7C5YTQW0GiEL3M93ZX7vMJiVoBYblP3JPlYnoYlBORuc0JPk33KtfEZP+78qXpPHM8imYrJLe8ceiDLLFDU/nh5KC2dWAy3ci1ahoJ1Q9ELhp3IZLvOTX57H/T2VKOYOya5+ST41h+JjzI+qGTVnLcKaW+k25YLlVnkSspvdx98+yQDi7kbOTS6yRZHUPD6wPk/nUozpD0nZKccoH4W+zMwmQVtsAA6JCA9gfGwIDAQAB}"
2525
urls:
26-
baseurl: 'http://localhost:8080'
26+
baseurl-order: '${BASE_URL_ORDER:http://localhost:8083}'
27+
baseurl-production: '${BASE_URL_PRODUCTION:http://localhost:8082}'
28+
29+
server:
30+
servlet:
31+
context-path: "/payment"

src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ docs:
4545
url: "${DOCS_API_URL:https://9ah1j49vm1.execute-api.us-east-2.amazonaws.com}"
4646

4747
urls:
48-
status: '/public/status'
49-
orders: '/public/orders'
48+
status: '/production/status'
49+
orders: '/order/orders'

0 commit comments

Comments
 (0)