feat: 完成swagger分组功能

This commit is contained in:
橙子
2023-12-11 21:14:12 +08:00
parent 9d583e2e5c
commit 27a2849619
8 changed files with 61 additions and 54 deletions

View File

@@ -29,7 +29,7 @@ namespace Yi.Framework.SqlSugarCore.Repositories
{
var db = (await _sugarDbContextProvider.GetDbContextAsync()).SqlSugarClient;
await Console.Out.WriteLineAsync("获取的id" + db.ContextID);
//await Console.Out.WriteLineAsync("获取的id" + db.ContextID);
return db;
}

View File

@@ -12,7 +12,7 @@ namespace Yi.Framework.SqlSugarCore
{
public Task SaveAsync(AuditLogInfo auditInfo)
{
Console.WriteLine(auditInfo.ExecutionTime);
//Console.WriteLine(auditInfo.ExecutionTime);
return Task.CompletedTask;
}
}

View File

@@ -76,7 +76,7 @@ namespace Yi.Framework.SqlSugarCore.Uow
{
var dbContext = await CreateDbContextAsync(unitOfWork);
Console.WriteLine("111111" + dbContext.SqlSugarClient.ContextID);
// Console.WriteLine("111111" + dbContext.SqlSugarClient.ContextID);
return dbContext;
}
@@ -101,14 +101,14 @@ namespace Yi.Framework.SqlSugarCore.Uow
unitOfWork.AddTransactionApi(transactionApiKey, transaction);
await Console.Out.WriteLineAsync("开始新的事务");
//await Console.Out.WriteLineAsync("开始新的事务");
Console.WriteLine(dbContext.SqlSugarClient.ContextID);
await dbContext.SqlSugarClient.Ado.BeginTranAsync();
return dbContext;
}
else
{
await Console.Out.WriteLineAsync("继续老的事务");
// await Console.Out.WriteLineAsync("继续老的事务");
Console.WriteLine(activeTransaction.DbContext.SqlSugarClient);
await activeTransaction.DbContext.SqlSugarClient.Ado.BeginTranAsync();
return (TDbContext)activeTransaction.DbContext;

View File

@@ -61,7 +61,7 @@ namespace Yi.Framework.SqlSugarCore
{
CodeFirst(service);
}
if (options.EnabledCodeFirst)
if (options.EnabledDbSeed)
{
await DataSeedAsync(service);
}
@@ -70,9 +70,6 @@ namespace Yi.Framework.SqlSugarCore
private void CodeFirst(IServiceProvider service)
{
var options = service.GetRequiredService<IOptions<DbConnOptions>>().Value;
if (options.EnabledCodeFirst)
{
var moduleContainer = service.GetRequiredService<IModuleContainer>();
var db = service.GetRequiredService<ISqlSugarDbContext>().SqlSugarClient;
@@ -85,7 +82,7 @@ namespace Yi.Framework.SqlSugarCore
{
db.CodeFirst.InitTables(types.ToArray());
}
}
}
private async Task DataSeedAsync(IServiceProvider service)