mirror of
https://github.com/anjoy8/Blog.Core.git
synced 2024-09-20 23:48:27 +08:00
parent
f400a4347d
commit
5d225ad9d1
|
@ -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)} || ";
|
||||||
});
|
});
|
||||||
|
|
||||||
// 切回主库
|
// 切回主库
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user