lith 5 年之前
父节点
当前提交
e770e319ae
共有 6 个文件被更改,包括 38 次插入154 次删除
  1. 20 7
      Sqler/Module/Sqler/Logical/SqlerHelp.cs
  2. 3 1
      Sqler/Program.cs
  3. 4 13
      Sqler/Properties/launchSettings.json
  4. 6 7
      Sqler/Sqler.csproj
  5. 4 2
      Sqler/Startup.cs
  6. 1 124
      Sqler/appsettings.json

+ 20 - 7
Sqler/Module/Sqler/Logical/SqlerHelp.cs

@@ -2,6 +2,7 @@
 using Sqler.Module.Sqler.Logical.DataEditor;
 using Sqler.Module.Sqler.Logical.DataEditor;
 using System;
 using System;
 using System.IO;
 using System.IO;
+using System.Threading.Tasks;
 using Vit.Core.Module.Log;
 using Vit.Core.Module.Log;
 using Vit.Core.Util.ConfigurationManager;
 using Vit.Core.Util.ConfigurationManager;
 using Vit.Extensions;
 using Vit.Extensions;
@@ -46,11 +47,11 @@ namespace Sqler.Module.Sqler.Logical
             if (di.Exists)
             if (di.Exists)
             {
             {
                 SqlDataPath = di.FullName;
                 SqlDataPath = di.FullName;
-                Logger.Info("[Sqler] Data文件夹路径:"+ SqlDataPath);
+                Logger.Info("[Sqler] Data Directory:" + SqlDataPath);
             }
             }
             else 
             else 
             {
             {
-                throw new Exception("指定的Data文件夹路径("+ dataDirectoryPath + ")不存在");
+                throw new Exception("Data Directory(" + dataDirectoryPath + ") does not exist");
             }
             }
         }
         }
         #endregion
         #endregion
@@ -69,6 +70,7 @@ namespace Sqler.Module.Sqler.Logical
         #region static Init
         #region static Init
         public static void Init()
         public static void Init()
         {
         {
+            Logger.Info("init Sqler...");
             #region init member        
             #region init member        
             sqlerConfig = new JsonFile(GetDataFilePath("sqler.json"));
             sqlerConfig = new JsonFile(GetDataFilePath("sqler.json"));
 
 
@@ -80,7 +82,7 @@ namespace Sqler.Module.Sqler.Logical
 
 
 
 
 
 
-            DataEditorHelp.Init();
+          
 
 
 
 
             #region SqlRun
             #region SqlRun
@@ -94,9 +96,18 @@ namespace Sqler.Module.Sqler.Logical
 
 
             #region DataEditor
             #region DataEditor
             {
             {
-                //config
-                AutoTemp.Controllers.AutoTempController.RegistDataProvider( 
-                    new global::Sqler.Module.Sqler.Logical.DataEditor.ConfigRepository().ToDataProvider("Sqler_DataEditor_Config"));
+                Task.Run(()=>{
+
+                    Logger.Info("init Sqler-DataEditor...");
+                    //init
+                    DataEditorHelp.Init();
+
+                    //RegistDataProvider
+                    AutoTemp.Controllers.AutoTempController.RegistDataProvider(
+                        new global::Sqler.Module.Sqler.Logical.DataEditor.ConfigRepository().ToDataProvider("Sqler_DataEditor_Config"));
+
+                    Logger.Info("init Sqler-DataEditor succeed!");
+                });
             }
             }
             #endregion
             #endregion
 
 
@@ -110,7 +121,9 @@ namespace Sqler.Module.Sqler.Logical
 
 
 
 
             // SqlVersion
             // SqlVersion
-            SqlVersion.SqlVersionHelp.Init();             
+            SqlVersion.SqlVersionHelp.Init();
+
+            Logger.Info("inited Sqler!");
 
 
         }
         }
         #endregion
         #endregion

+ 3 - 1
Sqler/Program.cs

