|
|
|
@ -128,7 +128,7 @@ public class MyProjectNameModule : AbpModule |
|
|
|
ConfigureMultiTenancy(); |
|
|
|
ConfigureUrls(configuration); |
|
|
|
ConfigureAutoMapper(context); |
|
|
|
ConfigureSwagger(context.Services); |
|
|
|
ConfigureSwagger(context.Services, configuration); |
|
|
|
ConfigureAutoApiControllers(); |
|
|
|
ConfigureVirtualFiles(hostingEnvironment); |
|
|
|
ConfigureLocalization(); |
|
|
|
@ -227,16 +227,20 @@ public class MyProjectNameModule : AbpModule |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void ConfigureSwagger(IServiceCollection services) |
|
|
|
private void ConfigureSwagger(IServiceCollection services, IConfiguration configuration) |
|
|
|
{ |
|
|
|
services.AddAbpSwaggerGen( |
|
|
|
services.AddAbpSwaggerGenWithOAuth( |
|
|
|
configuration["AuthServer:Authority"], |
|
|
|
new Dictionary<string, string> |
|
|
|
{ |
|
|
|
{"MyProjectName", "MyProjectName API"} |
|
|
|
}, |
|
|
|
options => |
|
|
|
{ |
|
|
|
options.SwaggerDoc("v1", new OpenApiInfo { Title = "MyProjectName API", Version = "v1" }); |
|
|
|
options.DocInclusionPredicate((docName, description) => true); |
|
|
|
options.CustomSchemaIds(type => type.FullName); |
|
|
|
} |
|
|
|
); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void ConfigureAutoMapper(ServiceConfigurationContext context) |
|
|
|
@ -343,6 +347,10 @@ public class MyProjectNameModule : AbpModule |
|
|
|
app.UseAbpSwaggerUI(options => |
|
|
|
{ |
|
|
|
options.SwaggerEndpoint("/swagger/v1/swagger.json", "MyProjectName API"); |
|
|
|
|
|
|
|
var configuration = context.GetConfiguration(); |
|
|
|
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); |
|
|
|
options.OAuthScopes("MyProjectName"); |
|
|
|
}); |
|
|
|
|
|
|
|
app.UseAuditing(); |
|
|
|
|