03-11-25
This commit is contained in:
@@ -1,35 +1,22 @@
|
||||
package com.billpaymentservice.bbps.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.billpaymentservice.bbps.dto.MasterApiResponse;
|
||||
import com.billpaymentservice.bbps.dto.ResponseModel;
|
||||
import com.billpaymentservice.bbps.dto.request.BillerDetailRequest;
|
||||
import com.billpaymentservice.bbps.dto.request.ContactMasterRequest;
|
||||
import com.billpaymentservice.bbps.dto.request.CustomParamRequest;
|
||||
import com.billpaymentservice.bbps.dto.request.MasterCategoryRequest;
|
||||
import com.billpaymentservice.bbps.dto.request.MasterRequest;
|
||||
import com.billpaymentservice.bbps.dto.request.MerchantRequestModel;
|
||||
import com.billpaymentservice.bbps.dto.response.BillerDataResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.BillerResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ContactMasterResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.CustomParamResp;
|
||||
import com.billpaymentservice.bbps.service.MasterDataService;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
@RequestMapping("/masterData")
|
||||
@RestController
|
||||
public class MasterDataController {
|
||||
@@ -41,34 +28,86 @@ public class MasterDataController {
|
||||
public MasterDataController(MasterDataService masterDataService) {
|
||||
this.masterDataService = masterDataService;
|
||||
}
|
||||
/**Get Details of the biller by billId **/
|
||||
|
||||
/** Get Details of the biller by billId **/
|
||||
@PostMapping(value = "/getBillerDetails", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<ResponseModel> getBillerDetails(@Validated @RequestBody BillerDetailRequest billerDetailRequest) {
|
||||
public ResponseEntity<ResponseModel> getBillerDetails(
|
||||
@Validated @RequestBody BillerDetailRequest billerDetailRequest) {
|
||||
|
||||
log.info("Received biller details request for billerId: {}", billerDetailRequest.getBillerId());
|
||||
|
||||
return ResponseEntity.ok(masterDataService.getBillerByBillerId(billerDetailRequest));
|
||||
return ResponseEntity.ok(masterDataService.getBillerByBillerId(billerDetailRequest));
|
||||
}
|
||||
/**Get Master Contact**/
|
||||
|
||||
/** Get Master Contact **/
|
||||
@PostMapping(value = "/getContactMasterResponse", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<ResponseModel> getContactMaster(
|
||||
@Validated @RequestBody ContactMasterRequest contactMasterRequest ) {
|
||||
@Validated @RequestBody ContactMasterRequest contactMasterRequest) {
|
||||
|
||||
return ResponseEntity.ok(masterDataService.getContactMaster(contactMasterRequest));
|
||||
return ResponseEntity.ok(masterDataService.getContactMaster(contactMasterRequest));
|
||||
}
|
||||
|
||||
/** Get CustomerParam by billerId.The parameter is different from the data we are getting in the billerDetail **/
|
||||
|
||||
/**
|
||||
* Get CustomerParam by billerId.The parameter is different from the data we are
|
||||
* getting in the billerDetail
|
||||
**/
|
||||
@PostMapping(value = "/getCustomerParamDetails", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<ResponseModel> getBillerDetails(
|
||||
@Validated @RequestBody CustomParamRequest customerParamRequest) {
|
||||
|
||||
log.info("Received biller details request for billerId: {}",customerParamRequest.getBillerId() );
|
||||
log.info("Received biller details request for billerId: {}", customerParamRequest.getBillerId());
|
||||
|
||||
return ResponseEntity.ok(masterDataService.getCustomerParamByBillerId(customerParamRequest));
|
||||
return ResponseEntity.ok(masterDataService.getCustomerParamByBillerId(customerParamRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get All Master Data .The parameter is different from the data we are getting
|
||||
* in the MasterRequest
|
||||
**/
|
||||
@PostMapping("/getAllMastersData")
|
||||
public ResponseModel fetchMasterData(@Validated @RequestBody MasterRequest masterRequest) {
|
||||
return masterDataService.getMasterData(masterRequest);
|
||||
}
|
||||
|
||||
/** POST Master Category Wise API Fetch Category Wise from BBPS URL **/
|
||||
@PostMapping(value = "/getMasterCategoryWise", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<ResponseModel> getMasterDataCategoryWise(
|
||||
@Validated @RequestBody MasterCategoryRequest masterRequest) {
|
||||
return ResponseEntity.ok(masterDataService.fetchMasterDataCategoryWise(masterRequest));
|
||||
}
|
||||
|
||||
/** POST Customer Param Groups API Fetch Category Wise from BBPS URL **/
|
||||
@PostMapping(value = "/customerParamGroups", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<ResponseModel> getCustomerParamGroup(
|
||||
@Validated @RequestBody BillerDetailRequest requestModel) {
|
||||
return ResponseEntity.ok(masterDataService.fetchCustomerParamGroup(requestModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* POST Fetch All AMount Options By Biller Id API Fetch Category Wise from BBPS
|
||||
* URL
|
||||
**/
|
||||
@PostMapping(value = "/fetchAllAmountOptionsByBillerId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<ResponseModel> fetchAllMasterAmountOptionsByBillerId(
|
||||
@Validated @RequestBody BillerDetailRequest requestModel) {
|
||||
return ResponseEntity.ok(masterDataService.fetchAllMasterAmountOption(requestModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* POST Fetch All AMount Options By Biller Id API Fetch Category Wise from BBPS
|
||||
* URL
|
||||
**/
|
||||
@PostMapping(value = "/fetchPlanCategories", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<ResponseModel> fetchPlanCategories(@Validated @RequestBody BillerDetailRequest requestModel) {
|
||||
return ResponseEntity.ok(masterDataService.fetchPlanCategorie(requestModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* POST Fetch Initiating Channel API Fetch Category Wise from BBPS
|
||||
* URL
|
||||
**/
|
||||
@PostMapping(value = "/initiatingChannel", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<ResponseModel> initiatingChannel(@Validated @RequestBody BillerDetailRequest requestModel) {
|
||||
return ResponseEntity.ok(masterDataService.fetchInitiatingChannel(requestModel));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user