Browse Source

add main db commit 9bfa63004
fIx 寫死web 資料庫寫死指向 StandardOCPP_Web 問題

Robert 1 year ago
parent
commit
94119e656b

+ 4 - 2
EVCB_OCPP.WSServer/Jobs/SmartChargingJob.cs

@@ -42,8 +42,10 @@ public class SmartChargingJob : IJob
         List<StationInfoDto> stations = null;
         using (SqlConnection conn = await webDbConnectionFactory.CreateAsync())
         {
-            string strSql = "SELECT[Id],[LBMode],[LBCurrent] as Availability FROM[StandardOCPP_Web].[dbo].[Station]" +
-             "where LBMode = 1; ";
+            string strSql = """
+                SELECT [Id],[LBMode],[LBCurrent] as Availability FROM [dbo].[Station]
+                WHERE LBMode = 1; 
+                """;
             var result = await conn.QueryAsync<StationInfoDto>(strSql);
             stations = result.ToList();
         }

+ 1 - 2
EVCB_OCPP.WSServer/Service/WebDbService.cs

@@ -24,11 +24,10 @@ public class WebDbService
 
     public async Task<List<string>> GetDenyModelNames()
     {
-        return new List<string>() { "" };
         using SqlConnection conn = await webDbConnectionFactory.CreateAsync();
         string strSql = """
                 SELECT [Value] 
-                FROM [StandardOCPP_Web].[dbo].[KernelConfig]
+                FROM [dbo].[KernelConfig]
                 where SystemKey = 'DenyModelNames';
                 """;