diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.sln b/aspnet-core/LINGYUN.MicroService.SingleProject.sln index 756196acb..eb0a92875 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.sln +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.sln @@ -692,6 +692,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.Web.OAu EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.OAuth", "modules\account\LINGYUN.Abp.Account.OAuth\LINGYUN.Abp.Account.OAuth.csproj", "{2E4C437A-989D-68D9-C5FB-1AE085B2CBC8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.Designer", "modules\elsa\LINGYUN.Abp.Elsa.Designer\LINGYUN.Abp.Elsa.Designer.csproj", "{C9756AD3-3AEA-4AA8-99E3-8305D37E0903}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1842,6 +1844,10 @@ Global {2E4C437A-989D-68D9-C5FB-1AE085B2CBC8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E4C437A-989D-68D9-C5FB-1AE085B2CBC8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E4C437A-989D-68D9-C5FB-1AE085B2CBC8}.Release|Any CPU.Build.0 = Release|Any CPU + {C9756AD3-3AEA-4AA8-99E3-8305D37E0903}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9756AD3-3AEA-4AA8-99E3-8305D37E0903}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9756AD3-3AEA-4AA8-99E3-8305D37E0903}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9756AD3-3AEA-4AA8-99E3-8305D37E0903}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2179,6 +2185,7 @@ Global {113167DA-602A-4EBE-9357-D83C090DBA3F} = {F3449D35-8671-4BF6-8D1B-EFBB8AFD61DD} {2379F502-BBBD-4BF2-91F7-D0E5C61E91B7} = {4F837B81-EA7D-472A-8482-3D5A730DF810} {2E4C437A-989D-68D9-C5FB-1AE085B2CBC8} = {4F837B81-EA7D-472A-8482-3D5A730DF810} + {C9756AD3-3AEA-4AA8-99E3-8305D37E0903} = {07DFEB1E-ED92-4E97-A801-FAB2D70F4F35} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/ApplicationSingleDataSeederWorker.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/ApplicationSingleDataSeederWorker.cs deleted file mode 100644 index c83f9be12..000000000 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/ApplicationSingleDataSeederWorker.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.Extensions.Hosting; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Data; - -namespace LY.MicroService.Applications.Single.EntityFrameworkCore.DataSeeder; - -public class ApplicationSingleDataSeederWorker : BackgroundService -{ - protected IDataSeeder DataSeeder { get; } - - public ApplicationSingleDataSeederWorker(IDataSeeder dataSeeder) - { - DataSeeder = dataSeeder; - } - - protected async override Task ExecuteAsync(CancellationToken stoppingToken) - { - await DataSeeder.SeedAsync(); - } -} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs index d95916852..432e9da66 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs @@ -11,7 +11,6 @@ using LINGYUN.Abp.TextTemplating.EntityFrameworkCore; using LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore; using LINGYUN.Abp.WeChat; using LINGYUN.Platform.EntityFrameworkCore; -using LY.MicroService.Applications.Single.EntityFrameworkCore.DataSeeder; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.Modularity; @@ -45,6 +44,5 @@ public class SingleMigrationsEntityFrameworkCoreModule : AbpModule public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAbpDbContext(); - context.Services.AddHostedService(); } } diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/AbpElsaDesignerModule.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/AbpElsaDesignerModule.cs new file mode 100644 index 000000000..e02572cfd --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/AbpElsaDesignerModule.cs @@ -0,0 +1,73 @@ +using LINGYUN.Abp.Elsa.Designer.Bundling; +using LINGYUN.Abp.Elsa.Designer.Navigation; +using LINGYUN.Abp.Elsa.Localization; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; +using Volo.Abp.VirtualFileSystem; + +namespace LINGYUN.Abp.Elsa.Designer; + +[DependsOn(typeof(AbpElsaModule))] +[DependsOn(typeof(AbpAspNetCoreMvcUiThemeSharedModule))] +public class AbpElsaDesignerModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.PreConfigure(options => + { + options.AddAssemblyResource(typeof(ElsaResource), typeof(AbpElsaDesignerModule).Assembly); + }); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpElsaDesignerModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/Localization/Resources"); + }); + + Configure(options => + { + options.MenuContributors.Add(new AbpElsaDesignerContributor()); + }); + + Configure(options => + { + options + .StyleBundles + .Add(AbpElsaBundles.Styles.Global, bundle => + { + bundle + .AddBaseBundles(StandardBundles.Styles.Global) + .AddContributors(typeof(AbpElsaStyleBundleContributor)); + }); + + options + .ScriptBundles + .Add(AbpElsaBundles.Scripts.Global, bundle => + { + bundle + .AddBaseBundles(StandardBundles.Scripts.Global) + .AddContributors(typeof(AbpElsaScriptBundleContributor)); + }); + }); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaAuthenticationContextController.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaAuthenticationContextController.cs new file mode 100644 index 000000000..0d8e2d3ab --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaAuthenticationContextController.cs @@ -0,0 +1,33 @@ +using Asp.Versioning; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc; + +namespace LINGYUN.Abp.Elsa.Designer.Areas.Elsa; + +[ApiController] +[ApiVersion("1")] +[Route("v{apiVersion:apiVersion}/ElsaAuthentication/options")] +[Produces("application/json")] +public class ElsaAuthenticationContextController : AbpControllerBase +{ + public static string CurrentTenantAccessorName { get; internal set; } = nameof(AbpTenantAccessor); + public static string TenantAccessorKeyName { get; internal set; } = "__tenant"; + [AllowAnonymous] + [HttpGet] + [ProducesResponseType(StatusCodes.Status200OK)] + public IActionResult Handle() + { + return Ok(new + { + AuthenticationStyles = new List + { + "ServerManagedCookie" // Cookie + }, + CurrentTenantAccessorName, + TenantAccessorKeyName + }); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaController.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaController.cs new file mode 100644 index 000000000..3c9679b8c --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaController.cs @@ -0,0 +1,11 @@ +using Microsoft.AspNetCore.Mvc; + +namespace LINGYUN.Abp.Elsa.Designer.Areas.Elsa; + +public class ElsaController : Controller +{ + public IActionResult Index() + { + return View(); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserInfoController.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserInfoController.cs new file mode 100644 index 000000000..4f679fa0f --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserInfoController.cs @@ -0,0 +1,25 @@ +using Asp.Versioning; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace LINGYUN.Abp.Elsa.Designer.Areas.Elsa; + +[ApiController] +[ApiVersion("1")] +[Route("v{apiVersion:apiVersion}/ElsaAuthentication/UserInfo")] +[Produces("application/json")] +public class ElsaUserInfoController : AbpControllerBase +{ + [HttpGet] + [ProducesResponseType(StatusCodes.Status200OK)] + public virtual IActionResult Handle() + { + return Ok( + new { + IsAuthenticated = CurrentUser.IsAuthenticated, + name = CurrentUser.Name ?? CurrentUser.UserName, + tenantId = CurrentUser.TenantId + }); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserLogoutController.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserLogoutController.cs new file mode 100644 index 000000000..7568b6aa5 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Areas/Elsa/ElsaUserLogoutController.cs @@ -0,0 +1,14 @@ +using Microsoft.AspNetCore.Mvc; + +namespace LINGYUN.Abp.Elsa.Designer.Areas.Elsa; + +[Route("v{apiVersion:apiVersion}/ElsaAuthentication/logout")] +[Produces("application/json")] +public class ElsaUserLogoutController : Controller +{ + [HttpGet] + public IActionResult Handle() + { + return Redirect("/Account/Logout"); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaBundles.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaBundles.cs new file mode 100644 index 000000000..49b1b225e --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaBundles.cs @@ -0,0 +1,14 @@ +namespace LINGYUN.Abp.Elsa.Designer.Bundling; + +public static class AbpElsaBundles +{ + public static class Styles + { + public const string Global = "Elsa.Designer"; + } + + public static class Scripts + { + public const string Global = "Elsa.Designer"; + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaScriptBundleContributor.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaScriptBundleContributor.cs new file mode 100644 index 000000000..1426e116c --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaScriptBundleContributor.cs @@ -0,0 +1,17 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace LINGYUN.Abp.Elsa.Designer.Bundling; + +public class AbpElsaScriptBundleContributor : BundleContributor +{ + public override void ConfigureBundle(BundleConfigurationContext context) + { + var configuration = context.ServiceProvider.GetRequiredService(); + var basePath = configuration["Hosting:BasePath"] ?? ""; + + context.Files.AddIfNotContains($"{basePath}/_content/Elsa.Designer.Components.Web/monaco-editor/min/vs/loader.js"); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaStyleBundleContributor.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaStyleBundleContributor.cs new file mode 100644 index 000000000..e86ff13f5 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Bundling/AbpElsaStyleBundleContributor.cs @@ -0,0 +1,18 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace LINGYUN.Abp.Elsa.Designer.Bundling; + +public class AbpElsaStyleBundleContributor : BundleContributor +{ + public override void ConfigureBundle(BundleConfigurationContext context) + { + var configuration = context.ServiceProvider.GetRequiredService(); + var basePath = configuration["Hosting:BasePath"] ?? ""; + + context.Files.AddIfNotContains($"{basePath}/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/fonts/inter/inter.css"); + context.Files.AddIfNotContains($"{basePath}/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/elsa-workflows-studio.css"); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/FodyWeavers.xml b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/FodyWeavers.xml new file mode 100644 index 000000000..5d6962159 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/FodyWeavers.xsd b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/LINGYUN.Abp.Elsa.Designer.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/LINGYUN.Abp.Elsa.Designer.csproj new file mode 100644 index 000000000..5d4443e24 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/LINGYUN.Abp.Elsa.Designer.csproj @@ -0,0 +1,43 @@ + + + + + + + net9.0 + LINGYUN.Abp.Elsa.Designer + LINGYUN.Abp.Elsa.Designer + false + false + false + true + LINGYUN.Abp.Elsa.Designer + Library + true + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/en.json b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/en.json new file mode 100644 index 000000000..dd2be8440 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/en.json @@ -0,0 +1,8 @@ +{ + "culture": "en", + "texts": { + "Permission:ElsaDesigner": "Elsa Designer", + "Permission:ElsaDesigner:View": "View", + "Elsa:Designer": "Elsa Designer" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/zh-Hans.json b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/zh-Hans.json new file mode 100644 index 000000000..42ce38d9e --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Localization/Resources/zh-Hans.json @@ -0,0 +1,8 @@ +{ + "culture": "zh-Hans", + "texts": { + "Permission:ElsaDesigner": "Elsa工作流设计器", + "Permission:ElsaDesigner:View": "查看", + "Elsa:Designer": "Elsa工作流设计器" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerContributor.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerContributor.cs new file mode 100644 index 000000000..c41d82c89 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerContributor.cs @@ -0,0 +1,31 @@ +using LINGYUN.Abp.Elsa.Designer.Permissions; +using LINGYUN.Abp.Elsa.Localization; +using System.Threading.Tasks; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.UI.Navigation; + +namespace LINGYUN.Abp.Elsa.Designer.Navigation; + +public class AbpElsaDesignerContributor : IMenuContributor +{ + public virtual Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name != StandardMenus.Main) + { + return Task.CompletedTask; + } + var l = context.GetLocalizer(); + + context.Menu.AddItem( + new ApplicationMenuItem( + AbpElsaDesignerMenuNames.Index, + l["Elsa:Designer"], + url: "~/Elsa", + icon: "fa fa-code-fork", + order: 1000, null) + .RequirePermissions(AbpElsaDesignerPermissionsNames.View) + ); + + return Task.CompletedTask; + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerMenuNames.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerMenuNames.cs new file mode 100644 index 000000000..52687439e --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Navigation/AbpElsaDesignerMenuNames.cs @@ -0,0 +1,8 @@ +namespace LINGYUN.Abp.Elsa.Designer.Navigation; + +public class AbpElsaDesignerMenuNames +{ + public const string GroupName = "ElsaDesigner"; + + public const string Index = GroupName + ".Index"; +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/Elsa/Index.cshtml b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/Elsa/Index.cshtml new file mode 100644 index 000000000..4b2a6cfd4 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/Elsa/Index.cshtml @@ -0,0 +1,46 @@ +@page +@using LINGYUN.Abp.Elsa.Localization; +@using LINGYUN.Abp.Elsa.Designer.Bundling; +@using LINGYUN.Abp.Elsa.Designer.Navigation; +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using Microsoft.AspNetCore.Mvc.Localization +@using Microsoft.Extensions.Configuration +@inject IPageLayout PageLayout +@inject IConfiguration Configuration; +@inject IHtmlLocalizer L +@{ + var serverUrl = Configuration["Elsa:Server:BaseUrl"]; + var basePath = Configuration["Hosting:BasePath"] ?? ""; + + PageLayout.Content.Title = L["Elsa:Designer"].Value; + PageLayout.Content.BreadCrumb.Add(L["Elsa:Designer"].Value); + PageLayout.Content.MenuItemName = AbpElsaDesignerMenuNames.Index; +} + +@section styles { + +} + +@section scripts { + +} + + + + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/_ViewImports.cshtml b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/_ViewImports.cshtml new file mode 100644 index 000000000..c1da1f5f1 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Pages/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionDefinitionProvider.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionDefinitionProvider.cs new file mode 100644 index 000000000..01fae140d --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionDefinitionProvider.cs @@ -0,0 +1,19 @@ +using LINGYUN.Abp.Elsa.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace LINGYUN.Abp.Elsa.Designer.Permissions; + +public class AbpElsaDesignerPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var elsa = context.AddGroup(AbpElsaDesignerPermissionsNames.GroupName, L("Permission:ElsaDesigner")); + elsa.AddPermission(AbpElsaDesignerPermissionsNames.View, L("Permission:ElsaDesigner:View")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionsNames.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionsNames.cs new file mode 100644 index 000000000..fd04a5b39 --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Permissions/AbpElsaDesignerPermissionsNames.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Reflection; + +namespace LINGYUN.Abp.Elsa.Designer.Permissions; + +public static class AbpElsaDesignerPermissionsNames +{ + public const string GroupName = "Abp.Elsa.Designer"; + + public const string View = GroupName + ".View"; + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(AbpElsaDesignerPermissionsNames)); + } +} diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Properties/launchSettings.json b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Properties/launchSettings.json new file mode 100644 index 000000000..71bd7d92d --- /dev/null +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Designer/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "LINGYUN.Abp.Elsa.Designer": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:59137;http://localhost:59139" + } + } +} \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Controllers/HomeController.cs b/aspnet-core/services/LY.MicroService.Applications.Single/Controllers/HomeController.cs index 2e44d0285..092d68277 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/Controllers/HomeController.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Controllers/HomeController.cs @@ -6,6 +6,6 @@ public class HomeController : Controller { public IActionResult Index() { - return Redirect("/swagger"); + return View(); } } diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs b/aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs index d9c8959de..c74f10c7f 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs @@ -201,6 +201,7 @@ global using Volo.Abp.SettingManagement.EntityFrameworkCore; global using Volo.Abp.SettingManagement.Localization; global using Volo.Abp.SettingManagement.Web; global using Volo.Abp.Sms; +global using Volo.Abp.Swashbuckle; global using Volo.Abp.Threading; global using Volo.Abp.UI.Navigation.Urls; global using Volo.Abp.VirtualFileExplorer.Web; diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj index de2942f89..e76326354 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj +++ b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj @@ -20,7 +20,6 @@ - @@ -155,6 +154,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs index dd1b896d3..3648955d4 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs @@ -286,6 +286,8 @@ public partial class MicroServiceApplicationsSingleModule // // can also be used to control the format of the API version in route templates // options.SubstituteApiVersionInUrl = true; //}); + services.AddRazorPages(); + services.AddControllersWithViews().AddNewtonsoftJson(); } private void ConfigureKestrelServer(IConfiguration configuration, IWebHostEnvironment environment) diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs index 8fa30a07b..61e3c3288 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Swashbuckle; +using LINGYUN.Abp.Elsa.Designer; namespace LY.MicroService.Applications.Single; @@ -362,6 +362,8 @@ namespace LY.MicroService.Applications.Single; typeof(AbpElsaActivitiesModule), // Elsa工作流模块 实体框架 typeof(AbpElsaEntityFrameworkCoreModule), + // Elsa工作流设计器模块 + typeof(AbpElsaDesignerModule), // 数据导出模块 MiniExcel集成 typeof(AbpExporterMiniExcelModule), @@ -439,4 +441,11 @@ public partial class MicroServiceApplicationsSingleModule : AbpModule ConfigureSingleModule(context.Services, hostingEnvironment.IsDevelopment()); } + + public async override Task OnPostApplicationInitializationAsync(ApplicationInitializationContext context) + { + await context.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } } diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Pages/Index.cshtml b/aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml similarity index 95% rename from aspnet-core/services/LY.MicroService.Applications.Single/Pages/Index.cshtml rename to aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml index e7c2a02c1..3db3ecb98 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/Pages/Index.cshtml +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml @@ -1,5 +1,5 @@ @page -@using LY.MicroService.Applications.Single.Pages +@using LY.MicroService.Applications.Single.Pages.Home @using Volo.Abp.Users @model IndexModel @inject ICurrentUser CurrentUser diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Pages/Index.cshtml.cs b/aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml.cs similarity index 72% rename from aspnet-core/services/LY.MicroService.Applications.Single/Pages/Index.cshtml.cs rename to aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml.cs index 5faeb8a4d..6b8242465 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/Pages/Index.cshtml.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Views/Home/Index.cshtml.cs @@ -1,6 +1,6 @@ using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; -namespace LY.MicroService.Applications.Single.Pages +namespace LY.MicroService.Applications.Single.Pages.Home { public class IndexModel : AbpPageModel { diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Views/_ViewImports.cshtml b/aspnet-core/services/LY.MicroService.Applications.Single/Views/_ViewImports.cshtml new file mode 100644 index 000000000..c1da1f5f1 --- /dev/null +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Views/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file