Skip to content

Commit 9a14d1c

Browse files
committed
fix: app and feign client configration
1 parent 1140f7d commit 9a14d1c

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
package br.com.grupo63.techchallenge.payment.gateway.order;
22

33
import br.com.grupo63.techchallenge.payment.gateway.order.dto.OrderDTO;
4-
import feign.Param;
5-
import feign.RequestLine;
64
import org.springframework.cloud.openfeign.FeignClient;
5+
import org.springframework.web.bind.annotation.PathVariable;
6+
import org.springframework.web.bind.annotation.RequestMapping;
7+
import org.springframework.web.bind.annotation.RequestMethod;
78

89
import java.util.Optional;
910

10-
@FeignClient("order")
11+
@FeignClient(name = "order", url = "/")
1112
public interface IOrderGateway {
1213

13-
@RequestLine("GET /orders/{orderId}")
14-
Optional<OrderDTO> getOrderById(@Param("orderId") Long orderId);
14+
@RequestMapping(method = RequestMethod.GET, value = "/public/orders/{orderId}")
15+
Optional<OrderDTO> getOrderById(@PathVariable("orderId") Long orderId);
1516

1617
}

src/main/java/br/com/grupo63/techchallenge/payment/gateway/payment/PaymentPersistenceEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public class PaymentPersistenceEntity extends PersistenceEntity {
2929
private Long orderId;
3030

3131

32-
@Basic
32+
@Enumerated(EnumType.STRING)
3333
@Column(name = "method", nullable = false)
3434
private PaymentMethod method;
3535

36-
@Basic
36+
@Enumerated(EnumType.STRING)
3737
@Column(name = "status", nullable = false)
3838
private PaymentStatus status;
3939

src/main/java/br/com/grupo63/techchallenge/payment/gateway/production/IProductionGateway.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.RequestMapping;
66
import org.springframework.web.bind.annotation.RequestMethod;
77

8-
@FeignClient("production")
8+
@FeignClient(name = "production", url = "/")
99
public interface IProductionGateway {
1010

1111
@RequestMapping(method = RequestMethod.POST, value = "/public/production/advance-status?orderId={orderId}", consumes = "application/json")

src/main/java/br/com/grupo63/techchallenge/payment/usecase/PaymentUseCase.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import br.com.grupo63.techchallenge.payment.gateway.order.dto.OrderDTO;
99
import br.com.grupo63.techchallenge.payment.gateway.payment.IMercadoPagoGateway;
1010
import br.com.grupo63.techchallenge.payment.gateway.payment.IPaymentGateway;
11-
import br.com.grupo63.techchallenge.payment.gateway.production.IProductionGateway;
1211
import lombok.RequiredArgsConstructor;
1312
import org.springframework.stereotype.Service;
1413

@@ -19,7 +18,6 @@ public class PaymentUseCase implements IPaymentUseCase {
1918
private final IMercadoPagoGateway mercadoPagoService;
2019
private final IOrderGateway orderGateway;
2120
private final IPaymentGateway paymentGateway;
22-
private final IProductionGateway productionGateway;
2321

2422
@Override
2523
public String startPayment(Long orderId) throws NotFoundException {
@@ -41,7 +39,6 @@ public void finishPayment(Long orderId) throws NotFoundException {
4139
payment.setStatus(PaymentStatus.PAID);
4240
paymentGateway.saveAndFlush(payment);
4341

44-
productionGateway.advanceStatus(orderId);
4542
}
4643

4744
@Override

src/main/resources/application-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ spring:
22
datasource:
33
driver-class-name: org.postgresql.Driver
44
password: ${DB_PASSWORD:backend}
5-
url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:backend-db}
5+
url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:backend}
66
username: ${DB_USERNAME:backend}
77
docker:
88
compose:
File renamed without changes.

0 commit comments

Comments
 (0)