⬆️ SqlSugar 5.1.4.158

fix #360
This commit is contained in:
LemonNoCry 2024-06-12 11:51:12 +08:00
parent f400a4347d
commit 5d225ad9d1
No known key found for this signature in database
4 changed files with 13 additions and 13 deletions

View File

@ -43,12 +43,12 @@ namespace Blog.Core.Controllers
BaseDBConfig.ValidConfig.ForEach(m => BaseDBConfig.ValidConfig.ForEach(m =>
{ {
_sqlSugarClient.ChangeDatabase(m.ConfigId.ToLower()); _sqlSugarClient.ChangeDatabase(m.ConfigId.ToString().ToLower());
data.response += $"库{m.ConfigId}-Model层生成{FrameSeed.CreateModels(_sqlSugarClient, m.ConfigId, isMuti)} || "; data.response += $"库{m.ConfigId}-Model层生成{FrameSeed.CreateModels(_sqlSugarClient, m.ConfigId.ToString(), isMuti)} || ";
data.response += $"库{m.ConfigId}-IRepositorys层生成{FrameSeed.CreateIRepositorys(_sqlSugarClient, m.ConfigId, isMuti)} || "; data.response += $"库{m.ConfigId}-IRepositorys层生成{FrameSeed.CreateIRepositorys(_sqlSugarClient, m.ConfigId.ToString(), isMuti)} || ";
data.response += $"库{m.ConfigId}-IServices层生成{FrameSeed.CreateIServices(_sqlSugarClient, m.ConfigId, isMuti)} || "; data.response += $"库{m.ConfigId}-IServices层生成{FrameSeed.CreateIServices(_sqlSugarClient, m.ConfigId.ToString(), isMuti)} || ";
data.response += $"库{m.ConfigId}-Repository层生成{FrameSeed.CreateRepository(_sqlSugarClient, m.ConfigId, isMuti)} || "; data.response += $"库{m.ConfigId}-Repository层生成{FrameSeed.CreateRepository(_sqlSugarClient, m.ConfigId.ToString(), isMuti)} || ";
data.response += $"库{m.ConfigId}-Services层生成{FrameSeed.CreateServices(_sqlSugarClient, m.ConfigId, isMuti)} || "; data.response += $"库{m.ConfigId}-Services层生成{FrameSeed.CreateServices(_sqlSugarClient, m.ConfigId.ToString(), isMuti)} || ";
}); });
// 切回主库 // 切回主库

View File

@ -69,7 +69,7 @@ namespace Blog.Core.Extensions
} }
else else
{ {
if (string.Equals(config.ConfigId, MainDb.CurrentDbConnId, if (string.Equals(config.ConfigId.ToString(), MainDb.CurrentDbConnId,
StringComparison.CurrentCultureIgnoreCase)) StringComparison.CurrentCultureIgnoreCase))
{ {
BaseDBConfig.MainConfig = config; BaseDBConfig.MainConfig = config;

View File

@ -14,7 +14,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" /> <PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
<PackageReference Include="sqlSugarCore" Version="5.1.4.115" /> <PackageReference Include="sqlSugarCore" Version="5.1.4.158" />
<PackageReference Include="AutoMapper" Version="12.0.1" /> <PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" /> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
</ItemGroup> </ItemGroup>

View File

@ -34,7 +34,7 @@ namespace Blog.Core.Tasks
/// 直接写就没有锁库 上下文ContextID一样 /// 直接写就没有锁库 上下文ContextID一样
/// </summary> /// </summary>
/// <param name="context"></param> /// <param name="context"></param>
public async Task Execute(IJobExecutionContext context) public async Task Execute2(IJobExecutionContext context)
{ {
try try
{ {
@ -81,11 +81,9 @@ namespace Blog.Core.Tasks
/// 但是调用其他类方法 上下文ContextID就不一样 /// 但是调用其他类方法 上下文ContextID就不一样
/// </summary> /// </summary>
/// <param name="context"></param> /// <param name="context"></param>
public async Task Execute2(IJobExecutionContext context) public async Task Execute(IJobExecutionContext context)
{ {
await _guestbookServices.TestTranPropagationTran3(); var executeLog = await ExecuteJob(context, async () => await Run(context));
//var executeLog = await ExecuteJob(context, async () => await Run(context));
} }
public async Task Run(IJobExecutionContext context) public async Task Run(IJobExecutionContext context)
@ -95,6 +93,8 @@ namespace Blog.Core.Tasks
// 也可以通过数据库配置,获取传递过来的参数 // 也可以通过数据库配置,获取传递过来的参数
JobDataMap data = context.JobDetail.JobDataMap; JobDataMap data = context.JobDetail.JobDataMap;
//int jobId = data.GetInt("JobParam"); //int jobId = data.GetInt("JobParam");
await _guestbookServices.TestTranPropagationTran2();
} }
} }
} }