Czy coś takiego w kontrolerze jest akceptowalne według was czy już za dużo logiki i kontroler za dużo robi?
@RestController
@RequestMapping("/payments")
@RequiredArgsConstructor
public class PaymentController {
private final PaymentService paymentService;
private final PaymentToRestModelConverter converter;
@PostMapping("/startPayment")
private PaymentStartResponse startPayment(@Valid @RequestBody PaymentStartRequest rq) {
PaymentStarted paymentStarted = paymentService.startPayment(new PaymentData(rq.language, rq.country));
return converter.convert(paymentStarted);
}
}