created Api getAllMasters,getMasterCategoryWise.
This commit is contained in:
@@ -1,24 +1,59 @@
|
||||
package com.billpaymentservice.bbps.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
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.request.BillerDetailRequest;
|
||||
import com.billpaymentservice.bbps.service.MasterDataService;
|
||||
import com.billpaymentservice.bbps.dto.request.MerchantRequestModel;
|
||||
import com.billpaymentservice.bbps.dto.response.BillerResponse;
|
||||
import com.billpaymentservice.bbps.service.MasterDataService;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
@RequestMapping("/masterData")
|
||||
@RestController
|
||||
public class MasterDataController {
|
||||
|
||||
private final MasterDataService masterDataService;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MasterDataController.class);
|
||||
|
||||
public MasterDataController(MasterDataService masterDataService) {
|
||||
this.masterDataService = masterDataService;
|
||||
}
|
||||
private final MasterDataService masterDataService;
|
||||
|
||||
@PostMapping("/getBillerById")
|
||||
public String getBillerById(@RequestBody BillerDetailRequest billerRequestRequest) {
|
||||
masterDataService.getBillerByBillerId(billerRequestRequest);
|
||||
return "Abc";
|
||||
}
|
||||
public MasterDataController(MasterDataService masterDataService) {
|
||||
this.masterDataService = masterDataService;
|
||||
}
|
||||
|
||||
@PostMapping("/getBillerById")
|
||||
public String getBillerById(@RequestBody BillerDetailRequest billerRequestRequest) {
|
||||
masterDataService.getBillerByBillerId(billerRequestRequest);
|
||||
return "Abc";
|
||||
}
|
||||
|
||||
/** Get All Masters API Fetch All Category from BBPS URL **/
|
||||
@GetMapping("/getAllMasters")
|
||||
public ResponseEntity<List<MasterApiResponse>> fetchMasterData(
|
||||
@Validated @RequestBody MerchantRequestModel requestModel, HttpServletRequest request) {
|
||||
LOGGER.info("Fetching Master Data Registered URL");
|
||||
return masterDataService.getMasterData(requestModel, request);
|
||||
}
|
||||
|
||||
/** Get Master Category Wise API Fetch Category Wise from BBPS URL **/
|
||||
@GetMapping("/getMasterCategoryWise")
|
||||
public ResponseEntity<BillerResponse> getMasterDataCategoryWise(
|
||||
@Validated @RequestBody MerchantRequestModel requestModel, HttpServletRequest request,
|
||||
@RequestParam String category, @RequestParam(defaultValue = "0") int pageStart, @RequestParam int pageEnd) {
|
||||
|
||||
LOGGER.info("Request received: category=" + category + ", pageNumber=" + pageStart + ", pageSize=" + pageEnd);
|
||||
return masterDataService.fetchMasterDataCategoryWise(requestModel,category, pageStart, pageEnd);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user