|
|
@ -26,7 +26,6 @@ using SqlSugar;
|
|
|
|
using Swashbuckle.AspNetCore.SwaggerUI;
|
|
|
|
using Swashbuckle.AspNetCore.SwaggerUI;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace OpenAuth.WebApi
|
|
|
|
namespace OpenAuth.WebApi
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class Startup
|
|
|
|
public class Startup
|
|
|
@ -46,7 +45,10 @@ namespace OpenAuth.WebApi
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
services.AddHttpContextAccessor();
|
|
|
|
services.AddHttpContextAccessor();
|
|
|
|
|
|
|
|
services.AddSingleton<MqttClientManager>(provider => new MqttClientManager());
|
|
|
|
|
|
|
|
|
|
|
|
#region log4net
|
|
|
|
#region log4net
|
|
|
|
|
|
|
|
|
|
|
|
//在startup中需要强制创建log4net
|
|
|
|
//在startup中需要强制创建log4net
|
|
|
|
//var loggerFactory = LoggerFactory.Create(builder => { builder.AddLog4Net(); });
|
|
|
|
//var loggerFactory = LoggerFactory.Create(builder => { builder.AddLog4Net(); });
|
|
|
|
//ILogger logger = loggerFactory.CreateLogger<Startup>();
|
|
|
|
//ILogger logger = loggerFactory.CreateLogger<Startup>();
|
|
|
@ -56,9 +58,11 @@ namespace OpenAuth.WebApi
|
|
|
|
loggingBuilder.ClearProviders();
|
|
|
|
loggingBuilder.ClearProviders();
|
|
|
|
loggingBuilder.AddLog4Net();
|
|
|
|
loggingBuilder.AddLog4Net();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region identityServer
|
|
|
|
#region identityServer
|
|
|
|
|
|
|
|
|
|
|
|
var identityServer =
|
|
|
|
var identityServer =
|
|
|
|
((ConfigurationSection)Configuration.GetSection("AppSetting:IdentityServerUrl")).Value;
|
|
|
|
((ConfigurationSection)Configuration.GetSection("AppSetting:IdentityServerUrl")).Value;
|
|
|
|
if (!string.IsNullOrEmpty(identityServer))
|
|
|
|
if (!string.IsNullOrEmpty(identityServer))
|
|
|
@ -73,9 +77,11 @@ namespace OpenAuth.WebApi
|
|
|
|
options.Audience = "openauthapi";
|
|
|
|
options.Audience = "openauthapi";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region MiniProfiler
|
|
|
|
#region MiniProfiler
|
|
|
|
|
|
|
|
|
|
|
|
// 添加MiniProfiler服务
|
|
|
|
// 添加MiniProfiler服务
|
|
|
|
//services.AddMiniProfiler(options =>
|
|
|
|
//services.AddMiniProfiler(options =>
|
|
|
|
//{
|
|
|
|
//{
|
|
|
@ -89,13 +95,16 @@ namespace OpenAuth.WebApi
|
|
|
|
// options.SqlFormatter = new StackExchange.Profiling.SqlFormatters.InlineFormatter();
|
|
|
|
// options.SqlFormatter = new StackExchange.Profiling.SqlFormatters.InlineFormatter();
|
|
|
|
// // options.IgnoredPaths.Add("/swagger/");
|
|
|
|
// // options.IgnoredPaths.Add("/swagger/");
|
|
|
|
//}).AddEntityFramework(); //显示SQL语句及耗时
|
|
|
|
//}).AddEntityFramework(); //显示SQL语句及耗时
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region swagger
|
|
|
|
#region swagger
|
|
|
|
|
|
|
|
|
|
|
|
//添加swagger
|
|
|
|
//添加swagger
|
|
|
|
services.AddSwaggerGen(option =>
|
|
|
|
services.AddSwaggerGen(option =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#region 注释
|
|
|
|
#region 注释
|
|
|
|
|
|
|
|
|
|
|
|
//foreach (var controller in GetControllers())
|
|
|
|
//foreach (var controller in GetControllers())
|
|
|
|
//{
|
|
|
|
//{
|
|
|
|
// var groupname = GetSwaggerGroupName(controller);
|
|
|
|
// var groupname = GetSwaggerGroupName(controller);
|
|
|
@ -114,7 +123,9 @@ namespace OpenAuth.WebApi
|
|
|
|
// option.IncludeXmlComments(name, includeControllerXmlComments: true);
|
|
|
|
// option.IncludeXmlComments(name, includeControllerXmlComments: true);
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
option.CustomSchemaIds(type => type.FullName);
|
|
|
|
option.CustomSchemaIds(type => type.FullName);
|
|
|
|
option.SwaggerDoc("v1", new OpenApiInfo
|
|
|
|
option.SwaggerDoc("v1", new OpenApiInfo
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -147,33 +158,35 @@ namespace OpenAuth.WebApi
|
|
|
|
|
|
|
|
|
|
|
|
// option.OperationFilter<GlobalHttpHeaderOperationFilter>(); // 添加httpHeader参数
|
|
|
|
// option.OperationFilter<GlobalHttpHeaderOperationFilter>(); // 添加httpHeader参数
|
|
|
|
//});
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region AppSetting
|
|
|
|
#region AppSetting
|
|
|
|
|
|
|
|
|
|
|
|
services.Configure<AppSetting>(Configuration.GetSection("AppSetting"));
|
|
|
|
services.Configure<AppSetting>(Configuration.GetSection("AppSetting"));
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 限制文件大小
|
|
|
|
#region 限制文件大小
|
|
|
|
services.Configure<KestrelServerOptions>(options =>
|
|
|
|
|
|
|
|
{
|
|
|
|
services.Configure<KestrelServerOptions>(options => { options.Limits.MaxRequestBodySize = long.MaxValue; });
|
|
|
|
options.Limits.MaxRequestBodySize = long.MaxValue;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
services.Configure<FormOptions>(x =>
|
|
|
|
services.Configure<FormOptions>(x =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x.ValueLengthLimit = int.MaxValue;
|
|
|
|
x.ValueLengthLimit = int.MaxValue;
|
|
|
|
x.MultipartBodyLengthLimit = long.MaxValue;
|
|
|
|
x.MultipartBodyLengthLimit = long.MaxValue;
|
|
|
|
x.MemoryBufferThreshold = int.MaxValue;
|
|
|
|
x.MemoryBufferThreshold = int.MaxValue;
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Controllers
|
|
|
|
#region Controllers
|
|
|
|
|
|
|
|
|
|
|
|
services.AddControllers(option =>
|
|
|
|
services.AddControllers(option =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
option.Filters.Add<OpenAuthFilter>();
|
|
|
|
option.Filters.Add<OpenAuthFilter>();
|
|
|
|
//option.Filters.Add<TransactionFilter>();
|
|
|
|
//option.Filters.Add<TransactionFilter>();
|
|
|
|
//option.Filters.Add<GlobalExceptionFilter>();
|
|
|
|
//option.Filters.Add<GlobalExceptionFilter>();
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.ConfigureApiBehaviorOptions(options =>
|
|
|
|
.ConfigureApiBehaviorOptions(options =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// 禁用自动模态验证
|
|
|
|
// 禁用自动模态验证
|
|
|
@ -194,10 +207,13 @@ namespace OpenAuth.WebApi
|
|
|
|
//options.SerializerSettings.ContractResolver = new DefaultContractResolver();
|
|
|
|
//options.SerializerSettings.ContractResolver = new DefaultContractResolver();
|
|
|
|
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
|
|
|
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region MemoryCache
|
|
|
|
#region MemoryCache
|
|
|
|
|
|
|
|
|
|
|
|
services.AddMemoryCache();
|
|
|
|
services.AddMemoryCache();
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Cors
|
|
|
|
#region Cors
|
|
|
@ -213,89 +229,98 @@ namespace OpenAuth.WebApi
|
|
|
|
|
|
|
|
|
|
|
|
options.AddPolicy("SignalR",
|
|
|
|
options.AddPolicy("SignalR",
|
|
|
|
builder => builder.SetIsOriginAllowed(origin => true)
|
|
|
|
builder => builder.SetIsOriginAllowed(origin => true)
|
|
|
|
.AllowAnyMethod()
|
|
|
|
.AllowAnyMethod()
|
|
|
|
.AllowAnyHeader()
|
|
|
|
.AllowAnyHeader()
|
|
|
|
.AllowCredentials()
|
|
|
|
.AllowCredentials()
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
//options.AddPolicy("CorsPolicy",
|
|
|
|
//options.AddPolicy("CorsPolicy",
|
|
|
|
// builder => builder.AllowAnyOrigin()
|
|
|
|
// builder => builder.AllowAnyOrigin()
|
|
|
|
// .AllowAnyMethod()
|
|
|
|
// .AllowAnyMethod()
|
|
|
|
// .AllowAnyHeader());
|
|
|
|
// .AllowAnyHeader());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region SqlSugar
|
|
|
|
#region SqlSugar
|
|
|
|
|
|
|
|
|
|
|
|
////没有直接 using SqlSugar,因为如果引用命名空间的话,会和Microsoft的一个GetTypeInfo存在二义性,所以就直接这么使用了
|
|
|
|
////没有直接 using SqlSugar,因为如果引用命名空间的话,会和Microsoft的一个GetTypeInfo存在二义性,所以就直接这么使用了
|
|
|
|
services.AddScoped<ISqlSugarClient>(s =>
|
|
|
|
services.AddScoped<ISqlSugarClient>(s =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
StaticConfig.CustomSnowFlakeFunc = () =>
|
|
|
|
StaticConfig.CustomSnowFlakeFunc = () => { return Yitter.IdGenerator.YitIdHelper.NextId(); };
|
|
|
|
{
|
|
|
|
|
|
|
|
return Yitter.IdGenerator.YitIdHelper.NextId();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var sqlSugar = new SqlSugarClient(new ConnectionConfig()
|
|
|
|
var sqlSugar = new SqlSugarClient(new ConnectionConfig()
|
|
|
|
{
|
|
|
|
|
|
|
|
DbType = SqlSugar.DbType.PostgreSQL,
|
|
|
|
|
|
|
|
ConnectionString = Configuration.GetConnectionString("OpenAuthDBContext"),
|
|
|
|
|
|
|
|
IsAutoCloseConnection = true,
|
|
|
|
|
|
|
|
MoreSettings = new SqlSugar.ConnMoreSettings()
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PgSqlIsAutoToLower = false,
|
|
|
|
DbType = SqlSugar.DbType.PostgreSQL,
|
|
|
|
PgSqlIsAutoToLowerCodeFirst = false
|
|
|
|
ConnectionString = Configuration.GetConnectionString("OpenAuthDBContext"),
|
|
|
|
}
|
|
|
|
IsAutoCloseConnection = true,
|
|
|
|
},
|
|
|
|
MoreSettings = new SqlSugar.ConnMoreSettings()
|
|
|
|
|
|
|
|
{
|
|
|
|
//var sqlSugar = new SqlSugarClient(new ConnectionConfig()
|
|
|
|
PgSqlIsAutoToLower = false,
|
|
|
|
//{
|
|
|
|
PgSqlIsAutoToLowerCodeFirst = false
|
|
|
|
// DbType = SqlSugar.DbType.Kdbndp,
|
|
|
|
}
|
|
|
|
// ConnectionString = Configuration.GetConnectionString("OpenAuthDBContext"),
|
|
|
|
},
|
|
|
|
// IsAutoCloseConnection = true,
|
|
|
|
|
|
|
|
// MoreSettings = new SqlSugar.ConnMoreSettings()
|
|
|
|
//var sqlSugar = new SqlSugarClient(new ConnectionConfig()
|
|
|
|
// {
|
|
|
|
//{
|
|
|
|
// //PgSqlIsAutoToLower = false,
|
|
|
|
// DbType = SqlSugar.DbType.Kdbndp,
|
|
|
|
// //PgSqlIsAutoToLowerCodeFirst = false,
|
|
|
|
// ConnectionString = Configuration.GetConnectionString("OpenAuthDBContext"),
|
|
|
|
// IsAutoToUpper = false,
|
|
|
|
// IsAutoCloseConnection = true,
|
|
|
|
|
|
|
|
// MoreSettings = new SqlSugar.ConnMoreSettings()
|
|
|
|
// DatabaseModel = DbType.PostgreSQL
|
|
|
|
// {
|
|
|
|
// }
|
|
|
|
// //PgSqlIsAutoToLower = false,
|
|
|
|
//},
|
|
|
|
// //PgSqlIsAutoToLowerCodeFirst = false,
|
|
|
|
db =>
|
|
|
|
// IsAutoToUpper = false,
|
|
|
|
{
|
|
|
|
|
|
|
|
NpgsqlConnection.GlobalTypeMapper.UseNetTopologySuite();
|
|
|
|
// DatabaseModel = DbType.PostgreSQL
|
|
|
|
//单例参数配置,所有上下文生效
|
|
|
|
// }
|
|
|
|
db.Aop.OnLogExecuting = (sql, pars) =>
|
|
|
|
//},
|
|
|
|
{
|
|
|
|
db =>
|
|
|
|
//获取原生SQL推荐 5.1.4.63 性能OK
|
|
|
|
{
|
|
|
|
//UtilMethods.GetNativeSql(sql, pars);
|
|
|
|
NpgsqlConnection.GlobalTypeMapper.UseNetTopologySuite();
|
|
|
|
|
|
|
|
//单例参数配置,所有上下文生效
|
|
|
|
//获取无参数化SQL 影响性能只适合调试
|
|
|
|
db.Aop.OnLogExecuting = (sql, pars) =>
|
|
|
|
//Console.WriteLine(UtilMethods.GetSqlString(DbType.PostgreSQL, sql, pars));
|
|
|
|
{
|
|
|
|
//Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
|
|
|
|
//获取原生SQL推荐 5.1.4.63 性能OK
|
|
|
|
//LogHelper.LogInformation(sql + "\r\n" +db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
|
|
|
|
//UtilMethods.GetNativeSql(sql, pars);
|
|
|
|
//Console.WriteLine();
|
|
|
|
|
|
|
|
};
|
|
|
|
//获取无参数化SQL 影响性能只适合调试
|
|
|
|
});
|
|
|
|
//Console.WriteLine(UtilMethods.GetSqlString(DbType.PostgreSQL, sql, pars));
|
|
|
|
|
|
|
|
//Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
|
|
|
|
|
|
|
|
//LogHelper.LogInformation(sql + "\r\n" +db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
|
|
|
|
|
|
|
|
//Console.WriteLine();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
return sqlSugar;
|
|
|
|
return sqlSugar;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
services.AddScoped<SqlSugar.ISugarUnitOfWork<SugarDbContext>>(s => new SqlSugar.SugarUnitOfWork<SugarDbContext>(s.GetService<ISqlSugarClient>()));
|
|
|
|
services.AddScoped<SqlSugar.ISugarUnitOfWork<SugarDbContext>>(s =>
|
|
|
|
|
|
|
|
new SqlSugar.SugarUnitOfWork<SugarDbContext>(s.GetService<ISqlSugarClient>()));
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region HttpClient
|
|
|
|
#region HttpClient
|
|
|
|
|
|
|
|
|
|
|
|
services.AddHttpClient();
|
|
|
|
services.AddHttpClient();
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region DataProtection
|
|
|
|
#region DataProtection
|
|
|
|
|
|
|
|
|
|
|
|
services.AddDataProtection().PersistKeysToFileSystem(new DirectoryInfo(Configuration["DataProtection"]));
|
|
|
|
services.AddDataProtection().PersistKeysToFileSystem(new DirectoryInfo(Configuration["DataProtection"]));
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Quartz
|
|
|
|
#region Quartz
|
|
|
|
|
|
|
|
|
|
|
|
//设置定时启动的任务
|
|
|
|
//设置定时启动的任务
|
|
|
|
services.AddHostedService<QuartzService>();
|
|
|
|
//services.AddHostedService<QuartzService>();
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region SignalR
|
|
|
|
#region SignalR
|
|
|
|
|
|
|
|
|
|
|
|
services.AddSignalR();
|
|
|
|
services.AddSignalR();
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -327,27 +352,28 @@ namespace OpenAuth.WebApi
|
|
|
|
//可以在这里为静态文件添加其他http头信息,默认添加跨域信息
|
|
|
|
//可以在这里为静态文件添加其他http头信息,默认添加跨域信息
|
|
|
|
ctx.Context.Response.Headers["Access-Control-Allow-Origin"] = "*";
|
|
|
|
ctx.Context.Response.Headers["Access-Control-Allow-Origin"] = "*";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ContentTypeProvider = new Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider(new Dictionary<string, string>
|
|
|
|
ContentTypeProvider = new Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider(
|
|
|
|
{
|
|
|
|
new Dictionary<string, string>
|
|
|
|
{ ".amr","audio/AMR" },
|
|
|
|
{
|
|
|
|
{ ".mp3","audio/mpeg" },
|
|
|
|
{ ".amr", "audio/AMR" },
|
|
|
|
{ ".mp4","video/mp4" },
|
|
|
|
{ ".mp3", "audio/mpeg" },
|
|
|
|
{ ".apk","application/vnd.android.package-archive" },
|
|
|
|
{ ".mp4", "video/mp4" },
|
|
|
|
{ ".cpg","application/vnd.android.package-archive" },
|
|
|
|
{ ".apk", "application/vnd.android.package-archive" },
|
|
|
|
{ ".dbf","application/vnd.android.package-archive" },
|
|
|
|
{ ".cpg", "application/vnd.android.package-archive" },
|
|
|
|
{ ".shp","application/vnd.android.package-archive" },
|
|
|
|
{ ".dbf", "application/vnd.android.package-archive" },
|
|
|
|
{ ".shx","application/vnd.android.package-archive" },
|
|
|
|
{ ".shp", "application/vnd.android.package-archive" },
|
|
|
|
{ ".zip","application/zip" },
|
|
|
|
{ ".shx", "application/vnd.android.package-archive" },
|
|
|
|
{ ".jpeg","image/jpeg" },
|
|
|
|
{ ".zip", "application/zip" },
|
|
|
|
{ ".jpg","image/jpg" },
|
|
|
|
{ ".jpeg", "image/jpeg" },
|
|
|
|
{ ".png","image/png" },
|
|
|
|
{ ".jpg", "image/jpg" },
|
|
|
|
{ ".docx","application/msword" },
|
|
|
|
{ ".png", "image/png" },
|
|
|
|
{ ".doc","application/msword" },
|
|
|
|
{ ".docx", "application/msword" },
|
|
|
|
{ ".txt","application/octet-stream" },
|
|
|
|
{ ".doc", "application/msword" },
|
|
|
|
{ ".xlsx","application/octet-stream" },
|
|
|
|
{ ".txt", "application/octet-stream" },
|
|
|
|
{ ".xls","application/vnd.ms-excel" },
|
|
|
|
{ ".xlsx", "application/octet-stream" },
|
|
|
|
{ ".pdf","application/pdf"}
|
|
|
|
{ ".xls", "application/vnd.ms-excel" },
|
|
|
|
})
|
|
|
|
{ ".pdf", "application/pdf" }
|
|
|
|
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
app.UseStaticFiles(staticfile);
|
|
|
|
app.UseStaticFiles(staticfile);
|
|
|
|
//todo:测试可以允许任意跨域,正式环境要加权限
|
|
|
|
//todo:测试可以允许任意跨域,正式环境要加权限
|
|
|
@ -399,7 +425,7 @@ namespace OpenAuth.WebApi
|
|
|
|
{
|
|
|
|
{
|
|
|
|
c.SwaggerEndpoint("v1/swagger.json", "V1 Docs");
|
|
|
|
c.SwaggerEndpoint("v1/swagger.json", "V1 Docs");
|
|
|
|
c.DocExpansion(Swashbuckle.AspNetCore.SwaggerUI.DocExpansion.None);
|
|
|
|
c.DocExpansion(Swashbuckle.AspNetCore.SwaggerUI.DocExpansion.None);
|
|
|
|
c.OAuthClientId("OpenAuth.WebApi"); //oauth客户端名称
|
|
|
|
c.OAuthClientId("OpenAuth.WebApi"); //oauth客户端名称
|
|
|
|
c.OAuthAppName("开源版webapi认证"); // 描述
|
|
|
|
c.OAuthAppName("开源版webapi认证"); // 描述
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|