update swagger configure
This commit is contained in:
@@ -12,10 +12,16 @@ import com.billpaymentservice.bbps.dto.ResponseModel;
|
||||
import com.billpaymentservice.bbps.dto.request.BillPaymentRequest;
|
||||
import com.billpaymentservice.bbps.dto.request.TransactionStatusRequest;
|
||||
import com.billpaymentservice.bbps.dto.request.TrasactionStatusByClientReqIdRequest;
|
||||
import com.billpaymentservice.bbps.dto.response.TransactionStatusResponse;
|
||||
import com.billpaymentservice.bbps.service.PaymentService;
|
||||
import com.billpaymentservice.bbps.service.PaymentStartService;
|
||||
import com.billpaymentservice.bbps.dto.request.PaymentStartUserRequest;
|
||||
import com.billpaymentservice.bbps.util.ApiDocCommonResponses;
|
||||
import com.billpaymentservice.bbps.util.BBPSConstant;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/agent/payment")
|
||||
@@ -28,13 +34,16 @@ public class PaymentController {
|
||||
private final PaymentService paymentService;
|
||||
private final PaymentStartService paymentStartService;
|
||||
|
||||
// New constructor used by Spring to inject both services
|
||||
public PaymentController(PaymentService paymentService, PaymentStartService paymentStartService) {
|
||||
this.paymentService = paymentService;
|
||||
this.paymentStartService = paymentStartService;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/intiatePayment", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@PostMapping(value = "/intiatePayment")
|
||||
@Operation(summary = "Initiate payment request", description = "This API initiates the payment process for the provided bill payment request.")
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Payment initiated successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
|
||||
@ApiDocCommonResponses
|
||||
public ResponseEntity<ResponseModel> requestBillFetch(
|
||||
@Validated @RequestBody BillPaymentRequest billPaymentRequest) {
|
||||
|
||||
@@ -42,7 +51,11 @@ public class PaymentController {
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/checkTransactionStatus", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@PostMapping(value = "/checkTransactionStatus")
|
||||
@Operation(summary = "Check transaction status", description = "This API checks the current status of a bill payment transaction using transactionId or clientReqId.")
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Transaction status fetched successfully", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
|
||||
@ApiDocCommonResponses
|
||||
public ResponseEntity<ResponseModel> checkTransactionStatus(
|
||||
@Validated @RequestBody TransactionStatusRequest transactionStatusRequest) {
|
||||
|
||||
@@ -50,16 +63,16 @@ public class PaymentController {
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/checkTransactionStatusByClientReqId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@PostMapping(value = "/checkTransactionStatusByClientReqId")
|
||||
@Operation(summary = "Check transaction status by client request ID", description = "This API checks the payment transaction status using the client-generated request ID (clientReqId).")
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = BBPSConstant.OK_STR, description = "Transaction status fetched successfully using clientReqId", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseModel.class))) })
|
||||
@ApiDocCommonResponses
|
||||
public ResponseEntity<ResponseModel> checkTransactionStatusByClientReqId(
|
||||
@Validated @RequestBody TrasactionStatusByClientReqIdRequest transactionStatusRequest) {
|
||||
|
||||
ResponseModel response = paymentService.checkTrasactionStatusByClientReqId(transactionStatusRequest);
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user