Skip to content

Instantly share code, notes, and snippets.

@jaocamp
Last active August 23, 2018 03:51
Show Gist options
  • Save jaocamp/6e87561bbe02e3b3aa58497e9110556a to your computer and use it in GitHub Desktop.
Save jaocamp/6e87561bbe02e3b3aa58497e9110556a to your computer and use it in GitHub Desktop.
CQRS e Event Sourcing com Axon Framework e Spring Boot - BankAccountController.java
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;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/bank-accounts")
public class BankAccountController {
private BankAccountRepository repository;
@GetMapping
public ResponseEntity<Iterable<BankAccount>> getAll() {
return ResponseEntity.ok(repository.findAll());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment