-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathPaymentController.java
33 lines (26 loc) · 1.09 KB
/
PaymentController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.bravo.user.controller;
import com.bravo.user.annotation.SwaggerController;
import com.bravo.user.model.dto.PaymentDto;
import com.bravo.user.service.PaymentService;
import com.bravo.user.validator.UserValidator;
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.ResponseBody;
import java.util.List;
@RequestMapping(value = "/payment")
@SwaggerController
public class PaymentController {
private final UserValidator userValidator;
private final PaymentService paymentService;
public PaymentController(UserValidator userValidator, PaymentService paymentService) {
this.userValidator = userValidator;
this.paymentService = paymentService;
}
@GetMapping(value = "/retrieve/{userId}")
@ResponseBody
public List<PaymentDto> retrieve(final @PathVariable String userId) {
userValidator.validateId(userId);
return paymentService.retrieveByUserId(userId);
}
}