Skip to content

Commit

Permalink
feat getAccount controller
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesecrust committed Jan 31, 2024
1 parent 0822ff6 commit 8874408
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/main/java/com/eum/bank/controller/AccountController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import com.eum.bank.common.APIResponse;
import com.eum.bank.common.dto.request.AccountRequestDTO;
import com.eum.bank.common.dto.response.AccountResponseDTO;
import com.eum.bank.common.enums.SuccessCode;
import com.eum.bank.service.AccountService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand All @@ -25,4 +22,16 @@ public ResponseEntity<?> create(@RequestBody AccountRequestDTO.CreateAccount cre

return ResponseEntity.ok(response);
}

// 계좌 조회
@PostMapping("/getAccount")
public ResponseEntity<?> getAccountInfo(@RequestBody AccountRequestDTO.GetAccount getAccountInfo) {
String accountNumber = getAccountInfo.getAccountNumber();
String password = getAccountInfo.getPassword();

APIResponse<?> response = accountService.getAccount(accountNumber, password);

return ResponseEntity.ok(response);
}

}

0 comments on commit 8874408

Please sign in to comment.