Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/runner/controllers/AccountController.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public String testJWT() {
}

//get accounts for the authenticated user only, THIS is the homepage once user has logged in
//@JsonView(Views.AllAccounts.class)
@JsonView(Views.AllAccounts.class)
@GetMapping
public ResponseEntity<Set<Account>> readAllAccount() {
String currentPrincipalName = SecurityContextHolder.getContext().getAuthentication().getName();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/runner/controllers/CustomerController.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class CustomerController {
@JsonView(Views.Profile.class)
@GetMapping(value = "/myaccount/profile")
public ResponseEntity<?> getCustomer() {
String currentPrincipalName = SecurityContextHolder.getContext().getAuthentication().getName(); //needs JWT token in header
Customer customer =customerServices.readCustomerByLogin(currentPrincipalName); //<< for testing on angular, need to change back to currentPrincipalName
//String currentPrincipalName = SecurityContextHolder.getContext().getAuthentication().getName(); //needs JWT token in header
Customer customer =customerServices.readCustomerByLogin("user1"); //<< for testing on angular, need to change back to currentPrincipalName
if( customer == null)
return new ResponseEntity<>("Customer not found", HttpStatus.NOT_FOUND);
else
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/runner/entities/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Account {
@JsonView(Views.AccountNumber.class)
private String accountNumber;

@JsonView(Views.AccountDetails.class)
@JsonView(Views.RoutingNumber.class)
private String routingNumber = "091000022";

@JsonView(Views.AccountType.class)
Expand All @@ -32,7 +32,7 @@ public class Account {
@JsonView(Views.AccountActions.class)
private Double balance;

@JsonView(Views.AccountDetails.class)
@JsonView(Views.AccountOpening.class)
private LocalDate dateOfOpening;

@JsonView(Views.AccountDetails.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public FilterRegistrationBean disableMyFilterBean() {

@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/authenticate","/","/myaccount/profile","/openaccount");
web.ignoring().antMatchers("/authenticate","/","/openaccount");
}

@Bean
Expand Down
20 changes: 14 additions & 6 deletions src/main/java/runner/views/Views.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ public static interface AccountType{

}

public static class AllAccounts implements AccountNumber, AccountType{
public static interface RoutingNumber{

}

public static interface AccountOpening{

}

public static class AllAccounts implements AccountNumber, AccountType, RoutingNumber, AccountActions, AccountOpening{
/*
payload: multiple accounts: account number, account balance, account type
payload: multiple accounts: account number, account balance, account type, routingNumber, AccountOpening,
*/
}

Expand All @@ -22,15 +30,15 @@ public static interface AccountActions{
*/
}

public static class AccountDetails implements AccountNumber, AccountType, AccountActions{
public static class AccountDetails implements AccountNumber, AccountType, AccountActions, AccountOpening, RoutingNumber{
/*
payload: account balance, interest rate, date of creation, account number, routing number, account type
payload: account balance, interest rate, date of creation, account number, routing number, account type, transactions
*/
}

public static class AccountSpecific implements AccountActions{
public static class AccountSpecific implements AccountActions, AccountNumber{
/*
payload: account balance, transactions
payload: account balance, transactions, account number
*/
}

Expand Down
Binary file modified target/classes/runner/controllers/CustomerController.class
Binary file not shown.
Binary file modified target/classes/runner/entities/Account.class
Binary file not shown.
Binary file modified target/classes/runner/security/config/WebSecurityConfig.class
Binary file not shown.
Binary file modified target/classes/runner/views/Views$AccountDetails.class
Binary file not shown.
Binary file not shown.
Binary file modified target/classes/runner/views/Views$AccountSpecific.class
Binary file not shown.
Binary file modified target/classes/runner/views/Views$AllAccounts.class
Binary file not shown.
Binary file modified target/classes/runner/views/Views$Profile.class
Binary file not shown.
Binary file not shown.
Binary file modified target/classes/runner/views/Views.class
Binary file not shown.
Binary file not shown.