@@ -11,6 +11,8 @@ namespace Sqler
         {
         {
             try
             try
             {
             {
+                Logger.Info("[Sqler] version: "+ System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location).FileVersion );
+
                 Sqler.Module.Sqler.Logical.SqlerHelp.InitSqlDataPath(args);
                 Sqler.Module.Sqler.Logical.SqlerHelp.InitSqlDataPath(args);
                 CreateWebHostBuilder(args).Build().Run();
                 CreateWebHostBuilder(args).Build().Run();
             }
             }
@@ -23,7 +25,7 @@ namespace Sqler
 
 
         public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
         public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
             WebHost.CreateDefaultBuilder(args)
             WebHost.CreateDefaultBuilder(args)
-            .UseSerslot()
+            //.UseSerslot()
             .UseUrls(Vit.Core.Util.ConfigurationManager.ConfigurationManager.Instance.GetByPath<string[]>("server.urls"))
             .UseUrls(Vit.Core.Util.ConfigurationManager.ConfigurationManager.Instance.GetByPath<string[]>("server.urls"))
             .UseStartup<Startup>()
             .UseStartup<Startup>()
             .UseVitConfig()
             .UseVitConfig()

+ 4 - 13
Sqler/Properties/launchSettings.json

@@ -8,25 +8,16 @@
     }
     }
   },
   },
   "profiles": {
   "profiles": {
-    "IIS Express": {
-      "commandName": "IISExpress",
-      "launchBrowser": true,
-      "launchUrl": "sqler/index.html",
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      }
-    },
-    "Console": {
+    "web": {
       "commandName": "Project",
       "commandName": "Project",
       "launchBrowser": true,
       "launchBrowser": true,
       "launchUrl": "sqler/index.html",
       "launchUrl": "sqler/index.html",
       "applicationUrl": "http://localhost:4570/"
       "applicationUrl": "http://localhost:4570/"
     },
     },
-    "Web": {
+    "console": {
       "commandName": "Project",
       "commandName": "Project",
-      "launchBrowser": true,
-      "launchUrl": "sqler/index.html",
-      "applicationUrl": "http://localhost:4570/"
+      "launchBrowser": false
     }
     }
+
   }
   }
 }
 }

+ 6 - 7
Sqler/Sqler.csproj

@@ -5,7 +5,7 @@
     <ApplicationIcon />
     <ApplicationIcon />
     <OutputType>Exe</OutputType>
     <OutputType>Exe</OutputType>
     <StartupObject /> 
     <StartupObject /> 
-    <Version>2.1.17.77</Version>
+    <Version>2.1.18.2</Version>
     <Description>https://github.com/sersms/Sqler</Description>
     <Description>https://github.com/sersms/Sqler</Description>
     <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
     <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
     <PreserveCompilationContext>true</PreserveCompilationContext>
     <PreserveCompilationContext>true</PreserveCompilationContext>
@@ -23,12 +23,11 @@
     <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" /> 
     <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" /> 
   </ItemGroup>
   </ItemGroup>
 
 
-  <ItemGroup>
-    <PackageReference Include="Sers.Serslot" Version="2.1.1.341" />
-    <PackageReference Include="Vit.Db" Version="2.1.1.341" />   
-    <PackageReference Include="Vit.Orm.EntityFramework.Dynamic" Version="2.1.1.341" />
-    <PackageReference Include="Vit.Orm.Dapper" Version="2.1.1.341" />
-    <PackageReference Include="Vit.WebHost" Version="2.1.1.341" />
+  <ItemGroup> 
+    <PackageReference Include="Vit.Db" Version="2.1.1.345" />   
+    <PackageReference Include="Vit.Orm.EntityFramework.Dynamic" Version="2.1.1.345" />
+    <PackageReference Include="Vit.Orm.Dapper" Version="2.1.1.345" />
+    <PackageReference Include="Vit.WebHost" Version="2.1.1.345" />
   </ItemGroup>  
   </ItemGroup>  
   
   
   
   

+ 4 - 2
Sqler/Startup.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Threading.Tasks;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc;
@@ -28,7 +29,7 @@ namespace Sqler
             services.AddMvc(options =>
             services.AddMvc(options =>
             {
             {
                 //使用自定义异常处理器
                 //使用自定义异常处理器
-                options.Filters.Add<Sers.Serslot.ExceptionFilter.ExceptionFilter>();
+                //options.Filters.Add<Sers.Serslot.ExceptionFilter.ExceptionFilter>();
             })
             })
             .AddJsonOptions(options =>
             .AddJsonOptions(options =>
             {
             {
@@ -106,7 +107,8 @@ namespace Sqler
 
 
 
 
             //SqlerHelp
             //SqlerHelp
-            Sqler.Module.Sqler.Logical.SqlerHelp.Init();
+            Task.Run(Sqler.Module.Sqler.Logical.SqlerHelp.Init);
+            //Sqler.Module.Sqler.Logical.SqlerHelp.Init();
 
 
         }
         }
     }
     }

+ 1 - 124
Sqler/appsettings.json

