diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
index 5ebdf0b2eb..cb79af1665 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
@@ -81,6 +81,7 @@
"LastSeenDate": "Last seen date",
"{0}Computer{1}WillBeRemovedFromRecords": "Computer of {0} ({1}) will be removed from records",
"OrganizationDeletionWarningMessage": "Organization will be deleted",
+ "DeletingLastOwnerWarningMessage": "An organization must have at least one owner! Therefore you cannot remove this owner",
"This{0}AlreadyExistInThisOrganization": "This {0} already exist in this organization",
"AreYouSureYouWantToDeleteAllComputers": "Are you sure you want to delete all computers?",
"DeleteAll": "Delete all",
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
index 3df70437b4..2a57c6b25d 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
@@ -29,7 +29,7 @@
"ApiKey": "API key",
"UserNameNotFound": "There is no user with username {0}",
"SuccessfullyAddedToNewsletter": "Thanks you for subscribing to our newsletter!",
- "ManageProfile": "Manage your profile",
+ "MyProfile": "My profile",
"EmailNotValid": "Please enter a valid email address."
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml
index ae3255abbf..65ca8d940e 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml
@@ -1,4 +1,5 @@
@using System.Linq
+@using Microsoft.AspNetCore.Http.Extensions
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar.LanguageSwitch
@model LanguageSwitchViewComponentModel
@if (Model.OtherLanguages.Any())
@@ -11,7 +12,7 @@
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/FodyWeavers.xml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/FodyWeavers.xml
index 00e1d9a1c1..be0de3a908 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/FodyWeavers.xml
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/FodyWeavers.xml
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs
index aefad0f02e..f957fd894f 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs
@@ -73,7 +73,7 @@ namespace Volo.Abp.AspNetCore.Mvc
var controllerType = apiDescription.ActionDescriptor.AsControllerActionDescriptor().ControllerTypeInfo.AsType();
var setting = FindSetting(controllerType);
- var moduleModel = applicationModel.GetOrAddModule(GetRootPath(controllerType, setting));
+ var moduleModel = applicationModel.GetOrAddModule(GetRootPath(controllerType, setting), GetRemoteServiceName(controllerType, setting));
var controllerModel = moduleModel.GetOrAddController(controllerType.FullName, CalculateControllerName(controllerType, setting), controllerType, _modelOptions.IgnoredInterfaces);
@@ -289,6 +289,22 @@ namespace Volo.Abp.AspNetCore.Mvc
return ModuleApiDescriptionModel.DefaultRootPath;
}
+ private string GetRemoteServiceName(Type controllerType, [CanBeNull] ConventionalControllerSetting setting)
+ {
+ if (setting != null)
+ {
+ return setting.RemoteServiceName;
+ }
+
+ var remoteServiceAttr = controllerType.GetCustomAttributes().OfType().FirstOrDefault();
+ if (remoteServiceAttr?.Name != null)
+ {
+ return remoteServiceAttr.Name;
+ }
+
+ return ModuleApiDescriptionModel.DefaultRemoteServiceName;
+ }
+
[CanBeNull]
private ConventionalControllerSetting FindSetting(Type controllerType)
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpConventionalControllerOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpConventionalControllerOptions.cs
index e28ff37717..e21e6ee939 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpConventionalControllerOptions.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/AbpConventionalControllerOptions.cs
@@ -23,9 +23,16 @@ namespace Volo.Abp.AspNetCore.Mvc.Conventions
};
}
- public AbpConventionalControllerOptions Create(Assembly assembly, [CanBeNull] Action optionsAction = null)
+ public AbpConventionalControllerOptions Create(
+ Assembly assembly,
+ [CanBeNull] Action optionsAction = null)
{
- var setting = new ConventionalControllerSetting(assembly, ModuleApiDescriptionModel.DefaultRootPath);
+ var setting = new ConventionalControllerSetting(
+ assembly,
+ ModuleApiDescriptionModel.DefaultRootPath,
+ ModuleApiDescriptionModel.DefaultRemoteServiceName
+ );
+
optionsAction?.Invoke(setting);
setting.Initialize();
ConventionalControllerSettings.Add(setting);
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalControllerSetting.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalControllerSetting.cs
index fac627d182..bae2522d20 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalControllerSetting.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalControllerSetting.cs
@@ -30,6 +30,18 @@ namespace Volo.Abp.AspNetCore.Mvc.Conventions
}
private string _rootPath;
+ [NotNull]
+ public string RemoteServiceName
+ {
+ get => _remoteServiceName;
+ set
+ {
+ Check.NotNull(value, nameof(value));
+ _remoteServiceName = value;
+ }
+ }
+ private string _remoteServiceName;
+
[CanBeNull]
public Func TypePredicate { get; set; }
@@ -46,15 +58,16 @@ namespace Volo.Abp.AspNetCore.Mvc.Conventions
public Action ApiVersionConfigurer { get; set; }
- public ConventionalControllerSetting([NotNull] Assembly assembly, [NotNull] string rootPath)
+ public ConventionalControllerSetting(
+ [NotNull] Assembly assembly,
+ [NotNull] string rootPath,
+ [NotNull] string remoteServiceName)
{
- Check.NotNull(assembly, rootPath);
-
- Assembly = assembly;
- RootPath = rootPath;
+ Assembly = Check.NotNull(assembly, nameof(assembly));
+ RootPath = Check.NotNull(rootPath, nameof(rootPath));
+ RemoteServiceName = Check.NotNull(remoteServiceName, nameof(remoteServiceName));
ControllerTypes = new HashSet();
-
ApiVersions = new List();
}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs
index 17fe2d3781..12fc5af525 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs
@@ -67,7 +67,8 @@ namespace Volo.Abp.Cli.Commands
var data = JObject.Parse(json);
Logger.LogInformation("Modules are combining");
- var moduleList = GetCombinedModules(data, module);
+ var apiNameList = new Dictionary();
+ var moduleList = GetCombinedModules(data, module, out apiNameList);
if (moduleList.Count < 1)
{
@@ -85,6 +86,7 @@ namespace Volo.Abp.Cli.Commands
var moduleValue = JObject.Parse(moduleItem.Value);
var rootPath = moduleItem.Key;
+ var apiName = apiNameList.Where(p => p.Key == rootPath).Select(p => p.Value).FirstOrDefault();
Logger.LogInformation($"{rootPath} directory is creating");
@@ -105,6 +107,8 @@ namespace Volo.Abp.Cli.Commands
serviceFileText.AppendLine("");
serviceFileText.AppendLine("@Injectable({providedIn: 'root'})");
serviceFileText.AppendLine("export class [controllerName]Service {");
+ serviceFileText.AppendLine(" apiName = '"+ apiName + "';");
+ serviceFileText.AppendLine("");
serviceFileText.AppendLine(" constructor(private restService: RestService) {}");
serviceFileText.AppendLine("");
@@ -309,8 +313,8 @@ namespace Volo.Abp.Cli.Commands
serviceFileText.AppendLine(
url.Contains("${")
- ? $" return this.restService.request({{ url: `/{url}`, method: '{httpMethod}'{bodyExtra}{modelBindingExtra} }});"
- : $" return this.restService.request({{ url: '/{url}', method: '{httpMethod}'{bodyExtra}{modelBindingExtra} }});");
+ ? $" return this.restService.request({{ url: `/{url}`, method: '{httpMethod}'{bodyExtra}{modelBindingExtra} }},{{ apiName: this.apiName }});"
+ : $" return this.restService.request({{ url: '/{url}', method: '{httpMethod}'{bodyExtra}{modelBindingExtra} }},{{ apiName: this.apiName }});");
serviceFileText.AppendLine(" }");
@@ -369,13 +373,15 @@ namespace Volo.Abp.Cli.Commands
Logger.LogInformation("Completed!");
}
- private Dictionary GetCombinedModules(JToken data, string module)
+ private Dictionary GetCombinedModules(JToken data, string module, out Dictionary apiNameList)
{
var moduleList = new Dictionary();
+ apiNameList = new Dictionary();
foreach (var moduleItem in data["modules"])
{
var rootPath = ((string)moduleItem.First["rootPath"]).ToLower();
+ var apiName = (string)moduleItem.First["remoteServiceName"];
if (moduleList.Any(p => p.Key == rootPath))
{
@@ -385,6 +391,7 @@ namespace Volo.Abp.Cli.Commands
}
else
{
+ apiNameList.Add(rootPath, apiName);
moduleList.Add(rootPath, moduleItem.First["controllers"].ToString());
}
}
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/RemoteServiceAttribute.cs b/framework/src/Volo.Abp.Core/Volo/Abp/RemoteServiceAttribute.cs
index e866022437..84e46e2709 100644
--- a/framework/src/Volo.Abp.Core/Volo/Abp/RemoteServiceAttribute.cs
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/RemoteServiceAttribute.cs
@@ -17,6 +17,13 @@ namespace Volo.Abp
///
public bool IsMetadataEnabled { get; set; }
+ ///
+ /// Group name of the remote service.
+ /// Group names of all services of a module expected to be the same.
+ /// This name is also used to distinguish the service endpoint of this group.
+ ///
+ public string Name { get; set; }
+
public RemoteServiceAttribute(bool isEnabled = true)
{
IsEnabled = isEnabled;
diff --git a/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModel.cs b/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModel.cs
index fad94b3745..cc09b7a153 100644
--- a/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModel.cs
+++ b/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModel.cs
@@ -36,9 +36,9 @@ namespace Volo.Abp.Http.Modeling
return Modules[module.RootPath] = module;
}
- public ModuleApiDescriptionModel GetOrAddModule(string rootPath)
+ public ModuleApiDescriptionModel GetOrAddModule(string rootPath, string remoteServiceName)
{
- return Modules.GetOrAdd(rootPath, () => ModuleApiDescriptionModel.Create(rootPath));
+ return Modules.GetOrAdd(rootPath, () => ModuleApiDescriptionModel.Create(rootPath, remoteServiceName));
}
public ApplicationApiDescriptionModel CreateSubModel(string[] modules = null, string[] controllers = null, string[] actions = null)
diff --git a/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ModuleApiDescriptionModel.cs b/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ModuleApiDescriptionModel.cs
index 44967fa50c..b879b90135 100644
--- a/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ModuleApiDescriptionModel.cs
+++ b/framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ModuleApiDescriptionModel.cs
@@ -11,10 +11,17 @@ namespace Volo.Abp.Http.Modeling
///
/// "app".
///
- public const string DefaultRootPath = "app";
+ public const string DefaultRootPath = "app";
+ ///
+ /// "Default".
+ ///
+ public const string DefaultRemoteServiceName = "Default";
+
public string RootPath { get; set; }
+ public string RemoteServiceName { get; set; }
+
public IDictionary Controllers { get; set; }
private ModuleApiDescriptionModel()
@@ -22,11 +29,12 @@ namespace Volo.Abp.Http.Modeling
}
- public static ModuleApiDescriptionModel Create(string rootPath)
+ public static ModuleApiDescriptionModel Create(string rootPath, string remoteServiceName)
{
return new ModuleApiDescriptionModel
{
RootPath = rootPath,
+ RemoteServiceName = remoteServiceName,
Controllers = new Dictionary()
};
}
@@ -48,7 +56,7 @@ namespace Volo.Abp.Http.Modeling
public ModuleApiDescriptionModel CreateSubModel(string[] controllers, string[] actions)
{
- var subModel = Create(RootPath);
+ var subModel = Create(RootPath, RemoteServiceName);
foreach (var controller in Controllers.Values)
{
diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AccountRemoteServiceConsts.cs b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AccountRemoteServiceConsts.cs
new file mode 100644
index 0000000000..43e5ca15fa
--- /dev/null
+++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/AccountRemoteServiceConsts.cs
@@ -0,0 +1,7 @@
+namespace Volo.Abp.Account
+{
+ public static class AccountRemoteServiceConsts
+ {
+ public const string RemoteServiceName = "AbpAccount";
+ }
+}
\ No newline at end of file
diff --git a/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo/Abp/Account/AbpAccountHttpApiClientModule.cs b/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo/Abp/Account/AbpAccountHttpApiClientModule.cs
index 2cfba522cb..a1eb2f9263 100644
--- a/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo/Abp/Account/AbpAccountHttpApiClientModule.cs
+++ b/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo/Abp/Account/AbpAccountHttpApiClientModule.cs
@@ -9,11 +9,10 @@ namespace Volo.Abp.Account
typeof(AbpHttpClientModule))]
public class AbpAccountHttpApiClientModule : AbpModule
{
- public const string RemoteServiceName = "Account";
-
public override void ConfigureServices(ServiceConfigurationContext context)
{
- context.Services.AddHttpClientProxies(typeof(AbpAccountApplicationContractsModule).Assembly, RemoteServiceName);
+ context.Services.AddHttpClientProxies(typeof(AbpAccountApplicationContractsModule).Assembly,
+ AccountRemoteServiceConsts.RemoteServiceName);
}
}
}
\ No newline at end of file
diff --git a/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs b/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs
index e175607842..fa479568aa 100644
--- a/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs
+++ b/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs
@@ -5,7 +5,7 @@ using Volo.Abp.Identity;
namespace Volo.Abp.Account
{
- [RemoteService]
+ [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Area("account")]
[Route("api/account")]
public class AccountController : AbpController, IAccountAppService
diff --git a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs
index 4a1689e8e9..1cfc96091a 100644
--- a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs
+++ b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs
@@ -15,7 +15,7 @@ using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace Volo.Abp.Account.Web.Areas.Account.Controllers
{
- [RemoteService]
+ [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)]
[Controller]
[ControllerName("Login")]
[Area("Account")]
diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingRemoteServiceConsts.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingRemoteServiceConsts.cs
new file mode 100644
index 0000000000..e11f75adfb
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingRemoteServiceConsts.cs
@@ -0,0 +1,7 @@
+namespace Volo.Blogging
+{
+ public static class BloggingRemoteServiceConsts
+ {
+ public const string RemoteServiceName = "Blogging";
+ }
+}
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogEto.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogEto.cs
new file mode 100644
index 0000000000..ceb0b977cf
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogEto.cs
@@ -0,0 +1,20 @@
+using System;
+using JetBrains.Annotations;
+
+namespace Volo.Blogging.Blogs
+{
+ [Serializable]
+ public class BlogEto
+ {
+ public Guid Id { get; set; }
+
+ [NotNull]
+ public string Name { get; set; }
+
+ [NotNull]
+ public string ShortName { get; set; }
+
+ [CanBeNull]
+ public string Description { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Comments/CommentEto.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Comments/CommentEto.cs
new file mode 100644
index 0000000000..dd1b5ccb41
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Comments/CommentEto.cs
@@ -0,0 +1,16 @@
+using System;
+
+namespace Volo.Blogging.Comments
+{
+ [Serializable]
+ public class CommentEto
+ {
+ public Guid Id { get; set; }
+
+ public Guid PostId { get; set; }
+
+ public Guid? RepliedCommentId { get; set; }
+
+ public string Text { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/PostEto.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/PostEto.cs
new file mode 100644
index 0000000000..90a88833c7
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/PostEto.cs
@@ -0,0 +1,29 @@
+using JetBrains.Annotations;
+using System;
+using System.Collections.Generic;
+using Volo.Blogging.Tagging;
+
+namespace Volo.Blogging.Posts
+{
+ [Serializable]
+ public class PostEto
+ {
+ public Guid Id { get; set; }
+
+ public Guid BlogId { get; set; }
+
+ [NotNull]
+ public string Url { get; set; }
+
+ [NotNull]
+ public string CoverImage { get; set; }
+
+ [NotNull]
+ public string Title { get; set; }
+
+ [CanBeNull]
+ public string Content { get; set; }
+
+ public int ReadCount { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Tagging/TagEto.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Tagging/TagEto.cs
new file mode 100644
index 0000000000..0f461a0281
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Tagging/TagEto.cs
@@ -0,0 +1,20 @@
+using System;
+using JetBrains.Annotations;
+
+namespace Volo.Blogging.Tagging
+{
+ [Serializable]
+ public class TagEto
+ {
+ public Guid Id { get; set; }
+
+ public Guid BlogId { get; set; }
+
+ [NotNull]
+ public string Name { get; set; }
+
+ public string Description { get; set; }
+
+ public int UsageCount { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj b/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj
index a7cbc2c7c6..73cf0498c5 100644
--- a/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj
+++ b/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj
@@ -13,6 +13,7 @@
+
diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainMappingProfile.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainMappingProfile.cs
new file mode 100644
index 0000000000..da36b39049
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainMappingProfile.cs
@@ -0,0 +1,19 @@
+using AutoMapper;
+using Volo.Blogging.Blogs;
+using Volo.Blogging.Comments;
+using Volo.Blogging.Posts;
+using Volo.Blogging.Tagging;
+
+namespace Volo.Blogging
+{
+ public class BloggingDomainMappingProfile : Profile
+ {
+ public BloggingDomainMappingProfile()
+ {
+ CreateMap();
+ CreateMap();
+ CreateMap();
+ CreateMap();
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs
index 4690546a7e..f39c4c88fb 100644
--- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs
+++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs
@@ -1,13 +1,37 @@
-using Volo.Abp.Domain;
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.AutoMapper;
+using Volo.Abp.Domain;
+using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Modularity;
+using Volo.Blogging.Blogs;
+using Volo.Blogging.Comments;
+using Volo.Blogging.Posts;
+using Volo.Blogging.Tagging;
namespace Volo.Blogging
{
[DependsOn(
typeof(BloggingDomainSharedModule),
- typeof(AbpDddDomainModule))]
+ typeof(AbpDddDomainModule),
+ typeof(AbpAutoMapperModule))]
public class BloggingDomainModule : AbpModule
{
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ context.Services.AddAutoMapperObjectMapper();
+ Configure(options =>
+ {
+ options.AddProfile(validate: true);
+ });
+
+ Configure(options =>
+ {
+ options.EtoMappings.Add(typeof(BloggingDomainModule));
+ options.EtoMappings.Add(typeof(BloggingDomainModule));
+ options.EtoMappings.Add(typeof(BloggingDomainModule));
+ options.EtoMappings.Add(typeof(BloggingDomainModule));
+ });
+ }
}
}
diff --git a/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo/Blogging/BloggingHttpApiClientModule.cs b/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo/Blogging/BloggingHttpApiClientModule.cs
index 7e1418cbb0..0b33ff3367 100644
--- a/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo/Blogging/BloggingHttpApiClientModule.cs
+++ b/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo/Blogging/BloggingHttpApiClientModule.cs
@@ -9,11 +9,10 @@ namespace Volo.Blogging
typeof(AbpHttpClientModule))]
public class BloggingHttpApiClientModule : AbpModule
{
- public const string RemoteServiceName = "Blogging";
-
public override void ConfigureServices(ServiceConfigurationContext context)
{
- context.Services.AddHttpClientProxies(typeof(BloggingApplicationContractsModule).Assembly, RemoteServiceName);
+ context.Services.AddHttpClientProxies(typeof(BloggingApplicationContractsModule).Assembly,
+ BloggingRemoteServiceConsts.RemoteServiceName);
}
}
diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogFilesController.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogFilesController.cs
index 818435a78c..f71a0af6c2 100644
--- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogFilesController.cs
+++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogFilesController.cs
@@ -10,7 +10,7 @@ using Volo.Blogging.Files;
namespace Volo.Blogging
{
- [RemoteService]
+ [RemoteService(Name = BloggingRemoteServiceConsts.RemoteServiceName)]
[Area("blogging")]
[Route("api/blogging/files")]
public class BlogFilesController : AbpController, IFileAppService
diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs
index 084afb958a..cb67ac3fb7 100644
--- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs
+++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs
@@ -9,7 +9,7 @@ using Volo.Blogging.Blogs.Dtos;
namespace Volo.Blogging
{
- [RemoteService]
+ [RemoteService(Name = BloggingRemoteServiceConsts.RemoteServiceName)]
[Area("blogging")]
[Route("api/blogging/blogs")]
public class BlogsController : AbpController, IBlogAppService
diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/CommentsController.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/CommentsController.cs
index 270d8f1e13..caea1cfa2f 100644
--- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/CommentsController.cs
+++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/CommentsController.cs
@@ -9,7 +9,7 @@ using Volo.Blogging.Comments.Dtos;
namespace Volo.Blogging
{
- [RemoteService]
+ [RemoteService(Name = BloggingRemoteServiceConsts.RemoteServiceName)]
[Area("blogging")]
[Route("api/blogging/comments")]
public class CommentsController : AbpController, ICommentAppService
diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs
index 332f60c256..f7a1c01703 100644
--- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs
+++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs
@@ -8,7 +8,7 @@ using Volo.Blogging.Posts;
namespace Volo.Blogging
{
- [RemoteService]
+ [RemoteService(Name = BloggingRemoteServiceConsts.RemoteServiceName)]
[Area("blogging")]
[Route("api/blogging/posts")]
public class PostsController : AbpController, IPostAppService
diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/TagsController.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/TagsController.cs
index ede42dd264..6f17623a5e 100644
--- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/TagsController.cs
+++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/TagsController.cs
@@ -9,7 +9,7 @@ using Volo.Blogging.Tagging.Dtos;
namespace Volo.Blogging
{
- [RemoteService]
+ [RemoteService(Name = BloggingRemoteServiceConsts.RemoteServiceName)]
[Area("blogging")]
[Route("api/blogging/tags")]
public class TagsController : AbpController, ITagAppService
diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentEto.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentEto.cs
new file mode 100644
index 0000000000..12f62f8b6d
--- /dev/null
+++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentEto.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+
+namespace Volo.Docs.Documents
+{
+ [Serializable]
+ public class DocumentEto
+ {
+ public Guid Id { get; set; }
+
+ public Guid ProjectId { get; set; }
+
+ public string Name { get; set; }
+
+ public string Version { get; set; }
+
+ public string LanguageCode { get; set; }
+
+ public string FileName { get; set; }
+
+ public string Content { get; set; }
+
+ public string Format { get; set; }
+
+ public string EditLink { get; set; }
+
+ public string RootUrl { get; set; }
+
+ public string RawRootUrl { get; set; }
+
+ public string LocalDirectory { get; set; }
+
+ public DateTime CreationTime { get; set; }
+
+ public DateTime LastUpdatedTime { get; set; }
+
+ public DateTime? LastSignificantUpdateTime { get; set; }
+
+ public DateTime LastCachedTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectEto.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectEto.cs
new file mode 100644
index 0000000000..dae1affae4
--- /dev/null
+++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectEto.cs
@@ -0,0 +1,30 @@
+using System;
+
+namespace Volo.Docs.Projects
+{
+ [Serializable]
+ public class ProjectEto
+ {
+ public Guid Id { get; set; }
+
+ public string Name { get; set; }
+
+ public string ShortName { get; set; }
+
+ public string Format { get; set; }
+
+ public string DefaultDocumentName { get; set; }
+
+ public string NavigationDocumentName { get; set; }
+
+ public string ParametersDocumentName { get; set; }
+
+ public string MinimumVersion { get; set; }
+
+ public string DocumentStoreType { get; set; }
+
+ public string MainWebsiteUrl { get; set; }
+
+ public string LatestVersionBranchName { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj
index e3bc883c85..5331433e24 100644
--- a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj
+++ b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj
@@ -25,6 +25,7 @@
+
diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainMappingProfile.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainMappingProfile.cs
new file mode 100644
index 0000000000..74f7224ea6
--- /dev/null
+++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainMappingProfile.cs
@@ -0,0 +1,15 @@
+using AutoMapper;
+using Volo.Docs.Documents;
+using Volo.Docs.Projects;
+
+namespace Volo.Docs
+{
+ public class DocsDomainMappingProfile : Profile
+ {
+ public DocsDomainMappingProfile()
+ {
+ CreateMap();
+ CreateMap();
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs
index ba2ee6018d..5e53b858ce 100644
--- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs
+++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs
@@ -2,7 +2,9 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp;
+using Volo.Abp.AutoMapper;
using Volo.Abp.Domain;
+using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Threading;
@@ -12,17 +14,32 @@ using Volo.Docs.Documents.FullSearch.Elastic;
using Volo.Docs.FileSystem.Documents;
using Volo.Docs.GitHub.Documents;
using Volo.Docs.Localization;
+using Volo.Docs.Projects;
namespace Volo.Docs
{
[DependsOn(
typeof(DocsDomainSharedModule),
- typeof(AbpDddDomainModule)
+ typeof(AbpDddDomainModule),
+ typeof(AbpAutoMapperModule)
)]
public class DocsDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
+ context.Services.AddAutoMapperObjectMapper();
+
+ Configure(options =>
+ {
+ options.AddProfile(validate: true);
+ });
+
+ Configure(options =>
+ {
+ options.EtoMappings.Add(typeof(DocsDomainModule));
+ options.EtoMappings.Add(typeof(DocsDomainModule));
+ });
+
Configure(options =>
{
options.FileSets
diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/FeatureManagementRemoteServiceConsts.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/FeatureManagementRemoteServiceConsts.cs
new file mode 100644
index 0000000000..749805da05
--- /dev/null
+++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/FeatureManagementRemoteServiceConsts.cs
@@ -0,0 +1,7 @@
+namespace Volo.Abp.FeatureManagement
+{
+ public class FeatureManagementRemoteServiceConsts
+ {
+ public const string RemoteServiceName = "FeatureManagement";
+ }
+}
\ No newline at end of file
diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/Volo/Abp/FeatureManagement/AbpFeatureManagementHttpApiClientModule.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/Volo/Abp/FeatureManagement/AbpFeatureManagementHttpApiClientModule.cs
index 002a7c3a9a..1bfd2a752c 100644
--- a/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/Volo/Abp/FeatureManagement/AbpFeatureManagementHttpApiClientModule.cs
+++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/Volo/Abp/FeatureManagement/AbpFeatureManagementHttpApiClientModule.cs
@@ -9,13 +9,11 @@ namespace Volo.Abp.FeatureManagement
typeof(AbpHttpClientModule))]
public class AbpFeatureManagementHttpApiClientModule : AbpModule
{
- public const string RemoteServiceName = "AbpFeatureManagement";
-
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(AbpFeatureManagementApplicationContractsModule).Assembly,
- RemoteServiceName
+ FeatureManagementRemoteServiceConsts.RemoteServiceName
);
}
}
diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi/Volo/Abp/FeatureManagement/FeaturesController.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi/Volo/Abp/FeatureManagement/FeaturesController.cs
index a56ff24275..e3eda46033 100644
--- a/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi/Volo/Abp/FeatureManagement/FeaturesController.cs
+++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi/Volo/Abp/FeatureManagement/FeaturesController.cs
@@ -4,7 +4,7 @@ using Volo.Abp.AspNetCore.Mvc;
namespace Volo.Abp.FeatureManagement
{
- [RemoteService]
+ [RemoteService(Name = FeatureManagementRemoteServiceConsts.RemoteServiceName)]
[Area("abp")]
public class FeaturesController : AbpController, IFeatureAppService
{
diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRemoteServiceConsts.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRemoteServiceConsts.cs
new file mode 100644
index 0000000000..2e151f54b7
--- /dev/null
+++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityRemoteServiceConsts.cs
@@ -0,0 +1,7 @@
+namespace Volo.Abp.Identity
+{
+ public static class IdentityRemoteServiceConsts
+ {
+ public const string RemoteServiceName = "AbpIdentity";
+ }
+}
diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs
index ed830a1212..d4283e06f5 100644
--- a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs
+++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs
@@ -9,13 +9,11 @@ namespace Volo.Abp.Identity
typeof(AbpHttpClientModule))]
public class AbpIdentityHttpApiClientModule : AbpModule
{
- public const string RemoteServiceName = "AbpIdentity";
-
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(AbpIdentityApplicationContractsModule).Assembly,
- RemoteServiceName
+ IdentityRemoteServiceConsts.RemoteServiceName
);
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs
index 451e4d49f7..5d563b127e 100644
--- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs
+++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityRoleController.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
@@ -7,7 +6,7 @@ using Volo.Abp.AspNetCore.Mvc;
namespace Volo.Abp.Identity
{
- [RemoteService]
+ [RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)]
[Area("identity")]
[ControllerName("Role")]
[Route("api/identity/roles")]
diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs
index 43bdf844d7..b9b02a7150 100644
--- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs
+++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs
@@ -6,7 +6,7 @@ using Volo.Abp.AspNetCore.Mvc;
namespace Volo.Abp.Identity
{
- [RemoteService]
+ [RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)]
[Area("identity")]
[ControllerName("User")]
[Route("api/identity/users")]
diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserLookupController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserLookupController.cs
index 6bd3bec020..2f8011bf7f 100644
--- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserLookupController.cs
+++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserLookupController.cs
@@ -6,7 +6,7 @@ using Volo.Abp.Users;
namespace Volo.Abp.Identity
{
- [RemoteService]
+ [RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)]
[Area("identity")]
[ControllerName("UserLookup")]
[Route("api/identity/users/lookup")]
diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs
index d6ed67a7b8..91b1bc8325 100644
--- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs
+++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs
@@ -4,7 +4,7 @@ using Volo.Abp.AspNetCore.Mvc;
namespace Volo.Abp.Identity
{
- [RemoteService]
+ [RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)]
[Area("identity")]
[ControllerName("Profile")]
[Route("/api/identity/my-profile")]
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceEto.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceEto.cs
new file mode 100644
index 0000000000..1130b0bc92
--- /dev/null
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceEto.cs
@@ -0,0 +1,20 @@
+using System;
+using JetBrains.Annotations;
+
+namespace Volo.Abp.IdentityServer.ApiResources
+{
+ [Serializable]
+ public class ApiResourceEto
+ {
+ public Guid Id { get; set; }
+
+ [NotNull]
+ public string Name { get; set; }
+
+ public string DisplayName { get; set; }
+
+ public string Description { get; set; }
+
+ public bool Enabled { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientEto.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientEto.cs
new file mode 100644
index 0000000000..e5957eef5a
--- /dev/null
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientEto.cs
@@ -0,0 +1,84 @@
+using System;
+
+namespace Volo.Abp.IdentityServer.Clients
+{
+ [Serializable]
+ public class ClientEto
+ {
+ public Guid Id { get; set; }
+
+ public string ClientId { get; set; }
+
+ public string ClientName { get; set; }
+
+ public string Description { get; set; }
+
+ public string ClientUri { get; set; }
+
+ public string LogoUri { get; set; }
+
+ public bool Enabled { get; set; } = true;
+
+ public string ProtocolType { get; set; }
+
+ public bool RequireClientSecret { get; set; }
+
+ public bool RequireConsent { get; set; }
+
+ public bool AllowRememberConsent { get; set; }
+
+ public bool AlwaysIncludeUserClaimsInIdToken { get; set; }
+
+ public bool RequirePkce { get; set; }
+
+ public bool AllowPlainTextPkce { get; set; }
+
+ public bool AllowAccessTokensViaBrowser { get; set; }
+
+ public string FrontChannelLogoutUri { get; set; }
+
+ public bool FrontChannelLogoutSessionRequired { get; set; }
+
+ public string BackChannelLogoutUri { get; set; }
+
+ public bool BackChannelLogoutSessionRequired { get; set; }
+
+ public bool AllowOfflineAccess { get; set; }
+
+ public int IdentityTokenLifetime { get; set; }
+
+ public int AccessTokenLifetime { get; set; }
+
+ public int AuthorizationCodeLifetime { get; set; }
+
+ public int? ConsentLifetime { get; set; }
+
+ public int AbsoluteRefreshTokenLifetime { get; set; }
+
+ public int SlidingRefreshTokenLifetime { get; set; }
+
+ public int RefreshTokenUsage { get; set; }
+
+ public bool UpdateAccessTokenClaimsOnRefresh { get; set; }
+
+ public int RefreshTokenExpiration { get; set; }
+
+ public int AccessTokenType { get; set; }
+
+ public bool EnableLocalLogin { get; set; }
+
+ public bool IncludeJwtId { get; set; }
+
+ public bool AlwaysSendClientClaims { get; set; }
+
+ public string ClientClaimsPrefix { get; set; }
+
+ public string PairWiseSubjectSalt { get; set; }
+
+ public int? UserSsoLifetime { get; set; }
+
+ public string UserCodeType { get; set; }
+
+ public int DeviceCodeLifetime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Devices/DeviceFlowCodesEto.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Devices/DeviceFlowCodesEto.cs
new file mode 100644
index 0000000000..f82af68bbf
--- /dev/null
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Devices/DeviceFlowCodesEto.cs
@@ -0,0 +1,22 @@
+using System;
+
+namespace Volo.Abp.IdentityServer.Devices
+{
+ [Serializable]
+ public class DeviceFlowCodesEto
+ {
+ public Guid Id { get; set; }
+
+ public string DeviceCode { get; set; }
+
+ public string UserCode { get; set; }
+
+ public string SubjectId { get; set; }
+
+ public string ClientId { get; set; }
+
+ public DateTime? Expiration { get; set; }
+
+ public string Data { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantEto.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantEto.cs
new file mode 100644
index 0000000000..9d5db878f7
--- /dev/null
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantEto.cs
@@ -0,0 +1,24 @@
+using System;
+
+namespace Volo.Abp.IdentityServer.Grants
+{
+ [Serializable]
+ public class PersistedGrantEto
+ {
+ public Guid Id { get; set; }
+
+ public string Key { get; set; }
+
+ public string Type { get; set; }
+
+ public string SubjectId { get; set; }
+
+ public string ClientId { get; set; }
+
+ public DateTime CreationTime { get; set; }
+
+ public DateTime? Expiration { get; set; }
+
+ public string Data { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceEto.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceEto.cs
new file mode 100644
index 0000000000..c382642a9f
--- /dev/null
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceEto.cs
@@ -0,0 +1,24 @@
+using System;
+
+namespace Volo.Abp.IdentityServer.IdentityResources
+{
+ [Serializable]
+ public class IdentityResourceEto
+ {
+ public Guid Id { get; set; }
+
+ public string Name { get; set; }
+
+ public string DisplayName { get; set; }
+
+ public string Description { get; set; }
+
+ public bool Enabled { get; set; }
+
+ public bool Required { get; set; }
+
+ public bool Emphasize { get; set; }
+
+ public bool ShowInDiscoveryDocument { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs
index 0ff798e7fd..ef1969fe24 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs
@@ -6,7 +6,13 @@ using Microsoft.Extensions.Options;
using Volo.Abp.AutoMapper;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Caching;
+using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Identity;
+using Volo.Abp.IdentityServer.ApiResources;
+using Volo.Abp.IdentityServer.Clients;
+using Volo.Abp.IdentityServer.Devices;
+using Volo.Abp.IdentityServer.Grants;
+using Volo.Abp.IdentityServer.IdentityResources;
using Volo.Abp.IdentityServer.Tokens;
using Volo.Abp.Modularity;
using Volo.Abp.Security;
@@ -34,6 +40,14 @@ namespace Volo.Abp.IdentityServer
options.AddProfile(validate: true);
});
+ Configure(options =>
+ {
+ options.EtoMappings.Add(typeof(AbpIdentityServerDomainModule));
+ options.EtoMappings.Add(typeof(AbpIdentityServerDomainModule));
+ options.EtoMappings.Add(typeof(AbpIdentityServerDomainModule));
+ options.EtoMappings.Add(typeof(AbpIdentityServerDomainModule));
+ });
+
AddIdentityServer(context.Services);
}
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityServerAutoMapperProfile.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityServerAutoMapperProfile.cs
index ba1f44953c..e576d9413e 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityServerAutoMapperProfile.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityServerAutoMapperProfile.cs
@@ -3,6 +3,7 @@ using System.Security.Claims;
using AutoMapper;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.Clients;
+using Volo.Abp.IdentityServer.Devices;
using Volo.Abp.IdentityServer.Grants;
using Volo.Abp.IdentityServer.IdentityResources;
@@ -82,6 +83,12 @@ namespace Volo.Abp.IdentityServer
CreateMap(MemberList.Destination)
.ForMember(dest => dest.Type, opt => opt.Condition(srs => srs != null))
.ReverseMap();
+
+ CreateMap();
+ CreateMap();
+ CreateMap();
+ CreateMap();
+ CreateMap();
}
}
}
diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/PermissionManagementRemoteServiceConsts.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/PermissionManagementRemoteServiceConsts.cs
new file mode 100644
index 0000000000..4a9644b061
--- /dev/null
+++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/PermissionManagementRemoteServiceConsts.cs
@@ -0,0 +1,7 @@
+namespace Volo.Abp.PermissionManagement
+{
+ public class PermissionManagementRemoteServiceConsts
+ {
+ public const string RemoteServiceName = "AbpPermissionManagement";
+ }
+}
\ No newline at end of file
diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi.Client/Volo/Abp/PermissionManagement/AbpPermissionManagementHttpApiClientModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi.Client/Volo/Abp/PermissionManagement/AbpPermissionManagementHttpApiClientModule.cs
index 6bdc958780..35932bba56 100644
--- a/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi.Client/Volo/Abp/PermissionManagement/AbpPermissionManagementHttpApiClientModule.cs
+++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi.Client/Volo/Abp/PermissionManagement/AbpPermissionManagementHttpApiClientModule.cs
@@ -9,13 +9,11 @@ namespace Volo.Abp.PermissionManagement
typeof(AbpHttpClientModule))]
public class AbpPermissionManagementHttpApiClientModule : AbpModule
{
- public const string RemoteServiceName = "AbpPermissionManagement";
-
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(AbpPermissionManagementApplicationContractsModule).Assembly,
- RemoteServiceName
+ PermissionManagementRemoteServiceConsts.RemoteServiceName
);
}
}
diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi/Volo/Abp/PermissionManagement/PermissionsController.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi/Volo/Abp/PermissionManagement/PermissionsController.cs
index 2dacd79d1f..2ed9a4d044 100644
--- a/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi/Volo/Abp/PermissionManagement/PermissionsController.cs
+++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi/Volo/Abp/PermissionManagement/PermissionsController.cs
@@ -4,7 +4,7 @@ using Volo.Abp.AspNetCore.Mvc;
namespace Volo.Abp.PermissionManagement
{
- [RemoteService]
+ [RemoteService(Name = PermissionManagementRemoteServiceConsts.RemoteServiceName)]
[Area("abp")]
public class PermissionsController : AbpController, IPermissionAppService
{
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantManagementRemoteServiceConsts.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantManagementRemoteServiceConsts.cs
new file mode 100644
index 0000000000..c820c1bd49
--- /dev/null
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantManagementRemoteServiceConsts.cs
@@ -0,0 +1,7 @@
+namespace Volo.Abp.TenantManagement
+{
+ public class TenantManagementRemoteServiceConsts
+ {
+ public const string RemoteServiceName = "AbpTenantManagement";
+ }
+}
\ No newline at end of file
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiClientModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiClientModule.cs
index 1cbdb36a10..7be0b53a72 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiClientModule.cs
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiClientModule.cs
@@ -9,13 +9,11 @@ namespace Volo.Abp.TenantManagement
typeof(AbpHttpClientModule))]
public class AbpTenantManagementHttpApiClientModule : AbpModule
{
- public const string RemoteServiceName = "AbpTenantManagement";
-
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(AbpTenantManagementApplicationContractsModule).Assembly,
- RemoteServiceName
+ TenantManagementRemoteServiceConsts.RemoteServiceName
);
}
}
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi/Volo/Abp/TenantManagement/TenantController.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi/Volo/Abp/TenantManagement/TenantController.cs
index 5b821fbc71..317e7e62d0 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi/Volo/Abp/TenantManagement/TenantController.cs
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi/Volo/Abp/TenantManagement/TenantController.cs
@@ -7,7 +7,7 @@ using Volo.Abp.AspNetCore.Mvc;
namespace Volo.Abp.TenantManagement
{
[Controller]
- [RemoteService]
+ [RemoteService(Name = TenantManagementRemoteServiceConsts.RemoteServiceName)]
[Area("multi-tenancy")]
[Route("api/multi-tenancy/tenants")]
public class TenantController : AbpController, ITenantAppService //TODO: Throws exception on validation if we inherit from Controller
diff --git a/npm/ng-packs/packages/core/src/lib/services/rest.service.ts b/npm/ng-packs/packages/core/src/lib/services/rest.service.ts
index 15cc13cf50..936bc2a768 100644
--- a/npm/ng-packs/packages/core/src/lib/services/rest.service.ts
+++ b/npm/ng-packs/packages/core/src/lib/services/rest.service.ts
@@ -2,10 +2,11 @@ import { HttpClient, HttpRequest } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Store } from '@ngxs/store';
import { Observable, throwError } from 'rxjs';
-import { catchError, take, tap } from 'rxjs/operators';
+import { catchError } from 'rxjs/operators';
import { RestOccurError } from '../actions/rest.actions';
import { Rest } from '../models/rest';
import { ConfigState } from '../states/config.state';
+import { isUndefinedOrEmptyString } from '../utils/common-utils';
@Injectable({
providedIn: 'root',
@@ -13,47 +14,40 @@ import { ConfigState } from '../states/config.state';
export class RestService {
constructor(private http: HttpClient, private store: Store) {}
+ private getApiFromStore(apiName: string): string {
+ return this.store.selectSnapshot(ConfigState.getApiUrl(apiName));
+ }
+
handleError(err: any): Observable {
this.store.dispatch(new RestOccurError(err));
- console.error(err);
return throwError(err);
}
+ // TODO: Deprecate service or improve interface in v3.0
request(
request: HttpRequest | Rest.Request,
config?: Rest.Config,
api?: string,
): Observable {
config = config || ({} as Rest.Config);
- const { observe = Rest.Observe.Body, skipHandleError } = config;
- const url =
- (api || this.store.selectSnapshot(ConfigState.getApiUrl(config.apiName))) + request.url;
+ api = api || this.getApiFromStore(config.apiName);
const { method, params, ...options } = request;
+ const { observe = Rest.Observe.Body, skipHandleError } = config;
return this.http
- .request(method, url, {
+ .request(method, api + request.url, {
observe,
...(params && {
- params: Object.keys(params).reduce(
- (acc, key) => ({
- ...acc,
- ...(typeof params[key] !== 'undefined' &&
- params[key] !== '' && { [key]: params[key] }),
- }),
- {},
- ),
+ params: Object.keys(params).reduce((acc, key) => {
+ const value = params[key];
+
+ if (!isUndefinedOrEmptyString(value)) acc[key] = value;
+
+ return acc;
+ }, {}),
}),
...options,
} as any)
- .pipe(
- observe === Rest.Observe.Body ? take(1) : tap(),
- catchError(err => {
- if (skipHandleError) {
- return throwError(err);
- }
-
- return this.handleError(err);
- }),
- );
+ .pipe(catchError(err => (skipHandleError ? throwError(err) : this.handleError(err))));
}
}
diff --git a/npm/ng-packs/packages/core/src/lib/tests/common-utils.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/common-utils.spec.ts
index 98c6614987..60280e396b 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/common-utils.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/common-utils.spec.ts
@@ -1,4 +1,4 @@
-import { noop } from '../utils';
+import { isUndefinedOrEmptyString, noop } from '../utils';
describe('CommonUtils', () => {
describe('#noop', () => {
@@ -7,4 +7,20 @@ describe('CommonUtils', () => {
expect(noop()()).toBeUndefined();
});
});
+
+ describe('#isUndefinedOrEmptyString', () => {
+ test.each`
+ value | expected
+ ${null} | ${false}
+ ${0} | ${false}
+ ${true} | ${false}
+ ${'x'} | ${false}
+ ${{}} | ${false}
+ ${[]} | ${false}
+ ${undefined} | ${true}
+ ${''} | ${true}
+ `('should return $expected when given parameter is $value', ({ value, expected }) => {
+ expect(isUndefinedOrEmptyString(value)).toBe(expected);
+ });
+ });
});
diff --git a/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts
index ecc8e9dce8..8251bcabb4 100644
--- a/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts
+++ b/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts
@@ -1,9 +1,8 @@
import { ConfigState } from '@abp/ng.core';
import { createHttpFactory, HttpMethod, SpectatorHttp, SpyObject } from '@ngneat/spectator/jest';
import { NgxsModule, Store } from '@ngxs/store';
-import { interval, of, Subscription, throwError, timer } from 'rxjs';
+import { of, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
-import { RestOccurError } from '../actions';
import { Rest } from '../models';
import { RestService } from '../services/rest.service';
@@ -36,6 +35,10 @@ describe('HttpClient testing', () => {
});
});
+ afterEach(() => {
+ spectator.controller.verify();
+ });
+
test('should send a GET request with params', () => {
spectator.service
.request({ method: HttpMethod.GET, url: '/test', params: { id: 1 } })
@@ -66,34 +69,16 @@ describe('HttpClient testing', () => {
spectator.expectOne('bar' + '/test', HttpMethod.GET);
});
- test('should close the subscriber when observe equal to body', done => {
- jest.spyOn(spectator.httpClient, 'request').mockReturnValue(interval(50));
+ test('should complete upon successful request', done => {
+ const complete = jest.fn(done);
- const subscriber: Subscription = spectator.service
- .request({ method: HttpMethod.GET, url: '/test' }, { observe: Rest.Observe.Body })
- .subscribe();
+ spectator.service.request({ method: HttpMethod.GET, url: '/test' }).subscribe({ complete });
- timer(51).subscribe(() => {
- expect(subscriber.closed).toBe(true);
- done();
- });
- });
-
- test('should open the subscriber when observe not equal to body', done => {
- jest.spyOn(spectator.httpClient, 'request').mockReturnValue(interval(50));
-
- const subscriber: Subscription = spectator.service
- .request({ method: HttpMethod.GET, url: '/test' }, { observe: Rest.Observe.Events })
- .subscribe();
-
- timer(51).subscribe(() => {
- expect(subscriber.closed).toBe(false);
- done();
- });
+ const req = spectator.expectOne(api + '/test', HttpMethod.GET);
+ spectator.flushAll([req], [{}]);
});
test('should handle the error', () => {
- jest.spyOn(spectator.httpClient, 'request').mockReturnValue(throwError('Testing error'));
const spy = jest.spyOn(store, 'dispatch');
spectator.service
@@ -101,15 +86,17 @@ describe('HttpClient testing', () => {
.pipe(
catchError(err => {
expect(err).toBeTruthy();
- expect(spy.mock.calls[0][0] instanceof RestOccurError).toBe(true);
+ expect(spy).toHaveBeenCalled();
return of(null);
}),
)
.subscribe();
+
+ const req = spectator.expectOne(api + '/test', HttpMethod.GET);
+ spectator.flushAll([req], [throwError('Testing error')]);
});
test('should not handle the error when skipHandleError is true', () => {
- jest.spyOn(spectator.httpClient, 'request').mockReturnValue(throwError('Testing error'));
const spy = jest.spyOn(store, 'dispatch');
spectator.service
@@ -120,10 +107,13 @@ describe('HttpClient testing', () => {
.pipe(
catchError(err => {
expect(err).toBeTruthy();
- expect(spy.mock.calls).toHaveLength(0);
+ expect(spy).toHaveBeenCalledTimes(0);
return of(null);
}),
)
.subscribe();
+
+ const req = spectator.expectOne(api + '/test', HttpMethod.GET);
+ spectator.flushAll([req], [throwError('Testing error')]);
});
});
diff --git a/npm/ng-packs/packages/core/src/lib/utils/common-utils.ts b/npm/ng-packs/packages/core/src/lib/utils/common-utils.ts
index 756d3a34dd..b8609be130 100644
--- a/npm/ng-packs/packages/core/src/lib/utils/common-utils.ts
+++ b/npm/ng-packs/packages/core/src/lib/utils/common-utils.ts
@@ -3,3 +3,7 @@ export function noop() {
const fn = function() {};
return fn;
}
+
+export function isUndefinedOrEmptyString(value: unknown): boolean {
+ return value === undefined || value === '';
+}