Browse Source

*****台中市政府 遠傳 特殊修改*****
1.需求:電樁只要刷卡都給過
修改方式: 目前套用LocalService

Jessica Tseng 3 years ago
parent
commit
997b465cc7

+ 1 - 1
EVCB_OCPP.WSServer/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("62947b8")]
+[assembly: AssemblyInformationalVersion("d62849b")]

+ 2 - 47
EVCB_OCPP.WSServer/Service/LocalBusinessService.cs

@@ -21,54 +21,9 @@ namespace EVCB_OCPP.WSServer.Service
 
         async public Task<IdTagInfo> Authorize(string chargeBoxId, string idTag)
         {
-            await Task.Delay(10);
-            IdTagInfo info = new IdTagInfo() { status = AuthorizationStatus.Invalid };
-            try
-            {
-
-                OuterHttpClient _client = new OuterHttpClient();
-
-
-                string url = ConfigurationManager.AppSettings["LocalAuthAPI"];
-
-
-                HttpClientService service = new HttpClientService();
-
-                Dictionary<string, string> postData = new Dictionary<string, string>()
-                {
-                  { "ChargeBoxId", chargeBoxId },
-                  { "IdTag", idTag },
-
-
-                };
-                var _innerresult = await service.PostFormDataAsync(url, postData, null);
-
-
-                if (_innerresult.StatusCode == HttpStatusCode.OK)
-                {
-                    JObject jo = JObject.Parse(_innerresult.Response);
-                    if (jo["code"].ToString() == "1")
-                    {
-                        try
-                        {
-                            info.status = (AuthorizationStatus)Enum.Parse(typeof(AuthorizationStatus), jo["message"].ToString());
-                        }
-                        catch (Exception)
-                        {
-                            ;
-                        }
-
-
-                    }
-
-                }
+            await Task.Delay(10);          
 
-            }
-            catch (Exception ex)
-            {
-                ;
-            }
-            return info;
+            return new IdTagInfo() { expiryDate = DateTime.UtcNow.AddDays(1), status = AuthorizationStatus.Accepted };
 
         }