@@ -40,130 +40,7 @@
   "Sqler": {
   "Sqler": {
     /* Data文件夹的路径, 优先从arg第一个参数获取,其次是这里,若不指定则默认为"Data" */
     /* Data文件夹的路径, 优先从arg第一个参数获取,其次是这里,若不指定则默认为"Data" */
     "//DataPath": "Data"
     "//DataPath": "Data"
-  },
-
-
-
-
-  "//Sers": {
-    /* 通讯层配置 */
-    "CL": {
-      /* 共用配置,子项共用,覆写子项未指定的配置 */
-      "Config": {
-
-        /* 请求超时时间(单位ms,默认60000) */
-        "requestTimeoutMs": 60000,
-
-        /* 后台处理消息的线程个数(单位个,默认2) */
-        "workThreadCount": 2,
-
-        //HeartBeat
-        /* 心跳检测时间间隔(单位ms,默认10000,若指定为0则不进行心跳检测) */
-        "heartBeatIntervalMs": 10000,
-        /* 心跳检测超时时间(单位ms,默认30000) */
-        "heartBeatTimeoutMs": 30000,
-        /* 心跳检测失败重试次数(单位次,默认10) */
-        "heartBeatRetryCount": 10,
-
-        /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */
-        "secretKey": "SersCL"
-      },
-      /* one conn is one channel.can be multiable */
-      "Client": [
-        {
-          // Socket.Iocp
-          /* (x.1) type - Iocp */
-          /* 在此Assembly中查找builder */
-          //"assemblyFile": "Sers.CL.Socket.Iocp.dll",
-          /* the class of builder in assemblyFile  */
-          "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
-
-
-          /* (x.2) conn config */
-          /* 服务端 host地址。例如: "127.0.0.1"、"sersms.com" */
-          "host": "127.0.0.1",
-          /* 服务端 监听端口号。例如: 4501 */
-          "port": 4501
-        }
-      ]
-    },
-
-
-    /* LocalApiService 配置,可不指定 */
-    "LocalApiService": {
-
-      /* 后台服务的线程个数(单位个,默认0,代表不开启服务) */
-      "workThreadCount": 16,
-
-      /* 静态文件映射器。映射站点静态文件,可多个,可不指定 */
-      "StaticFileMap": [
-        {
-          /* api路由前缀,例如 "/demo/ui/*" */
-          "route": "/autotemp/*",
-          /* api描述,静态文件描述 */
-          "apiName": "autotemp站点静态文件",
-          /* 额外静态文件类型映射配置的文件路径(mappings.json),例如"wwwroot/mappings.json"。若不指定(或指定的文件不存在)则不添加额外文件类型映射配置 */
-          //"ContentTypeMapFile": "mappings.json",
-          /* 静态文件的路径,如 "wwwroot/demo" */
-          "staticFileDirectory": "wwwroot/autotemp"
-        },
-        {
-          /* api路由前缀,例如 "/demo/ui/*" */
-          "route": "/sqler/*",
-          /* api描述,静态文件描述 */
-          "apiName": "sqler站点静态文件",
-          /* 额外静态文件类型映射配置的文件路径(mappings.json),例如"wwwroot/mappings.json"。若不指定(或指定的文件不存在)则不添加额外文件类型映射配置 */
-          //"ContentTypeMapFile": "mappings.json",
-          /* 静态文件的路径,如 "wwwroot/demo" */
-          "staticFileDirectory": "wwwroot/sqler"
-        }
-      ]
-
-    },
-
-
-    /* ServiceStation配置,可不指定 */
-    "ServiceStation": {
-
-      /* serviceStation站点信息 */
-      "serviceStationInfo": {
-        "serviceStationName": "autotemp"
-      }
-    }
-  },
-
-
-
-  "serslot": {
-
-    /* 额外api。SsApiDesc格式。除了系统api外,可以指定额外api。若指定返回数据(reply),则直接返回数据;若不指定返回数据,则由host进行处理 */
-    "//extApi": [
-      {
-        "description": "用户必须登录",
-        //路由(可为范接口,如 "/a/*" )
-        "route": "/index.html",
-        //扩展配置(json)
-        "extendConfig": {
-          //请求方式,若不指定则默认支持所有方式(demo: POST、GET、DELETE、PUT等)
-          "httpMethod": "GET",
-
-          //返回数据(可为数值、字符串、对象、数组)。若不指定,则由host进行处理
-          "reply": { "hello": "sers" },
-
-          //系统生成的接口文字描述
-          "sysDesc": "method:GET"
-        }
-      },
-      {
-        //路由(可为范接口,如 "/a/*" )
-        "route": "/*"
-      }
-
-    ]
-
-  },
-
-
+  },  
 
 
 
 
   /* Vit工具配置,可不指定 */
   /* Vit工具配置,可不指定 */