|
@@ -10,6 +10,7 @@ using EVCB_OCPP.WEBAPI.Handlers;
|
|
|
using EVCB_OCPP.WEBAPI.Models.WebAPI;
|
|
|
using EVCB_OCPP.WEBAPI.Services;
|
|
|
using Newtonsoft.Json;
|
|
|
+using Newtonsoft.Json.Linq;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.ComponentModel;
|
|
@@ -920,6 +921,37 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
[HttpPost]
|
|
|
public HttpResponseMessage SetChargingProfile(string ChargeBoxId, [FromBody]ChargingProfileRequest ChargingProfile)
|
|
|
{
|
|
|
+ var tt = new ChargingProfileRequest()
|
|
|
+ {
|
|
|
+ ChargingProfile = new AdvancedChargingProfiles()
|
|
|
+ {
|
|
|
+ chargingProfileId = 444,
|
|
|
+ chargingProfileKind = ChargingProfileKindType.Absolute,
|
|
|
+ chargingProfilePurpose = ChargingProfilePurposeType.ChargePointMaxProfile,
|
|
|
+ chargingSchedule = new ChargingScheduleBase()
|
|
|
+ {
|
|
|
+ chargingRateUnit = ChargingRateUnitType.A,
|
|
|
+ chargingSchedulePeriod = new List<ChargingSchedulePeriod>()
|
|
|
+ {
|
|
|
+ new ChargingSchedulePeriod(){ limit=1, startPeriod=10}
|
|
|
+ },
|
|
|
+ duration = 30000,
|
|
|
+ minChargingRate = 10,
|
|
|
+ startSchedule = DateTime.Now
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ recurrencyKind = RecurrencyKindType.Daily,
|
|
|
+ stackLevel = 1,
|
|
|
+
|
|
|
+ },
|
|
|
+ connectorId = 1
|
|
|
+ };
|
|
|
+
|
|
|
+ var serialization = JsonConvert.SerializeObject(tt);
|
|
|
+ var array = JsonConvert.DeserializeObject<JArray>(serialization);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
string uuid = Guid.NewGuid().ToString();
|
|
|
var result = new InternalGenericResponse();
|
|
@@ -996,7 +1028,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
return Request.CreateResponse(statusCode, result);
|
|
|
}
|
|
|
|
|
|
- [Route("chargeprofile")]
|
|
|
+ [Route("chargingprofile")]
|
|
|
[ResponseType(typeof(ErrorResponse))]
|
|
|
[ResponseType(typeof(InternalGenericResponse))]
|
|
|
[HttpDelete]
|