修改框架

This commit is contained in:
橙子
2021-10-10 17:52:23 +08:00
parent cf062cadcd
commit ee14ab4d2b
11 changed files with 84 additions and 5 deletions

View File

@@ -11,6 +11,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yi.Framework.Common.IOCOptions;
namespace Yi.Framework.ApiMicroservice
{
@@ -28,6 +29,9 @@ namespace Yi.Framework.ApiMicroservice
{
services.AddControllers();
services.Configure<SqliteOptions>(this.Configuration.GetSection("SqliteConn"));
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Yi.Framework.ApiMicroservice", Version = "v1" });
@@ -48,8 +52,10 @@ namespace Yi.Framework.ApiMicroservice
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();