|
|
|
@ -0,0 +1,48 @@
|
|
|
|
|
using Ds.WMS.WebCore.appfilter;
|
|
|
|
|
using Ds.WMS.WebCore.applog;
|
|
|
|
|
using Ds.WMS.WebCore.appstartup;
|
|
|
|
|
using DS.Module.Swagger;
|
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
|
|
|
|
|
|
#region << 版 本 注 释 >>
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 版权所有 (c)2024 保留所有权
|
|
|
|
|
* CLR版本 4.0.30319.42000
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#endregion << 版 本 注 释 >>
|
|
|
|
|
|
|
|
|
|
namespace Ds.WMS.WebCore.appextend
|
|
|
|
|
{
|
|
|
|
|
public static class ApplicationBuilderExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///为了让主Progarm.cs文件更加简洁,我们将一些中间件的配置放到这里
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="app"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static WebApplication UseMyMiddlewares(this WebApplication app)
|
|
|
|
|
{
|
|
|
|
|
app.UseMiddleware<RequestLoggingMiddleware>();
|
|
|
|
|
app.UseMiddleware<GlobalExceptionHandler>();
|
|
|
|
|
app.UseSwagger();
|
|
|
|
|
app.UseSwaggerDocumentation();
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
|
app.UseRouting();
|
|
|
|
|
app.UseEndpoints(endpoints =>
|
|
|
|
|
{
|
|
|
|
|
endpoints.MapControllers();
|
|
|
|
|
});
|
|
|
|
|
app.UseDynamicStartups();
|
|
|
|
|
|
|
|
|
|
return app;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|