Przeglądaj źródła

2020/06/15 Jessica
Actions:
1. Fix internal clear chargingprofile url : chargeprofile => chargingprofile

Jessica.Tseng 4 lat temu
rodzic
commit
7187093d99

+ 1 - 1
EVCB_OCPP.WEBAPI/Controllers/Version1/CPOController.cs

@@ -587,7 +587,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                 CustomerService _customer = new CustomerService();
 
 
-                string urlformat = "http://localhost:{0}/api/v1/ocpp16/chargeprofile?ChargeBoxId={1}{2}";
+                string urlformat = "http://localhost:{0}/api/v1/ocpp16/chargingprofile?ChargeBoxId={1}{2}";
 
                 var _innerResult = await _client.Delete(string.Format(urlformat, Request.RequestUri.Port, ChargeBoxId, ChargeProfileId == -1 ? "" : "&Id=" + ChargeProfileId), new Dictionary<string, string>()
                         {

+ 33 - 1
EVCB_OCPP.WEBAPI/Controllers/Version1/InternalController.cs

@@ -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]

BIN
EVCB_OCPP.WEBAPI/UploadFiles/Diagnostics/BodyPart_23d8a838-3a82-4440-aa5b-6b53c05405ab


BIN
EVCB_OCPP.WEBAPI/UploadFiles/Diagnostics/BodyPart_68b4875f-c7a2-4ceb-9256-2b9cd961d7ca


BIN
EVCB_OCPP.WEBAPI/UploadFiles/Diagnostics/BodyPart_9d02b1a2-2da9-4c10-81c0-176524bc23c4


BIN
EVCB_OCPP.WEBAPI/UploadFiles/Diagnostics/BodyPart_cf7c6cf3-b584-4bf8-9e5b-df1a44540903


BIN
EVCB_OCPP.WEBAPI/UploadFiles/Diagnostics/BodyPart_f6095bbf-6907-42ed-949b-f05eac406ba0


BIN
EVCB_OCPP.WEBAPI/UploadFiles/Diagnostics/BodyPart_fb9a980a-fea7-4133-9c3c-63a9d0c5398b


BIN
EVCB_OCPP.WEBAPI/UploadFiles/Diagnostics/RemoteTriggerAPP_V1.1.3.zip