-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementação do endpoint /accounts/balance.
Desenvolvimento do endpoint /accounts/balance que retorna o valor em conta bancária para o usuário autenticado e suas demais validações.
- Loading branch information
1 parent
e8828a3
commit fc18bc2
Showing
3 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
37 changes: 37 additions & 0 deletions
37
src/main/java/br/com/maida/desafio/bankapi/model/AccountBalance.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package br.com.maida.desafio.bankapi.model; | ||
|
||
import javax.validation.constraints.NotEmpty; | ||
import javax.validation.constraints.NotNull; | ||
|
||
/** | ||
* | ||
* @author Gabriel Duarte | ||
*/ | ||
public class AccountBalance { | ||
|
||
@NotNull(message = "Campo account_number ausente.") | ||
@NotEmpty(message = "Campo account_number vazio.") | ||
private String account_number; | ||
|
||
public AccountBalance() { | ||
|
||
} | ||
|
||
public AccountBalance(String account_number) { | ||
this.account_number = account_number; | ||
} | ||
|
||
public String getAccount_number() { | ||
return account_number; | ||
} | ||
|
||
public void setAccount_number(String account_number) { | ||
this.account_number = account_number; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/br/com/maida/desafio/bankapi/model/AccountBalanceResponse.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package br.com.maida.desafio.bankapi.model; | ||
|
||
import java.math.BigDecimal; | ||
|
||
/** | ||
* | ||
* @author Gabriel Duarte | ||
*/ | ||
public class AccountBalanceResponse { | ||
|
||
private String account_number; | ||
private BigDecimal balance; | ||
|
||
public AccountBalanceResponse(String account_number, BigDecimal balance) { | ||
this.account_number = account_number; | ||
this.balance = balance; | ||
} | ||
|
||
public String getAccount_number() { | ||
return account_number; | ||
} | ||
|
||
public BigDecimal getBalance() { | ||
return balance; | ||
} | ||
|
||
} |