blob: bb0ce70da3adc23a6d75d6444e782d8308e49bef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package com.rinha.backend.controller;
import com.rinha.backend.model.PaymentModel;
import com.rinha.backend.service.PaymentService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/payments")
public class PaymentController {
private final PaymentService paymentService;
public PaymentController(PaymentService paymentService) {
this.paymentService = paymentService;
}
@PostMapping
public ResponseEntity<String> post(@RequestBody PaymentModel paymentModel){
//System.out.println(paymentModel.getCorrelationId());
paymentService.addQueue(paymentModel);
return ResponseEntity.ok().build();
}
}
|