diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..e56cfa72 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ + +# All files +[*] +indent_style = space +charset = utf-8 +# prevent linux/windows problem +end_of_line = lf + +# Xml files +[*.{xml,csproj}] +indent_size = 2 diff --git a/BotSharp.Channel.FacebookMessenger/BotSharp.Channel.FacebookMessenger.csproj b/BotSharp.Channel.FacebookMessenger/BotSharp.Channel.FacebookMessenger.csproj index d4eb4c0d..4c70e861 100644 --- a/BotSharp.Channel.FacebookMessenger/BotSharp.Channel.FacebookMessenger.csproj +++ b/BotSharp.Channel.FacebookMessenger/BotSharp.Channel.FacebookMessenger.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2 + $(DefaultTargetFramework) @@ -9,8 +9,8 @@ - - + + diff --git a/BotSharp.Channel.FacebookMessenger/ModuleInjector.cs b/BotSharp.Channel.FacebookMessenger/ModuleInjector.cs index b0d23723..4a5f5218 100644 --- a/BotSharp.Channel.FacebookMessenger/ModuleInjector.cs +++ b/BotSharp.Channel.FacebookMessenger/ModuleInjector.cs @@ -1,4 +1,4 @@ -using BotSharp.Core.Modules; +using BotSharp.Core.Modules; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -14,7 +14,7 @@ namespace BotSharp.Channel.FacebookMessenger } - public void Configure(IApplicationBuilder app, IHostingEnvironment env/*, IOptions senparcSetting, IOptions senparcWeixinSetting*/) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env/*, IOptions senparcSetting, IOptions senparcWeixinSetting*/) { } diff --git a/BotSharp.Channel.Weixin/BotSharp.Channel.Weixin.csproj b/BotSharp.Channel.Weixin/BotSharp.Channel.Weixin.csproj index be4faf1e..c5cf908a 100644 --- a/BotSharp.Channel.Weixin/BotSharp.Channel.Weixin.csproj +++ b/BotSharp.Channel.Weixin/BotSharp.Channel.Weixin.csproj @@ -1,16 +1,17 @@ - + - netcoreapp2.2 + $(DefaultTargetFramework) true + + + Haiping Chen https://github.com/Oceania2018/botsharp-channel-weixin git https://github.com/Oceania2018/botsharp-channel-weixin Apache 2.0 botsharp, wechat, wexin, chatbot - 0.1.1.0 - 0.1.1.0 0.1.1 @@ -19,8 +20,8 @@ - - + + diff --git a/BotSharp.Channel.Weixin/Controllers/WeixinAsyncController.cs b/BotSharp.Channel.Weixin/Controllers/WeixinAsyncController.cs index 65e8a44b..fa7ffa11 100644 --- a/BotSharp.Channel.Weixin/Controllers/WeixinAsyncController.cs +++ b/BotSharp.Channel.Weixin/Controllers/WeixinAsyncController.cs @@ -1,8 +1,9 @@ -using BotSharp.Channel.Weixin.Models; +using BotSharp.Channel.Weixin.Models; using BotSharp.Platform.Abstractions; using BotSharp.Platform.Dialogflow.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; +using Senparc.CO2NET.AspNet.HttpUtility; using Senparc.CO2NET.HttpUtility; using Senparc.Weixin.MP; using Senparc.Weixin.MP.Entities.Request; @@ -93,7 +94,7 @@ namespace BotSharp.Channel.Weixin.Controllers messageHandler.RequestDocument.Save(Path.Combine(logPath, string.Format("{0}_Request_{1}_{2}.txt", _getRandomFileName(), messageHandler.RequestMessage.FromUserName, messageHandler.RequestMessage.MsgType))); - if (messageHandler.UsingEcryptMessage) + if (messageHandler.UsingEncryptMessage) { messageHandler.EcryptRequestDocument.Save(Path.Combine(logPath, string.Format("{0}_Request_Ecrypt_{1}_{2}.txt", _getRandomFileName(), messageHandler.RequestMessage.FromUserName, @@ -119,7 +120,7 @@ namespace BotSharp.Channel.Weixin.Controllers messageHandler.ResponseMessage.MsgType))); } - if (messageHandler.UsingEcryptMessage && messageHandler.FinalResponseDocument != null) + if (messageHandler.UsingEncryptMessage && messageHandler.FinalResponseDocument != null) { //记录加密后的响应信息 messageHandler.FinalResponseDocument.Save(Path.Combine(logPath, string.Format("{0}_Response_Final_{1}_{2}.txt", _getRandomFileName(), diff --git a/BotSharp.Channel.Weixin/Models/CustomMessageContext.cs b/BotSharp.Channel.Weixin/Models/CustomMessageContext.cs index 0dd6a67c..e5436b67 100644 --- a/BotSharp.Channel.Weixin/Models/CustomMessageContext.cs +++ b/BotSharp.Channel.Weixin/Models/CustomMessageContext.cs @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------- +/*---------------------------------------------------------------- Copyright (C) 2018 Senparc 文件名:CustomMessageContext.cs @@ -12,18 +12,23 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using System.Xml.Linq; +using Senparc.NeuChar; using Senparc.NeuChar.Context; using Senparc.NeuChar.Entities; +using Senparc.Weixin.MP.MessageContexts; namespace BotSharp.Channel.Weixin.Models { - public class CustomMessageContext : MessageContext + public class CustomMessageContext : DefaultMpMessageContext { public CustomMessageContext() - { + { base.MessageContextRemoved += CustomMessageContext_MessageContextRemoved; } + + /// /// 当上下文过期,被移除时触发的时间 diff --git a/BotSharp.Channel.Weixin/Models/CustomMessageHandler.cs b/BotSharp.Channel.Weixin/Models/CustomMessageHandler.cs index cf28898a..6b5486ba 100644 --- a/BotSharp.Channel.Weixin/Models/CustomMessageHandler.cs +++ b/BotSharp.Channel.Weixin/Models/CustomMessageHandler.cs @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------- +/*---------------------------------------------------------------- Copyright (C) 2018 Senparc 文件名:CustomMessageHandler.cs @@ -112,20 +112,22 @@ namespace BotSharp.Channel.Weixin.Models }; } - public override void OnExecuting() + public override async Task OnExecutingAsync(CancellationToken cancellationToken) { + var CurrentMessageContext = await GetCurrentMessageContext(); //测试MessageContext.StorageData if (CurrentMessageContext.StorageData == null) { CurrentMessageContext.StorageData = 0; } - base.OnExecuting(); + await base.OnExecutingAsync(cancellationToken); } - public override void OnExecuted() + public override async Task OnExecutedAsync(CancellationToken cancellationToken) { - base.OnExecuted(); + var CurrentMessageContext = await GetCurrentMessageContext(); CurrentMessageContext.StorageData = ((int)CurrentMessageContext.StorageData) + 1; + await base.OnExecutedAsync(cancellationToken); } /// diff --git a/BotSharp.Channel.Weixin/ModuleInjector.cs b/BotSharp.Channel.Weixin/ModuleInjector.cs index 28ddb27a..a26f41ba 100644 --- a/BotSharp.Channel.Weixin/ModuleInjector.cs +++ b/BotSharp.Channel.Weixin/ModuleInjector.cs @@ -1,4 +1,4 @@ -using BotSharp.Core.Modules; +using BotSharp.Core.Modules; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -17,7 +17,7 @@ namespace BotSharp.Channel.Weixin .AddSenparcWeixinServices(config); } - public void Configure(IApplicationBuilder app, IHostingEnvironment env/*, IOptions senparcSetting, IOptions senparcWeixinSetting*/) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env/*, IOptions senparcSetting, IOptions senparcWeixinSetting*/) { //https://github.com/Senparc/Senparc.CO2NET/blob/master/Sample/Senparc.CO2NET.Sample.netcore/Startup.cs diff --git a/BotSharp.Core.UnitTest/BotSharp.Core.UnitTest.csproj b/BotSharp.Core.UnitTest/BotSharp.Core.UnitTest.csproj index 9af8eb99..5db15bbf 100644 --- a/BotSharp.Core.UnitTest/BotSharp.Core.UnitTest.csproj +++ b/BotSharp.Core.UnitTest/BotSharp.Core.UnitTest.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2 + $(DefaultTargetFramework) false @@ -11,11 +11,11 @@ - - - - - + + + + + diff --git a/BotSharp.Core/BotSharp.Core.csproj b/BotSharp.Core/BotSharp.Core.csproj index f74d2942..22799830 100644 --- a/BotSharp.Core/BotSharp.Core.csproj +++ b/BotSharp.Core/BotSharp.Core.csproj @@ -1,5 +1,11 @@ - + + + $(DefaultTargetFramework) + true + 0.4.0 + + SAK SAK @@ -10,22 +16,20 @@ - netstandard2.0 - true Haiping Chen SciSharp STACK AI Bot Platform Builder - Open source AI Bot platform builder which is written in C# runs on .Net Core and is enterprise oriented. Integrated with multiple bot engines besides BotSharp bot engine. Modulized pipeline design make NLP tasks plugin easily. Abstract platform and NLP task, migrate existed chatbot from a platform into another platform perfectly through dump and restore. + + Open source AI Bot platform builder which is written in C# runs on .Net Core and is enterprise oriented. Integrated with multiple bot engines besides BotSharp bot engine. Modulized pipeline design make NLP tasks plugin easily. Abstract platform and NLP task, migrate existed chatbot from a platform into another platform perfectly through dump and restore. -If you feel that this project is helpful to you, please Star on the project, we will be very grateful. + If you feel that this project is helpful to you, please Star on the project, we will be very grateful. + git https://github.com/SciSharp/BotSharp NLU, Chatbot, Bot, AI Bot, Artificial Intelligence - 0.4.0 Support dialogue status tracking. Since 2018 Haiping Chen https://github.com/SciSharp/BotSharp - 0.4.0.0 https://raw.githubusercontent.com/SciSharp/BotSharp/master/docs/static/logos/BotSharp.png https://raw.githubusercontent.com/SciSharp/BotSharp/master/LICENSE @@ -61,17 +65,19 @@ If you feel that this project is helpful to you, please Star on the project, we - - - - + + + + + + + + - - - - - - + + + + diff --git a/BotSharp.Core/Modules/IModule.cs b/BotSharp.Core/Modules/IModule.cs index 2f8ed9f9..5202a0d3 100644 --- a/BotSharp.Core/Modules/IModule.cs +++ b/BotSharp.Core/Modules/IModule.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -28,6 +28,6 @@ namespace BotSharp.Core.Modules /// /// Instance of . /// - void Configure(IApplicationBuilder app, IHostingEnvironment env); + void Configure(IApplicationBuilder app, IWebHostEnvironment env); } } diff --git a/BotSharp.Core/Modules/ModulesStartup.cs b/BotSharp.Core/Modules/ModulesStartup.cs index 6e5cb2d2..3f18e4ac 100644 --- a/BotSharp.Core/Modules/ModulesStartup.cs +++ b/BotSharp.Core/Modules/ModulesStartup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -93,7 +93,7 @@ namespace BotSharp.Core.Modules /// /// Instance of . /// - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { foreach (IModule module in this._modules) { diff --git a/BotSharp.Platform.Articulate/BotSharp.Platform.Articulate.csproj b/BotSharp.Platform.Articulate/BotSharp.Platform.Articulate.csproj index 8235e9ed..9efdb2be 100644 --- a/BotSharp.Platform.Articulate/BotSharp.Platform.Articulate.csproj +++ b/BotSharp.Platform.Articulate/BotSharp.Platform.Articulate.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2 + $(DefaultTargetFramework) @@ -9,7 +9,7 @@ - + diff --git a/BotSharp.Platform.Articulate/ModuleInjector.cs b/BotSharp.Platform.Articulate/ModuleInjector.cs index 61f78737..db9564b4 100644 --- a/BotSharp.Platform.Articulate/ModuleInjector.cs +++ b/BotSharp.Platform.Articulate/ModuleInjector.cs @@ -1,4 +1,4 @@ -using BotSharp.Core; +using BotSharp.Core; using BotSharp.Core.AgentStorage; using BotSharp.Core.Modules; using BotSharp.Platform.Articulate.Models; @@ -20,7 +20,7 @@ namespace BotSharp.Platform.Articulate PlatformConfigServiceRegister.Register("articulateAi", services, config); } - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { } diff --git a/BotSharp.Platform.Dialogflow/BotSharp.Platform.Dialogflow.csproj b/BotSharp.Platform.Dialogflow/BotSharp.Platform.Dialogflow.csproj index c8bdaaae..54df0564 100644 --- a/BotSharp.Platform.Dialogflow/BotSharp.Platform.Dialogflow.csproj +++ b/BotSharp.Platform.Dialogflow/BotSharp.Platform.Dialogflow.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.2 + $(DefaultTargetFramework) true 0.2.2 Haiping Chen @@ -18,7 +18,7 @@ - + diff --git a/BotSharp.Platform.Dialogflow/ModuleInjector.cs b/BotSharp.Platform.Dialogflow/ModuleInjector.cs index cfa36689..5fb9c5d7 100644 --- a/BotSharp.Platform.Dialogflow/ModuleInjector.cs +++ b/BotSharp.Platform.Dialogflow/ModuleInjector.cs @@ -1,4 +1,4 @@ -using BotSharp.Core; +using BotSharp.Core; using BotSharp.Core.AgentStorage; using BotSharp.Core.ContextStorage; using BotSharp.Core.Modules; @@ -26,7 +26,7 @@ namespace BotSharp.Platform.Dialogflow ContextStorageServiceRegister.Register(services); } - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { } diff --git a/BotSharp.Platform.Rasa/BotSharp.Platform.Rasa.csproj b/BotSharp.Platform.Rasa/BotSharp.Platform.Rasa.csproj index b326a68b..68ce76a9 100644 --- a/BotSharp.Platform.Rasa/BotSharp.Platform.Rasa.csproj +++ b/BotSharp.Platform.Rasa/BotSharp.Platform.Rasa.csproj @@ -1,11 +1,11 @@ - + - netcoreapp2.2 + $(DefaultTargetFramework) - + diff --git a/BotSharp.WebHost/BotSharp.WebHost.csproj b/BotSharp.WebHost/BotSharp.WebHost.csproj index b017b5e3..930dcd8d 100644 --- a/BotSharp.WebHost/BotSharp.WebHost.csproj +++ b/BotSharp.WebHost/BotSharp.WebHost.csproj @@ -1,30 +1,29 @@ - + - netcoreapp2.2 - Portable;win10-x64;centos.7-x64 + $(DefaultTargetFramework) AnyCPU;x64 Debug;Release; 4ee89154-9131-4e6b-8fd5-d4f04a8d77c4 - TRACE;DEBUG + $(DefineConstants);TRACE;DEBUG - DEBUG;TRACE;RASA + $(DefineConstants);RASA bin\RASA false - DEBUG;TRACE;NETCOREAPP;NETCOREAPP2_1 + $(DefineConstants); - TRACE;DEBUG + $(DefineConstants);TRACE;DEBUG false @@ -72,19 +71,11 @@ - - - - - - - - - - - + + + diff --git a/BotSharp.WebHost/Program.cs b/BotSharp.WebHost/Program.cs index 57d70b4a..306fe011 100644 --- a/BotSharp.WebHost/Program.cs +++ b/BotSharp.WebHost/Program.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; using System; using System.IO; using System.Linq; @@ -10,42 +11,49 @@ namespace BotSharp.WebHost { public static void Main(string[] args) { - BuildWebHost(args).Run(); + CreateHostBuilder(args).Build().Run(); } - public static IWebHost BuildWebHost(string[] args) => - Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(args) - .ConfigureAppConfiguration((hostingContext, config) => + + public static IHostBuilder CreateHostBuilder(string[] args) + { + return Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webHost => { - var env = hostingContext.HostingEnvironment; - string dir = Path.GetFullPath(env.ContentRootPath); - string settingsFolder = Path.Combine(dir, "Settings"); - - // locate setting folder - if (!Directory.Exists(settingsFolder)) + webHost + .ConfigureAppConfiguration((hostingContext, config) => { - dir = Path.GetFullPath(env.ContentRootPath + "/.."); - } + var env = hostingContext.HostingEnvironment; + string dir = Path.GetFullPath(env.ContentRootPath); + string settingsFolder = Path.Combine(dir, "Settings"); - settingsFolder = Path.Combine(dir, "Settings"); + // locate setting folder + if (!Directory.Exists(settingsFolder)) + { + dir = Path.GetFullPath(env.ContentRootPath + "/.."); + } - if (!Directory.Exists(settingsFolder)) - { - dir = Path.GetFullPath(env.ContentRootPath + "/bin"); - } + settingsFolder = Path.Combine(dir, "Settings"); - settingsFolder = Path.Combine(dir, "Settings"); + if (!Directory.Exists(settingsFolder)) + { + dir = Path.GetFullPath(env.ContentRootPath + "/bin"); + } - Console.WriteLine($"Read settings from {settingsFolder}"); + settingsFolder = Path.Combine(dir, "Settings"); - var settings = Directory.GetFiles(settingsFolder, "*.json"); - settings.ToList().ForEach(setting => - { - config.AddJsonFile(setting, optional: false, reloadOnChange: true); - }); - }) - .UseUrls("http://0.0.0.0:3112") - .UseStartup() - .Build(); + Console.WriteLine($"Read settings from {settingsFolder}"); + + var settings = Directory.GetFiles(settingsFolder, "*.json"); + settings.ToList().ForEach(setting => + { + config.AddJsonFile(setting, optional: false, reloadOnChange: true); + }); + }) + .UseUrls("http://0.0.0.0:3112") + .UseStartup(); + + }); + } } } diff --git a/BotSharp.WebHost/Startup.cs b/BotSharp.WebHost/Startup.cs index 370fc526..c05f8078 100644 --- a/BotSharp.WebHost/Startup.cs +++ b/BotSharp.WebHost/Startup.cs @@ -1,9 +1,11 @@ -using BotSharp.Core.Modules; +using BotSharp.Core.Modules; using DotNetToolkit.JwtHelper; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi.Models; using Newtonsoft.Json.Serialization; using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerUI; @@ -15,7 +17,7 @@ using System.Linq; namespace BotSharp.WebHost { - public partial class Startup + public class Startup { public Startup(IConfiguration configuration) { @@ -41,14 +43,15 @@ namespace BotSharp.WebHost }); services.AddJwtAuth(Configuration); - var mvcBuilder = services.AddMvc(options => - { - options.RespectBrowserAcceptHeader = true; - }).AddJsonOptions(options => - { - options.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter()); - options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - }); + services.AddMvc(options => + { + options.RespectBrowserAcceptHeader = true; + }) + .AddNewtonsoftJson(options => + { + options.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter()); + options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + }); //PlatformModuleAssembyLoader.LoadAssemblies(Configuration, assembly => mvcBuilder.AddApplicationPart(assembly)); @@ -56,26 +59,27 @@ namespace BotSharp.WebHost services.AddSwaggerGen(c => { - c.AddSecurityDefinition("Bearer", new ApiKeyScheme() + var scheme = new OpenApiSecurityScheme() { - In = "header", + In = ParameterLocation.Header, Description = "Please insert JWT with Bearer schema. Example: \"Authorization: Bearer {token}\"", Name = "Authorization", - Type = "apiKey" - }); + Type = SecuritySchemeType.ApiKey + }; + c.AddSecurityDefinition("Bearer", scheme); - c.AddSecurityRequirement(new Dictionary> { - { "Bearer", Enumerable.Empty() }, - }); - - var info = Configuration.GetSection("Swagger").Get(); + var info = Configuration.GetSection("Swagger").Get(); c.SwaggerDoc(info.Version, info); - //var filePath = Path.Combine(PlatformServices.Default.Application.ApplicationBasePath, "BotSharp.RestApi.xml"); - //c.IncludeXmlComments(filePath); + var filePath = Path.Combine(AppContext.BaseDirectory, "BotSharp.RestApi.xml"); + if (File.Exists(filePath)) + { + c.IncludeXmlComments(filePath); + } + - c.OperationFilter(); - }); + //c.OperationFilter(); + }).AddSwaggerGenNewtonsoftSupport(); // register platform dependency /*services.AddTransient((provider) => @@ -84,7 +88,7 @@ namespace BotSharp.WebHost });*/ } - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { @@ -95,11 +99,11 @@ namespace BotSharp.WebHost app.UseDefaultFiles(); app.UseStaticFiles(); - + app.UseRouting(); app.UseSwagger(); app.UseSwaggerUI(c => { - var info = Configuration.GetSection("Swagger").Get(); + var info = Configuration.GetSection("Swagger").Get(); c.SupportedSubmitMethods(SubmitMethod.Get, SubmitMethod.Post, SubmitMethod.Put, SubmitMethod.Patch, SubmitMethod.Delete); c.ShowExtensions(); @@ -129,8 +133,11 @@ namespace BotSharp.WebHost await next.Invoke(); }); app.UseAuthentication(); - - app.UseMvc(); + app.UseAuthorization(); + app.UseEndpoints(routes=> + { + routes.MapControllers(); + }); this.modulesStartup.Configure(app, env); diff --git a/BotSharp.WebHost/SwaggerFileUploadOperation.cs b/BotSharp.WebHost/SwaggerFileUploadOperation.cs index 259faf34..9e71e80a 100644 --- a/BotSharp.WebHost/SwaggerFileUploadOperation.cs +++ b/BotSharp.WebHost/SwaggerFileUploadOperation.cs @@ -1,4 +1,5 @@ -using Swashbuckle.AspNetCore.Swagger; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; using System; using System.Collections.Generic; @@ -7,24 +8,26 @@ using System.Text; namespace BotSharp.WebHost { - public class SwaggerFileUploadOperation : IOperationFilter - { - public void Apply(Operation operation, OperationFilterContext context) - { - if (operation.OperationId == "Import") - { - operation.Parameters.Clear(); + //public class SwaggerFileUploadOperation : IOperationFilter + //{ - operation.Parameters.Add(new NonBodyParameter - { - Name = "uploadedFile", - In = "formData", - Description = "Upload Zip File, meta.json is the extra data for customized function.", - Required = true, - Type = "file" - }); - operation.Consumes.Add("multipart/form-data"); - } - } - } + // public void Apply(OpenApiOperation operation, OperationFilterContext context) + // { + // if (operation.OperationId == "Import") + // { + // operation.Parameters.Clear(); + + // operation.Parameters.Add(new OpenApiParameter + // { + // Name = "uploadedFile", + // In = "formData", + // Description = "Upload Zip File, meta.json is the extra data for customized function.", + // Required = true, + // Type = "file" + // }); + // operation.Consumes.Add("multipart/form-data"); + // operation. + // } + // } + //} } diff --git a/BotSharp.sln b/BotSharp.sln index ec571647..db0c559c 100644 --- a/BotSharp.sln +++ b/BotSharp.sln @@ -19,6 +19,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Rasa", "B EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Articulate", "BotSharp.Platform.Articulate\BotSharp.Platform.Articulate.csproj", "{7290AC89-88DE-4CF8-946A-A1BB0E4C30EB}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{44D9C8BF-FA7B-4FA1-AF2D-93BC223D11B6}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + Directory.Build.props = Directory.Build.props + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..2ca8e7be --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,8 @@ + + + netcoreapp3.1 + 3.1.7 + 0.2.1 + + + \ No newline at end of file