|
@@ -23,7 +23,7 @@ using StartTransactionRequest = EVCB_OCPP.WEBAPI.Models.WebAPI.StartTransactionR
|
|
|
namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
{
|
|
|
[RoutePrefix("api/v1/ocpp16")]
|
|
|
- //[InernalAuthentication]
|
|
|
+ [InernalAuthentication]
|
|
|
public class InternalV1Controller : ApiController
|
|
|
{
|
|
|
|
|
@@ -42,12 +42,12 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
if (!IsValidEnum<Internal_Actions>(OrderNo) || string.IsNullOrEmpty(ChargeBoxId))
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
if (!chargePointService.Exists(ChargeBoxId))
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
ServerTriggerService triggerService = new ServerTriggerService();
|
|
@@ -55,10 +55,10 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
if (excution == null)
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_DATA_NOTFOUND });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_DATA_NOTFOUND });
|
|
|
}
|
|
|
|
|
|
- result.Message = JsonConvert.SerializeObject(excution, EVCBlConfiguration.JSONSERIALIZER_FORMAT);
|
|
|
+ result.Message = JsonConvert.SerializeObject(excution, EVCBConfiguration.JSONSERIALIZER_FORMAT);
|
|
|
statusCode = HttpStatusCode.OK;
|
|
|
|
|
|
}
|
|
@@ -67,7 +67,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "CommandofExecution", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "CommandofExecution", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -91,7 +91,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
@@ -100,7 +100,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
!(Availiability.AvailabilityType > 0 && Availiability.AvailabilityType < 3))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
//create reqest
|
|
@@ -126,7 +126,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "Availability", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "Availability", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -152,7 +152,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
@@ -160,7 +160,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
(string.IsNullOrEmpty(SingleConfiguration.Key) || string.IsNullOrEmpty(SingleConfiguration.Value)))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
//create reqest
|
|
@@ -184,7 +184,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ChangeConfiguration", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ChangeConfiguration", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -208,14 +208,14 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
|
if (string.IsNullOrEmpty(Keys) || Keys.Split('/').Count() > 20)
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
//create reqest
|
|
@@ -238,7 +238,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "GetConfiguration", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "GetConfiguration", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -263,7 +263,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
@@ -273,7 +273,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|| (!string.IsNullOrEmpty(StopTime) && !DateTime.TryParse(StopTime, out vaildtime)))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
//create reqest
|
|
@@ -301,7 +301,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "GetDiagonostics", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "GetDiagonostics", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -326,7 +326,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
if (!AddCommandtoServer(ChargeBoxId, uuid, new GetLocalListVersionRequest()))
|
|
@@ -341,7 +341,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "GetLocallistversion", ex.ToString()) });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "GetLocallistversion", ex.ToString()) });
|
|
|
}
|
|
|
|
|
|
return Request.CreateResponse(statusCode, result);
|
|
@@ -363,7 +363,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
@@ -375,13 +375,13 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
!(StartTransaction.ChargingProfile != null && StartTransaction.ChargingProfile.chargingSchedule != null && IsValidEnum<ChargingRateUnitType>((int)StartTransaction.ChargingProfile.chargingSchedule.chargingRateUnit)))
|
|
|
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
if (StartTransaction.ConnectorId.HasValue && chargePointService.GetChargePointCurrentSatus(ChargeBoxId, StartTransaction.ConnectorId.Value).HasValue &&
|
|
|
chargePointService.GetChargePointCurrentSatus(ChargeBoxId, StartTransaction.ConnectorId.Value).Value != ChargePointStatus.Available)
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -427,7 +427,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "StopTransaction", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "StopTransaction", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -450,13 +450,13 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
if (!chargePointService.GetChargePointCurrentSatus(ChargeBoxId, TransactionId % 10).HasValue)
|
|
|
{
|
|
|
//offline
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -475,7 +475,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_SESSION_WAS_FINISHED });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_SESSION_WAS_FINISHED });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -488,7 +488,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "StopTransaction", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "StopTransaction", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -510,7 +510,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -523,14 +523,14 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
!DateTime.TryParse(ReserveNow.ExpiryDate, out expiryDate))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
expiryDate = DateTime.SpecifyKind(DateTime.Parse(ReserveNow.ExpiryDate), DateTimeKind.Utc);
|
|
|
|
|
|
if (DateTime.Compare(DateTime.UtcNow, expiryDate) >= 0)
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
var connectorStatus = chargePointService.GetChargePointCurrentSatus(ChargeBoxId, ReserveNow.ConnectorId);
|
|
@@ -560,7 +560,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -571,7 +571,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ReserveNow", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ReserveNow", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -594,7 +594,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
var connectorStatus = chargePointService.GetChargePointCurrentSatus(ChargeBoxId, 0);
|
|
@@ -619,7 +619,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -629,7 +629,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "CancelResrvation", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "CancelResrvation", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -652,7 +652,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
var connectorStatus = chargePointService.GetChargePointCurrentSatus(ChargeBoxId, 0);
|
|
@@ -677,7 +677,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -687,7 +687,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "Reset", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "Reset", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -710,7 +710,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
@@ -719,7 +719,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|| (LocalList.LocalAuthorizationList != null && LocalList.LocalAuthorizationList.Count == 0))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
bool badRequest = false;
|
|
@@ -734,7 +734,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
if (badRequest)
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
localAuthorizationList.Add(new AuthorizationData()
|
|
|
{
|
|
@@ -770,7 +770,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ClearCache", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ClearCache", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -794,7 +794,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
var connectorStatus = chargePointService.GetChargePointCurrentSatus(ChargeBoxId, 0);
|
|
@@ -812,7 +812,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -822,7 +822,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ClearCache", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ClearCache", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -846,7 +846,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
@@ -858,7 +858,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
!(ChargingProfile.ChargingProfile != null && IsValidEnum<ChargingProfilePurposeType>((int)ChargingProfile.ChargingProfile.chargingProfilePurpose)) ||
|
|
|
!(ChargingProfile.ChargingProfile != null && ChargingProfile.ChargingProfile.chargingSchedule != null && IsValidEnum<ChargingRateUnitType>((int)ChargingProfile.ChargingProfile.chargingSchedule.chargingRateUnit)))
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
var request = new SetChargingProfileRequest()
|
|
@@ -901,7 +901,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "StopTransaction", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "StopTransaction", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -924,7 +924,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
var connectorStatus = chargePointService.GetChargePointCurrentSatus(ChargeBoxId, 0);
|
|
@@ -950,7 +950,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -960,7 +960,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ClearChargingProfile", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "ClearChargingProfile", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -983,14 +983,14 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
|
if (triggerMessage == null || !(triggerMessage.TriggerType >= 1 && triggerMessage.TriggerType <= (int)MessageTrigger.StatusNotification))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
//create reqest
|
|
@@ -1016,7 +1016,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "TriggerMessage", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "TriggerMessage", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -1039,14 +1039,14 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
|
if (ConnectorId < 0)
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
//create reqest
|
|
@@ -1071,7 +1071,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse()
|
|
|
{
|
|
|
- Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "UnlockConnector", ex.ToString())
|
|
|
+ Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "UnlockConnector", ex.ToString())
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -1096,7 +1096,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
if (!chargePointService.IsOnline(ChargeBoxId))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
|
|
|
//check parameter
|
|
@@ -1104,7 +1104,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
!(ChargingRateUnit != -1 && ChargingRateUnit > 0 && ChargingRateUnit < 3))
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBlConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1127,7 +1127,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
|
|
|
- return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = string.Format(EVCBlConfiguration.ERRORMESSAGE_FORMAT, EVCBlConfiguration.ERROR_MSG_UNEXPECTEDERROR, "GetLocallistversion", ex.ToString()) });
|
|
|
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "GetLocallistversion", ex.ToString()) });
|
|
|
}
|
|
|
|
|
|
return Request.CreateResponse(statusCode, result);
|