Maj Vers 7.10

This commit is contained in:
Nicolas Héron 2018-09-03 17:23:14 +02:00
commit 9650ba55e9
4 changed files with 17 additions and 5 deletions

View file

@ -34,12 +34,14 @@ public class QuoteController {
@Resource
private UsedRestAPI serviceCalculate;
@RequestMapping(value = "/calculate/{containerId}", method = RequestMethod.PUT)
@RequestMapping(value = "/calculate/{containerId:.+}/{className:.+}", method = RequestMethod.PUT)
public Quote storeTicket(@PathVariable("containerId") String containerid,
@PathVariable("className") String className,
@RequestBody Quote quoteRequest) {
Quote response = null;
try {
response = (Quote) serviceCalculate.runSession(containerid, "swimmingpool.P000", Quote.class.getCanonicalName(), quoteRequest);
// response = (Quote) serviceCalculate.runSession(containerid, "swimmingpool.P000", Quote.class.getCanonicalName(), quoteRequest);
response = (Quote) serviceCalculate.runSession(containerid, "swimmingpool.P000", className, quoteRequest);
} catch (Exception e) {
e.printStackTrace();
}

View file

@ -67,6 +67,7 @@ productManagerModule.controller('quoteManagerController', function ($scope, $htt
$http.defaults.headers.post["Content-Type"] = "application/json";
$scope.allSessionExecutionDetails = [];
$scope.containerid = "dev";
$scope.aClassName = "org.training.leisure.swimmingpool.Quote";
var _lastGoodResult = '';
$scope.toPrettyJSON = function (objStr, tabWidth) {
try {
@ -106,7 +107,7 @@ productManagerModule.controller('quoteManagerController', function ($scope, $htt
$scope.calculatePrice = function () {
var myQuote = $scope.quote;
$http.put(urlBase + "/swimmingpool-web/quote/calculate/" + $scope.containerid, myQuote).success(function (data) {
$http.put(urlBase + "/swimmingpool-web/quote/calculate/" + $scope.containerid + "/" + $scope.aClassName, myQuote).success(function (data) {
$scope.quoteResult = data;
$scope.allSessionExecutionDetails = JSON.parse(data.sessionLogging);
$scope.sessionLogging = JSON.stringify($scope.allSessionExecutionDetails, null, 3);

View file

@ -33,9 +33,16 @@
<div class="col-md-1"></div>
<div class="col-md-10">
<table class="table table-bordered">
<tr>
<td><label for="containerid" class="control-label">Container id :</label></td>
<td><input id="containerid" type="text" ng-model="containerid" ng-maxlength="10"/></td>
<td><input id="containerid" type="text" ng-model="containerid" ng-maxlength="30"/></td>
<td><label for="aClassName" class="control-label">Class name :</label></td>
<td><input id="aClassName" type="text" ng-model="aClassName" ng-maxlength="50"/></td>
</tr>
<tr>
<td><label for="quote-date" class="control-label">Quote date :</label></td>
<td><input id="quote-date" type="date" ng-model="quote.quoteDate" ng-maxlength="10"/></td>