 1 package buckpal.adapter.in.web;
 2
 3 @RestController
 4 @RequiredArgsConstructor
 5 public class SendMoneyController {
 6
 7   private final SendMoneyUseCase sendMoneyUseCase;
 8
 9   @PostMapping(
10     "/accounts/sendMoney/{sourceAccountId}/{targetAccountId}/{amount}"
11   )
12   void sendMoney(
13       @PathVariable("sourceAccountId") Long sourceAccountId,
14       @PathVariable("targetAccountId") Long targetAccountId,
15       @PathVariable("amount") Long amount) {
16
17     SendMoneyCommand command = new SendMoneyCommand(
18         new AccountId(sourceAccountId),
19         new AccountId(targetAccountId),
20         Money.of(amount));
21
22     sendMoneyUseCase.sendMoney(command);
23   }
24 }
