Commit be6ab6a5 authored by sgandhi's avatar sgandhi

changes

parent a40d83ea
package com.nisum.offertransactionservice.controller;
import com.nisum.offertransactionservice.model.OfferTransactionRequest;
import com.nisum.offertransactionservice.model.OfferTransactionResponse;
import com.nisum.offertransactionservice.service.OfferCallingPEService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class OfferTransactionController {
@Autowired
private OfferCallingPEService offerCallingPEService;
@PostMapping("offerTransactionCall")
public OfferTransactionResponse getOfferTransactionResponse(@RequestBody OfferTransactionRequest offerTransactionRequest){
return offerCallingPEService.getDiscountedItemList(offerTransactionRequest);
}
}
...@@ -9,8 +9,6 @@ import org.springframework.stereotype.Component; ...@@ -9,8 +9,6 @@ import org.springframework.stereotype.Component;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.web.client.*; import org.springframework.web.client.*;
import java.util.concurrent.CompletableFuture;
@Component @Component
public class OfferDao { public class OfferDao {
......
...@@ -20,7 +20,8 @@ public class OfferCallingPEService { ...@@ -20,7 +20,8 @@ public class OfferCallingPEService {
private PEResponseToOfferTransactionResConverter peResponseToOfferTransactionResConverter; private PEResponseToOfferTransactionResConverter peResponseToOfferTransactionResConverter;
public OfferTransactionResponse getDiscountedItemList(OfferTransactionRequest offerTransactionRequest) { public OfferTransactionResponse getDiscountedItemList(OfferTransactionRequest offerTransactionRequest) {
OfferTransactionResponse offerTransactionResponse = null; //TODO add db call and get the Offerlookup data
OfferTransactionResponse offerTransactionResponse ;
PEResponse peResponse = offerDao.callPE(offerConverter.apply(offerTransactionRequest)); PEResponse peResponse = offerDao.callPE(offerConverter.apply(offerTransactionRequest));
offerTransactionResponse = peResponseToOfferTransactionResConverter.apply(peResponse); offerTransactionResponse = peResponseToOfferTransactionResConverter.apply(peResponse);
return offerTransactionResponse; return offerTransactionResponse;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment