summaryrefslogtreecommitdiff
path: root/spring-boot/03-bank-jdbc-rest/src/main/java/com/example/spring/bank/account/AccountController.java
blob: 483584ab3296a3d561164377a31d310967e4231d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.example.spring.bank.account;

import org.springframework.beans.factory.annotation.Autowired;
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;

@RestController
@RequestMapping("/api/account")
public class AccountController {

	@Autowired
	private AccountManager accountManager;
	
	@GetMapping("/{accno}")
	public Account getAccount(@PathVariable Integer accno) {
		Account account = accountManager.find(accno);
		
		return account;
	}
	
}