41 changed files with 1297 additions and 39 deletions
@ -0,0 +1,104 @@ |
|||
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio Version 17 |
|||
VisualStudioVersion = 17.0.31903.59 |
|||
MinimumVisualStudioVersion = 10.0.40219.1 |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{8DA8A2EE-0B26-487E-A6C4-518906E92B1B}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C38EB7EF-BAE9-4129-862A-71C652B81775}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{77341F31-F54C-436A-AF8D-F78D91303C45}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TaskManagement.Domain.Shared", "modules\task-management\LINGYUN.Abp.TaskManagement.Domain.Shared\LINGYUN.Abp.TaskManagement.Domain.Shared.csproj", "{691CD138-9FFA-4988-BAC4-A32F0DAE1090}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TaskManagement.Domain", "modules\task-management\LINGYUN.Abp.TaskManagement.Domain\LINGYUN.Abp.TaskManagement.Domain.csproj", "{8873A651-4F83-43B3-A34E-7AAA8A3ED4CF}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TaskManagement.Application.Contracts", "modules\task-management\LINGYUN.Abp.TaskManagement.Application.Contracts\LINGYUN.Abp.TaskManagement.Application.Contracts.csproj", "{D5EC4CA0-7E16-4D17-B08E-E162EF332C77}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TaskManagement.Application", "modules\task-management\LINGYUN.Abp.TaskManagement.Application\LINGYUN.Abp.TaskManagement.Application.csproj", "{09039DDF-5B0E-4670-8055-CC0BE82D4D2C}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TaskManagement.HttpApi", "modules\task-management\LINGYUN.Abp.TaskManagement.HttpApi\LINGYUN.Abp.TaskManagement.HttpApi.csproj", "{283B0039-F67C-41F7-B554-DF5EE9178C4A}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TaskManagement.EntityFrameworkCore", "modules\task-management\LINGYUN.Abp.TaskManagement.EntityFrameworkCore\LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj", "{B8AB5E9B-9711-470E-8072-7444579EC5F6}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C99728F6-FB3C-4D26-8917-1D30725209B9}" |
|||
ProjectSection(SolutionItems) = preProject |
|||
.editorconfig = .editorconfig |
|||
EndProjectSection |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "provider", "provider", "{385578CC-C0F1-4377-A7A2-682B8F416234}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundTasks", "modules\task-management\LINGYUN.Abp.BackgroundTasks\LINGYUN.Abp.BackgroundTasks.csproj", "{AC0B4342-9C9B-41E6-9646-E505C763EE77}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundTasks.Quartz", "modules\task-management\LINGYUN.Abp.BackgroundTasks.Quartz\LINGYUN.Abp.BackgroundTasks.Quartz.csproj", "{7051C251-11D0-4971-B13E-F6929AE6DE89}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LY.MicroService.TaskManagement.HttpApi.Host", "services\LY.MicroService.TaskManagement.HttpApi.Host\LY.MicroService.TaskManagement.HttpApi.Host.csproj", "{E8022994-A19F-4540-B9D1-7EF4AA85D18A}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.BackgroundTasks.Abstractions", "modules\task-management\LINGYUN.Abp.BackgroundTasks.Abstractions\LINGYUN.Abp.BackgroundTasks.Abstractions.csproj", "{4A049C32-55F2-4A5F-954A-C8A977C2D87F}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|Any CPU = Debug|Any CPU |
|||
Release|Any CPU = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{691CD138-9FFA-4988-BAC4-A32F0DAE1090}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{691CD138-9FFA-4988-BAC4-A32F0DAE1090}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{691CD138-9FFA-4988-BAC4-A32F0DAE1090}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{691CD138-9FFA-4988-BAC4-A32F0DAE1090}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{8873A651-4F83-43B3-A34E-7AAA8A3ED4CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{8873A651-4F83-43B3-A34E-7AAA8A3ED4CF}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{8873A651-4F83-43B3-A34E-7AAA8A3ED4CF}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{8873A651-4F83-43B3-A34E-7AAA8A3ED4CF}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{D5EC4CA0-7E16-4D17-B08E-E162EF332C77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{D5EC4CA0-7E16-4D17-B08E-E162EF332C77}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{D5EC4CA0-7E16-4D17-B08E-E162EF332C77}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{D5EC4CA0-7E16-4D17-B08E-E162EF332C77}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{09039DDF-5B0E-4670-8055-CC0BE82D4D2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{09039DDF-5B0E-4670-8055-CC0BE82D4D2C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{09039DDF-5B0E-4670-8055-CC0BE82D4D2C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{09039DDF-5B0E-4670-8055-CC0BE82D4D2C}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{283B0039-F67C-41F7-B554-DF5EE9178C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{283B0039-F67C-41F7-B554-DF5EE9178C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{283B0039-F67C-41F7-B554-DF5EE9178C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{283B0039-F67C-41F7-B554-DF5EE9178C4A}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{B8AB5E9B-9711-470E-8072-7444579EC5F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{B8AB5E9B-9711-470E-8072-7444579EC5F6}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{B8AB5E9B-9711-470E-8072-7444579EC5F6}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{B8AB5E9B-9711-470E-8072-7444579EC5F6}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{AC0B4342-9C9B-41E6-9646-E505C763EE77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{AC0B4342-9C9B-41E6-9646-E505C763EE77}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{AC0B4342-9C9B-41E6-9646-E505C763EE77}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{AC0B4342-9C9B-41E6-9646-E505C763EE77}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{7051C251-11D0-4971-B13E-F6929AE6DE89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{7051C251-11D0-4971-B13E-F6929AE6DE89}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{7051C251-11D0-4971-B13E-F6929AE6DE89}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{7051C251-11D0-4971-B13E-F6929AE6DE89}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{E8022994-A19F-4540-B9D1-7EF4AA85D18A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{E8022994-A19F-4540-B9D1-7EF4AA85D18A}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{E8022994-A19F-4540-B9D1-7EF4AA85D18A}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{E8022994-A19F-4540-B9D1-7EF4AA85D18A}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{4A049C32-55F2-4A5F-954A-C8A977C2D87F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{4A049C32-55F2-4A5F-954A-C8A977C2D87F}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{4A049C32-55F2-4A5F-954A-C8A977C2D87F}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{4A049C32-55F2-4A5F-954A-C8A977C2D87F}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
GlobalSection(NestedProjects) = preSolution |
|||
{691CD138-9FFA-4988-BAC4-A32F0DAE1090} = {C38EB7EF-BAE9-4129-862A-71C652B81775} |
|||
{8873A651-4F83-43B3-A34E-7AAA8A3ED4CF} = {C38EB7EF-BAE9-4129-862A-71C652B81775} |
|||
{D5EC4CA0-7E16-4D17-B08E-E162EF332C77} = {C38EB7EF-BAE9-4129-862A-71C652B81775} |
|||
{09039DDF-5B0E-4670-8055-CC0BE82D4D2C} = {C38EB7EF-BAE9-4129-862A-71C652B81775} |
|||
{283B0039-F67C-41F7-B554-DF5EE9178C4A} = {C38EB7EF-BAE9-4129-862A-71C652B81775} |
|||
{B8AB5E9B-9711-470E-8072-7444579EC5F6} = {C38EB7EF-BAE9-4129-862A-71C652B81775} |
|||
{AC0B4342-9C9B-41E6-9646-E505C763EE77} = {C38EB7EF-BAE9-4129-862A-71C652B81775} |
|||
{7051C251-11D0-4971-B13E-F6929AE6DE89} = {385578CC-C0F1-4377-A7A2-682B8F416234} |
|||
{E8022994-A19F-4540-B9D1-7EF4AA85D18A} = {8DA8A2EE-0B26-487E-A6C4-518906E92B1B} |
|||
{4A049C32-55F2-4A5F-954A-C8A977C2D87F} = {C38EB7EF-BAE9-4129-862A-71C652B81775} |
|||
EndGlobalSection |
|||
GlobalSection(ExtensibilityGlobals) = postSolution |
|||
SolutionGuid = {E1FD1F4C-D344-408B-97CF-B6F1F6D7D293} |
|||
EndGlobalSection |
|||
EndGlobal |
|||
@ -0,0 +1,45 @@ |
|||
using System; |
|||
using Volo.Abp; |
|||
|
|||
namespace LINGYUN.Abp.BackgroundTasks; |
|||
|
|||
public class AbpBackgroundTaskConcurrentException : AbpException |
|||
{ |
|||
public Type JobType { get; } |
|||
/// <summary>
|
|||
/// Creates a new <see cref="AbpBackgroundTaskConcurrentException"/> object.
|
|||
/// </summary>
|
|||
/// <param name="innerException">Inner exception</param>
|
|||
public AbpBackgroundTaskConcurrentException(Type jobType) |
|||
: this( |
|||
jobType, |
|||
$"This job {jobType.Name} cannot be performed because it has been locked by another performer", |
|||
null) |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Creates a new <see cref="AbpBackgroundTaskConcurrentException"/> object.
|
|||
/// </summary>
|
|||
/// <param name="jobType">Execute job type</param>
|
|||
/// <param name="innerException">Inner exception</param>
|
|||
public AbpBackgroundTaskConcurrentException(Type jobType, Exception innerException) |
|||
: this( |
|||
jobType, |
|||
$"This job {jobType.Name} cannot be performed because it has been locked by another performer", |
|||
innerException) |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Creates a new <see cref="AbpBackgroundTaskConcurrentException"/> object.
|
|||
/// </summary>
|
|||
/// <param name="jobType">Execute job type</param>
|
|||
/// <param name="message">Exception message</param>
|
|||
/// <param name="innerException">Inner exception</param>
|
|||
public AbpBackgroundTaskConcurrentException(Type jobType, string message, Exception innerException) |
|||
: base(message, innerException) |
|||
{ |
|||
JobType = jobType; |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using Quartz; |
|||
|
|||
namespace LINGYUN.Abp.BackgroundTasks.Quartz; |
|||
|
|||
[DisallowConcurrentExecution] |
|||
public class QuartzJobConcurrentAdapter<TJobRunnable> : QuartzJobSimpleAdapter<TJobRunnable> |
|||
where TJobRunnable : IJobRunnable |
|||
{ |
|||
public QuartzJobConcurrentAdapter(IServiceProvider serviceProvider) |
|||
: base(serviceProvider) |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace LINGYUN.Abp.BackgroundTasks.Primitives; |
|||
|
|||
public class SleepJob : IJobRunnable |
|||
{ |
|||
public async Task ExecuteAsync(JobRunnableContext context) |
|||
{ |
|||
context.JobData.TryGetValue("Delay", out var sleep); |
|||
|
|||
Console.WriteLine($"Sleep {sleep ?? 20000} milliseconds."); |
|||
|
|||
await Task.Delay(sleep?.To<int>() ?? 20000); |
|||
} |
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
using LINGYUN.Abp.TaskManagement.Localization; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace LINGYUN.Abp.TaskManagement.Permissions; |
|||
|
|||
public class TaskManagementPermissionDefinitionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
var group = context.AddGroup( |
|||
TaskManagementPermissions.GroupName, |
|||
L("Permissions:TaskManagement"), |
|||
MultiTenancySides.Host); |
|||
|
|||
var backgroundJobs = group.AddPermission( |
|||
TaskManagementPermissions.BackgroundJobs.Default, |
|||
L("Permissions:BackgroundJobs"), |
|||
MultiTenancySides.Host); |
|||
backgroundJobs.AddChild( |
|||
TaskManagementPermissions.BackgroundJobs.Create, |
|||
L("Permissions:CreateJob"), |
|||
MultiTenancySides.Host); |
|||
backgroundJobs.AddChild( |
|||
TaskManagementPermissions.BackgroundJobs.Update, |
|||
L("Permissions:UpdateJob"), |
|||
MultiTenancySides.Host); |
|||
backgroundJobs.AddChild( |
|||
TaskManagementPermissions.BackgroundJobs.Delete, |
|||
L("Permissions:DeleteJob"), |
|||
MultiTenancySides.Host); |
|||
backgroundJobs.AddChild( |
|||
TaskManagementPermissions.BackgroundJobs.Trigger, |
|||
L("Permissions:TriggerJob"), |
|||
MultiTenancySides.Host); |
|||
backgroundJobs.AddChild( |
|||
TaskManagementPermissions.BackgroundJobs.Pause, |
|||
L("Permissions:PauseJob"), |
|||
MultiTenancySides.Host); |
|||
backgroundJobs.AddChild( |
|||
TaskManagementPermissions.BackgroundJobs.Resume, |
|||
L("Permissions:ResumeJob"), |
|||
MultiTenancySides.Host); |
|||
|
|||
var backgroundJobLogs = group.AddPermission( |
|||
TaskManagementPermissions.BackgroundJobLogs.Default, |
|||
L("Permissions:BackgroundJobLogs"), |
|||
MultiTenancySides.Host); |
|||
backgroundJobLogs.AddChild( |
|||
TaskManagementPermissions.BackgroundJobLogs.Delete, |
|||
L("Permissions:DeleteJobLogs"), |
|||
MultiTenancySides.Host); |
|||
} |
|||
|
|||
private ILocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<TaskManagementResource>(name); |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
namespace LINGYUN.Abp.TaskManagement; |
|||
|
|||
public static class TaskManagementRemoteServiceConsts |
|||
{ |
|||
public const string RemoteServiceName = "TaskManagement"; |
|||
|
|||
public const string ModuleName = "task-management"; |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
using LINGYUN.Abp.TaskManagement.Permissions; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace LINGYUN.Abp.TaskManagement; |
|||
|
|||
[Authorize(TaskManagementPermissions.BackgroundJobLogs.Default)] |
|||
public class BackgroundJobLogAppService : TaskManagementApplicationService, IBackgroundJobLogAppService |
|||
{ |
|||
protected IBackgroundJobLogRepository BackgroundJobLogRepository { get; } |
|||
|
|||
public BackgroundJobLogAppService( |
|||
IBackgroundJobLogRepository backgroundJobLogRepository) |
|||
{ |
|||
BackgroundJobLogRepository = backgroundJobLogRepository; |
|||
} |
|||
|
|||
[Authorize(TaskManagementPermissions.BackgroundJobLogs.Delete)] |
|||
public virtual Task DeleteAsync(long id) |
|||
{ |
|||
return BackgroundJobLogRepository.DeleteAsync(id); |
|||
} |
|||
|
|||
public virtual async Task<BackgroundJobLogDto> GetAsync(long id) |
|||
{ |
|||
var backgroundJobLog = await BackgroundJobLogRepository.GetAsync(id); |
|||
|
|||
return ObjectMapper.Map<BackgroundJobLog, BackgroundJobLogDto>(backgroundJobLog); |
|||
} |
|||
|
|||
public virtual async Task<PagedResultDto<BackgroundJobLogDto>> GetListAsync(BackgroundJobLogGetListInput input) |
|||
{ |
|||
var filter = new BackgroundJobLogFilter |
|||
{ |
|||
BeginRunTime = input.BeginRunTime, |
|||
EndRunTime = input.EndRunTime, |
|||
HasExceptions = input.HasExceptions, |
|||
Filter = input.Filter, |
|||
Group = input.Group, |
|||
Name = input.Name, |
|||
Type = input.Type |
|||
}; |
|||
|
|||
var totalCount = await BackgroundJobLogRepository.GetCountAsync(filter, input.JobId); |
|||
var backgroundJobLogs = await BackgroundJobLogRepository.GetListAsync( |
|||
filter, input.JobId, input.Sorting, input.MaxResultCount, input.SkipCount); |
|||
|
|||
return new PagedResultDto<BackgroundJobLogDto>(totalCount, |
|||
ObjectMapper.Map<List<BackgroundJobLog>, List<BackgroundJobLogDto>>(backgroundJobLogs)); |
|||
} |
|||
} |
|||
@ -1,6 +1,16 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"Permission:TaskManagement": "TaskManagement" |
|||
"Permissions:TaskManagement": "Task Management", |
|||
"Permissions:BackgroundJobs": "Background Jobs", |
|||
"Permissions:CreateJob": "Create Job", |
|||
"Permissions:UpdateJob": "Update Job", |
|||
"Permissions:DeleteJob": "Delete Job", |
|||
"Permissions:TriggerJob": "Trigger Job", |
|||
"Permissions:PauseJob": "Pause Job", |
|||
"Permissions:ResumeJob": "Resume Job", |
|||
"Permissions:BackgroundJobLogs": "BackgroundJobs Logs", |
|||
"Permissions:DeleteJobLogs": "Delete Job Logs", |
|||
"TaskManagement:01000": "A job named {Name} already exists in the Group {Group}!" |
|||
} |
|||
} |
|||
@ -1,6 +1,16 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"Permission:TaskManagement": "任务管理" |
|||
"Permissions:TaskManagement": "任务调度平台", |
|||
"Permissions:BackgroundJobs": "任务管理", |
|||
"Permissions:CreateJob": "新建作业", |
|||
"Permissions:UpdateJob": "编辑作业", |
|||
"Permissions:DeleteJob": "删除作业", |
|||
"Permissions:TriggerJob": "触发作业", |
|||
"Permissions:PauseJob": "暂停作业", |
|||
"Permissions:ResumeJob": "恢复作业", |
|||
"Permissions:BackgroundJobLogs": "日志管理", |
|||
"Permissions:DeleteJobLogs": "删除作业日志", |
|||
"TaskManagement:01000": "分组 {Group} 中已经存在一个名称为 {Name} 的作业!" |
|||
} |
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
using LINGYUN.Abp.TaskManagement.Permissions; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace LINGYUN.Abp.TaskManagement; |
|||
|
|||
[RemoteService(Name = TaskManagementRemoteServiceConsts.RemoteServiceName)] |
|||
[Area(TaskManagementRemoteServiceConsts.ModuleName)] |
|||
[Authorize(TaskManagementPermissions.BackgroundJobs.Default)] |
|||
[Route($"api/{TaskManagementRemoteServiceConsts.ModuleName}/background-jobs")] |
|||
public class BackgroundJobInfoController : TaskManagementController, IBackgroundJobInfoAppService |
|||
{ |
|||
protected IBackgroundJobInfoAppService BackgroundJobInfoAppService { get; } |
|||
|
|||
public BackgroundJobInfoController( |
|||
IBackgroundJobInfoAppService backgroundJobInfoAppService) |
|||
{ |
|||
BackgroundJobInfoAppService = backgroundJobInfoAppService; |
|||
} |
|||
|
|||
[HttpPost] |
|||
[Authorize(TaskManagementPermissions.BackgroundJobs.Create)] |
|||
public Task<BackgroundJobInfoDto> CreateAsync(BackgroundJobInfoCreateDto input) |
|||
{ |
|||
return BackgroundJobInfoAppService.CreateAsync(input); |
|||
} |
|||
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
[Authorize(TaskManagementPermissions.BackgroundJobs.Delete)] |
|||
public Task DeleteAsync(Guid id) |
|||
{ |
|||
return BackgroundJobInfoAppService.DeleteAsync(id); |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
public Task<BackgroundJobInfoDto> GetAsync(Guid id) |
|||
{ |
|||
return BackgroundJobInfoAppService.GetAsync(id); |
|||
} |
|||
|
|||
[HttpGet] |
|||
public Task<PagedResultDto<BackgroundJobInfoDto>> GetListAsync(BackgroundJobInfoGetListInput input) |
|||
{ |
|||
return BackgroundJobInfoAppService.GetListAsync(input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("{id}/pause")] |
|||
[Authorize(TaskManagementPermissions.BackgroundJobs.Pause)] |
|||
public Task PauseAsync(Guid id) |
|||
{ |
|||
return BackgroundJobInfoAppService.PauseAsync(id); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("{id}/resume")] |
|||
[Authorize(TaskManagementPermissions.BackgroundJobs.Resume)] |
|||
public Task ResumeAsync(Guid id) |
|||
{ |
|||
return BackgroundJobInfoAppService.ResumeAsync(id); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("{id}/trigger")] |
|||
[Authorize(TaskManagementPermissions.BackgroundJobs.Trigger)] |
|||
public Task TriggerAsync(Guid id) |
|||
{ |
|||
return BackgroundJobInfoAppService.TriggerAsync(id); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("{id}")] |
|||
[Authorize(TaskManagementPermissions.BackgroundJobs.Update)] |
|||
public Task<BackgroundJobInfoDto> UpdateAsync(Guid id, BackgroundJobInfoUpdateDto input) |
|||
{ |
|||
return BackgroundJobInfoAppService.UpdateAsync(id, input); |
|||
} |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
using LINGYUN.Abp.TaskManagement.Permissions; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace LINGYUN.Abp.TaskManagement; |
|||
|
|||
[RemoteService(Name = TaskManagementRemoteServiceConsts.RemoteServiceName)] |
|||
[Area(TaskManagementRemoteServiceConsts.ModuleName)] |
|||
[Authorize(TaskManagementPermissions.BackgroundJobLogs.Default)] |
|||
[Route($"api/{TaskManagementRemoteServiceConsts.ModuleName}/background-jobs/logs")] |
|||
public class BackgroundJobLogController : TaskManagementController, IBackgroundJobLogAppService |
|||
{ |
|||
protected IBackgroundJobLogAppService BackgroundJobLogAppService { get; } |
|||
|
|||
public BackgroundJobLogController( |
|||
IBackgroundJobLogAppService backgroundJobLogAppService) |
|||
{ |
|||
BackgroundJobLogAppService = backgroundJobLogAppService; |
|||
} |
|||
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
[Authorize(TaskManagementPermissions.BackgroundJobLogs.Delete)] |
|||
public Task DeleteAsync(long id) |
|||
{ |
|||
return BackgroundJobLogAppService.DeleteAsync(id); |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
public Task<BackgroundJobLogDto> GetAsync(long id) |
|||
{ |
|||
return BackgroundJobLogAppService.GetAsync(id); |
|||
} |
|||
|
|||
[HttpGet] |
|||
public Task<PagedResultDto<BackgroundJobLogDto>> GetListAsync(BackgroundJobLogGetListInput input) |
|||
{ |
|||
return BackgroundJobLogAppService.GetListAsync(input); |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using LINGYUN.Abp.TaskManagement.Localization; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
|
|||
namespace LINGYUN.Abp.TaskManagement; |
|||
|
|||
public abstract class TaskManagementController : AbpControllerBase |
|||
{ |
|||
protected TaskManagementController() |
|||
{ |
|||
LocalizationResource = typeof(TaskManagementResource); |
|||
} |
|||
} |
|||
@ -0,0 +1,188 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using LY.MicroService.TaskManagement.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LY.MicroService.TaskManagement.Migrations |
|||
{ |
|||
[DbContext(typeof(TaskManagementMigrationsDbContext))] |
|||
[Migration("20220109030916_Add-Module-Task-Management")] |
|||
partial class AddModuleTaskManagement |
|||
{ |
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "6.0.1") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobInfo", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Args") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Args"); |
|||
|
|||
b.Property<DateTime>("BeginTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Cron") |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)") |
|||
.HasColumnName("Cron"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(255) |
|||
.HasColumnType("varchar(255)") |
|||
.HasColumnName("Description"); |
|||
|
|||
b.Property<DateTime?>("EndTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Group") |
|||
.IsRequired() |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)") |
|||
.HasColumnName("Group"); |
|||
|
|||
b.Property<int>("Interval") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<bool>("IsAbandoned") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<int>("JobType") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<DateTime?>("LastRunTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("LockTimeOut") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("MaxCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("MaxTryCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<DateTime?>("NextRunTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("Priority") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("Status") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("TriggerCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("TryCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Type") |
|||
.IsRequired() |
|||
.HasMaxLength(200) |
|||
.HasColumnType("varchar(200)") |
|||
.HasColumnName("Type"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "Group"); |
|||
|
|||
b.ToTable("TK_BackgroundJobs", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobLog", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<string>("Exception") |
|||
.HasMaxLength(2000) |
|||
.HasColumnType("varchar(2000)") |
|||
.HasColumnName("Exception"); |
|||
|
|||
b.Property<string>("JobGroup") |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)") |
|||
.HasColumnName("JobGroup"); |
|||
|
|||
b.Property<Guid?>("JobId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("JobName") |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("JobName"); |
|||
|
|||
b.Property<string>("JobType") |
|||
.HasMaxLength(200) |
|||
.HasColumnType("varchar(200)") |
|||
.HasColumnName("JobType"); |
|||
|
|||
b.Property<string>("Message") |
|||
.HasMaxLength(1000) |
|||
.HasColumnType("varchar(1000)") |
|||
.HasColumnName("Message"); |
|||
|
|||
b.Property<DateTime>("RunTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("JobGroup", "JobName"); |
|||
|
|||
b.ToTable("TK_BackgroundJobLogs", (string)null); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,108 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Metadata; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LY.MicroService.TaskManagement.Migrations |
|||
{ |
|||
public partial class AddModuleTaskManagement : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterDatabase() |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "TK_BackgroundJobLogs", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<long>(type: "bigint", nullable: false) |
|||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), |
|||
JobId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
JobName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
JobGroup = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
JobType = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Message = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
RunTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|||
Exception = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_TK_BackgroundJobLogs", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "TK_BackgroundJobs", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), |
|||
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Group = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Args = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Status = table.Column<int>(type: "int", nullable: false), |
|||
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
Description = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
LockTimeOut = table.Column<int>(type: "int", nullable: false), |
|||
BeginTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|||
EndTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
LastRunTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
NextRunTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
JobType = table.Column<int>(type: "int", nullable: false), |
|||
Cron = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
Priority = table.Column<int>(type: "int", nullable: false), |
|||
TriggerCount = table.Column<int>(type: "int", nullable: false), |
|||
TryCount = table.Column<int>(type: "int", nullable: false), |
|||
MaxTryCount = table.Column<int>(type: "int", nullable: false), |
|||
MaxCount = table.Column<int>(type: "int", nullable: false), |
|||
Interval = table.Column<int>(type: "int", nullable: false), |
|||
IsAbandoned = table.Column<bool>(type: "tinyint(1)", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "longtext", nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"), |
|||
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci") |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_TK_BackgroundJobs", x => x.Id); |
|||
}) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_TK_BackgroundJobLogs_JobGroup_JobName", |
|||
table: "TK_BackgroundJobLogs", |
|||
columns: new[] { "JobGroup", "JobName" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_TK_BackgroundJobs_Name_Group", |
|||
table: "TK_BackgroundJobs", |
|||
columns: new[] { "Name", "Group" }); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "TK_BackgroundJobLogs"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "TK_BackgroundJobs"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,193 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using LY.MicroService.TaskManagement.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LY.MicroService.TaskManagement.Migrations |
|||
{ |
|||
[DbContext(typeof(TaskManagementMigrationsDbContext))] |
|||
[Migration("20220109033926_Add-Field-Result-With-Background-Job-Info")] |
|||
partial class AddFieldResultWithBackgroundJobInfo |
|||
{ |
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "6.0.1") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobInfo", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Args") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Args"); |
|||
|
|||
b.Property<DateTime>("BeginTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Cron") |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)") |
|||
.HasColumnName("Cron"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(255) |
|||
.HasColumnType("varchar(255)") |
|||
.HasColumnName("Description"); |
|||
|
|||
b.Property<DateTime?>("EndTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Group") |
|||
.IsRequired() |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)") |
|||
.HasColumnName("Group"); |
|||
|
|||
b.Property<int>("Interval") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<bool>("IsAbandoned") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<int>("JobType") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<DateTime?>("LastRunTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("LockTimeOut") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("MaxCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("MaxTryCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<DateTime?>("NextRunTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("Priority") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Result") |
|||
.HasMaxLength(1000) |
|||
.HasColumnType("varchar(1000)") |
|||
.HasColumnName("Result"); |
|||
|
|||
b.Property<int>("Status") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("TriggerCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("TryCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Type") |
|||
.IsRequired() |
|||
.HasMaxLength(200) |
|||
.HasColumnType("varchar(200)") |
|||
.HasColumnName("Type"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "Group"); |
|||
|
|||
b.ToTable("TK_BackgroundJobs", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobLog", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<string>("Exception") |
|||
.HasMaxLength(2000) |
|||
.HasColumnType("varchar(2000)") |
|||
.HasColumnName("Exception"); |
|||
|
|||
b.Property<string>("JobGroup") |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)") |
|||
.HasColumnName("JobGroup"); |
|||
|
|||
b.Property<Guid?>("JobId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("JobName") |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("JobName"); |
|||
|
|||
b.Property<string>("JobType") |
|||
.HasMaxLength(200) |
|||
.HasColumnType("varchar(200)") |
|||
.HasColumnName("JobType"); |
|||
|
|||
b.Property<string>("Message") |
|||
.HasMaxLength(1000) |
|||
.HasColumnType("varchar(1000)") |
|||
.HasColumnName("Message"); |
|||
|
|||
b.Property<DateTime>("RunTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("JobGroup", "JobName"); |
|||
|
|||
b.ToTable("TK_BackgroundJobLogs", (string)null); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LY.MicroService.TaskManagement.Migrations |
|||
{ |
|||
public partial class AddFieldResultWithBackgroundJobInfo : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<string>( |
|||
name: "Result", |
|||
table: "TK_BackgroundJobs", |
|||
type: "varchar(1000)", |
|||
maxLength: 1000, |
|||
nullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "Result", |
|||
table: "TK_BackgroundJobs"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,191 @@ |
|||
// <auto-generated />
|
|||
using System; |
|||
using LY.MicroService.TaskManagement.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace LY.MicroService.TaskManagement.Migrations |
|||
{ |
|||
[DbContext(typeof(TaskManagementMigrationsDbContext))] |
|||
partial class TaskManagementMigrationsDbContextModelSnapshot : ModelSnapshot |
|||
{ |
|||
protected override void BuildModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
|||
.HasAnnotation("ProductVersion", "6.0.1") |
|||
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobInfo", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("Args") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("Args"); |
|||
|
|||
b.Property<DateTime>("BeginTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ConcurrencyStamp") |
|||
.IsConcurrencyToken() |
|||
.HasMaxLength(40) |
|||
.HasColumnType("varchar(40)") |
|||
.HasColumnName("ConcurrencyStamp"); |
|||
|
|||
b.Property<DateTime>("CreationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("CreationTime"); |
|||
|
|||
b.Property<Guid?>("CreatorId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("CreatorId"); |
|||
|
|||
b.Property<string>("Cron") |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)") |
|||
.HasColumnName("Cron"); |
|||
|
|||
b.Property<string>("Description") |
|||
.HasMaxLength(255) |
|||
.HasColumnType("varchar(255)") |
|||
.HasColumnName("Description"); |
|||
|
|||
b.Property<DateTime?>("EndTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<string>("ExtraProperties") |
|||
.HasColumnType("longtext") |
|||
.HasColumnName("ExtraProperties"); |
|||
|
|||
b.Property<string>("Group") |
|||
.IsRequired() |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)") |
|||
.HasColumnName("Group"); |
|||
|
|||
b.Property<int>("Interval") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<bool>("IsAbandoned") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<bool>("IsEnabled") |
|||
.HasColumnType("tinyint(1)"); |
|||
|
|||
b.Property<int>("JobType") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<DateTime?>("LastModificationTime") |
|||
.HasColumnType("datetime(6)") |
|||
.HasColumnName("LastModificationTime"); |
|||
|
|||
b.Property<Guid?>("LastModifierId") |
|||
.HasColumnType("char(36)") |
|||
.HasColumnName("LastModifierId"); |
|||
|
|||
b.Property<DateTime?>("LastRunTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("LockTimeOut") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("MaxCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("MaxTryCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Name") |
|||
.IsRequired() |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("Name"); |
|||
|
|||
b.Property<DateTime?>("NextRunTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.Property<int>("Priority") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Result") |
|||
.HasMaxLength(1000) |
|||
.HasColumnType("varchar(1000)") |
|||
.HasColumnName("Result"); |
|||
|
|||
b.Property<int>("Status") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("TriggerCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<int>("TryCount") |
|||
.HasColumnType("int"); |
|||
|
|||
b.Property<string>("Type") |
|||
.IsRequired() |
|||
.HasMaxLength(200) |
|||
.HasColumnType("varchar(200)") |
|||
.HasColumnName("Type"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("Name", "Group"); |
|||
|
|||
b.ToTable("TK_BackgroundJobs", (string)null); |
|||
}); |
|||
|
|||
modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobLog", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd() |
|||
.HasColumnType("bigint"); |
|||
|
|||
b.Property<string>("Exception") |
|||
.HasMaxLength(2000) |
|||
.HasColumnType("varchar(2000)") |
|||
.HasColumnName("Exception"); |
|||
|
|||
b.Property<string>("JobGroup") |
|||
.HasMaxLength(50) |
|||
.HasColumnType("varchar(50)") |
|||
.HasColumnName("JobGroup"); |
|||
|
|||
b.Property<Guid?>("JobId") |
|||
.HasColumnType("char(36)"); |
|||
|
|||
b.Property<string>("JobName") |
|||
.HasMaxLength(100) |
|||
.HasColumnType("varchar(100)") |
|||
.HasColumnName("JobName"); |
|||
|
|||
b.Property<string>("JobType") |
|||
.HasMaxLength(200) |
|||
.HasColumnType("varchar(200)") |
|||
.HasColumnName("JobType"); |
|||
|
|||
b.Property<string>("Message") |
|||
.HasMaxLength(1000) |
|||
.HasColumnType("varchar(1000)") |
|||
.HasColumnName("Message"); |
|||
|
|||
b.Property<DateTime>("RunTime") |
|||
.HasColumnType("datetime(6)"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.HasIndex("JobGroup", "JobName"); |
|||
|
|||
b.ToTable("TK_BackgroundJobLogs", (string)null); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue