Commit a7c4bf9d authored by Kali Padhi's avatar Kali Padhi

PE Url added

parent b09014b4
......@@ -5,6 +5,7 @@ import com.nisum.offertransactionservice.model.OfferTransactionResponse;
import com.nisum.offertransactionservice.model.PERequest;
import com.nisum.offertransactionservice.model.PEResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.http.*;
import org.springframework.web.client.*;
......@@ -14,15 +15,16 @@ public class OfferDao {
@Autowired
private RestTemplate restTemplate;
//TODO add promotionEngine url.
private static final String promotionEngineUrl = "";
@Value("${promotion.engine.calaculate.dicount.url}")
private String promotionEngineUrl ;
public OfferTransactionResponse convertions(OfferTransactionRequest offerTransactionRequest) {
return null;
}
public PEResponse callPE(PERequest peRequest) {
ResponseEntity<PEResponse> peResponse = restTemplate.exchange(promotionEngineUrl, HttpMethod.POST, HttpEntity.EMPTY, PEResponse.class);
ResponseEntity<PEResponse> peResponse = restTemplate.exchange("http://localhost:8081"+promotionEngineUrl, HttpMethod.POST, HttpEntity.EMPTY, PEResponse.class);
return peResponse.getBody();
}
}
......@@ -3,3 +3,6 @@
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/user
spring.datasource.username=user
spring.datasource.password=password123
promotion.engine.calaculate.dicount.url=/promotionEngine/calculateDiscount
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