This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.coderef.controller; | |
import lombok.AllArgsConstructor; | |
import org.axonframework.eventhandling.EventMessage; | |
import org.axonframework.eventsourcing.eventstore.EventStore; | |
import org.springframework.transaction.annotation.Transactional; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.coderef.configuration; | |
import com.rabbitmq.client.Channel; | |
import lombok.extern.slf4j.Slf4j; | |
import org.axonframework.amqp.eventhandling.DefaultAMQPMessageConverter; | |
import org.axonframework.amqp.eventhandling.spring.SpringAMQPMessageSource; | |
import org.axonframework.serialization.Serializer; | |
import org.springframework.amqp.core.Message; | |
import org.springframework.amqp.rabbit.annotation.RabbitListener; | |
import org.springframework.context.annotation.Bean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.coderef.configuration; | |
import org.springframework.amqp.core.AmqpAdmin; | |
import org.springframework.amqp.core.Binding; | |
import org.springframework.amqp.core.BindingBuilder; | |
import org.springframework.amqp.core.Exchange; | |
import org.springframework.amqp.core.ExchangeBuilder; | |
import org.springframework.amqp.core.Queue; | |
import org.springframework.amqp.core.QueueBuilder; | |
import org.springframework.beans.factory.annotation.Autowired; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.coderef.components; | |
import lombok.AllArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.axonframework.config.ProcessingGroup; | |
import org.axonframework.eventhandling.EventHandler; | |
import org.springframework.stereotype.Component; | |
import br.com.coderef.event.BankAccountAddedEvent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.coderef.controller; | |
import br.com.coderef.model.BankAccount; | |
import br.com.coderef.repository.BankAccountRepository; | |
import lombok.AllArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.coderef.repository; | |
import br.com.coderef.model.BankAccount; | |
import org.springframework.data.repository.CrudRepository; | |
public interface BankAccountRepository extends CrudRepository<BankAccount, String> { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.coderef.model; | |
import lombok.AllArgsConstructor; | |
import lombok.Getter; | |
import lombok.NoArgsConstructor; | |
import lombok.Setter; | |
import javax.persistence.Entity; | |
import javax.persistence.Id; | |
import java.math.BigDecimal; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server: | |
port: 8082 | |
spring: | |
datasource: | |
url: jdbc:postgresql://localhost:5432/bank-account-db | |
username: postgres | |
password: postgres | |
jpa: | |
database-platform: org.hibernate.dialect.PostgreSQL94Dialect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" 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> | |
<groupId>br.com.coderef</groupId> | |
<artifactId>bank-account-query</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.coderef.controller; | |
import br.com.coderef.command.AddBankAccountCommand; | |
import br.com.coderef.command.RemoveBankAccountCommand; | |
import br.com.coderef.command.UpdateBalanceBankAccountCommand; | |
import br.com.coderef.dto.BankAccountDTO; | |
import lombok.AllArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.axonframework.commandhandling.gateway.CommandGateway; | |
import org.springframework.web.bind.annotation.DeleteMapping; |
NewerOlder