diff --git a/aspnet-core/CompanyName.ProjectName.sln b/aspnet-core/CompanyName.ProjectName.sln
index aba6c067..ea320edb 100644
--- a/aspnet-core/CompanyName.ProjectName.sln
+++ b/aspnet-core/CompanyName.ProjectName.sln
@@ -127,12 +127,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.Sha
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.Shared.Hosting.Gateways", "shared\CompanyName.ProjectName.Shared.Hosting.Gateways\CompanyName.ProjectName.Shared.Hosting.Gateways.csproj", "{C018EFF9-579E-43B3-9181-543BE95E2E03}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ElasticSearch", "ElasticSearch", "{3F507591-5C8A-49A7-AB0A-043B64B7EC41}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1A57338B-65B1-4B8F-ABBD-83F4E8321D8F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.Abp.ElasticSearch", "frameworks\ElasticSearch\src\Lion.Abp.ElasticSearch\Lion.Abp.ElasticSearch.csproj", "{48D938A1-36E4-4AC1-9AF2-645CB75D4A05}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.Abp.Cap", "frameworks\CAP\src\Lion.Abp.Cap\Lion.Abp.Cap.csproj", "{800F4482-EAC3-472B-AF07-53980D47AA41}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.Abp.Extension", "frameworks\Extensions\src\Lion.Abp.Extension\Lion.Abp.Extension.csproj", "{6848FA46-EFFF-4E0C-8EAA-145D8C440333}"
@@ -143,6 +137,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.Web
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.FreeSqlRepository", "services\src\CompanyName.ProjectName.FreeSqlRepository\CompanyName.ProjectName.FreeSqlRepository.csproj", "{FC30B17B-F671-4E55-90C6-9F37E40B483D}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.ElasticsearchRepository", "services\src\CompanyName.ProjectName.ElasticsearchRepository\CompanyName.ProjectName.ElasticsearchRepository.csproj", "{5910B07F-1520-45D6-A15F-7A3E0698BE18}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -309,10 +305,6 @@ Global
{C018EFF9-579E-43B3-9181-543BE95E2E03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C018EFF9-579E-43B3-9181-543BE95E2E03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C018EFF9-579E-43B3-9181-543BE95E2E03}.Release|Any CPU.Build.0 = Release|Any CPU
- {48D938A1-36E4-4AC1-9AF2-645CB75D4A05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {48D938A1-36E4-4AC1-9AF2-645CB75D4A05}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {48D938A1-36E4-4AC1-9AF2-645CB75D4A05}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {48D938A1-36E4-4AC1-9AF2-645CB75D4A05}.Release|Any CPU.Build.0 = Release|Any CPU
{800F4482-EAC3-472B-AF07-53980D47AA41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{800F4482-EAC3-472B-AF07-53980D47AA41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{800F4482-EAC3-472B-AF07-53980D47AA41}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -329,6 +321,10 @@ Global
{FC30B17B-F671-4E55-90C6-9F37E40B483D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC30B17B-F671-4E55-90C6-9F37E40B483D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC30B17B-F671-4E55-90C6-9F37E40B483D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5910B07F-1520-45D6-A15F-7A3E0698BE18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5910B07F-1520-45D6-A15F-7A3E0698BE18}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5910B07F-1520-45D6-A15F-7A3E0698BE18}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5910B07F-1520-45D6-A15F-7A3E0698BE18}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -388,13 +384,11 @@ Global
{FB1C29FF-5467-4CF0-995D-5B3F931AB135} = {8C1B8C6C-C518-4290-B070-622CCA6004DA}
{A091AE9B-3A1E-49AC-9AD5-D29310512A3D} = {6434E3F2-B352-4B30-839A-88C2BA166D96}
{C018EFF9-579E-43B3-9181-543BE95E2E03} = {6434E3F2-B352-4B30-839A-88C2BA166D96}
- {3F507591-5C8A-49A7-AB0A-043B64B7EC41} = {CC2EBB07-A070-4158-AB37-A0C0BBAEA9F5}
- {1A57338B-65B1-4B8F-ABBD-83F4E8321D8F} = {3F507591-5C8A-49A7-AB0A-043B64B7EC41}
- {48D938A1-36E4-4AC1-9AF2-645CB75D4A05} = {1A57338B-65B1-4B8F-ABBD-83F4E8321D8F}
{800F4482-EAC3-472B-AF07-53980D47AA41} = {11ED8435-B5AE-4BF3-9D4B-51FA1E4A18A6}
{6848FA46-EFFF-4E0C-8EAA-145D8C440333} = {C4AC9352-C9F5-4096-8D73-13638232CFB9}
{D9108313-8D05-4F5F-9AA0-B443EC3374B6} = {5C304CBC-F30D-413C-A0AF-8B6814A2D4A3}
{FC30B17B-F671-4E55-90C6-9F37E40B483D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
+ {5910B07F-1520-45D6-A15F-7A3E0698BE18} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
diff --git a/aspnet-core/Directory.Build.props b/aspnet-core/Directory.Build.props
index 35930d61..5ae284c3 100644
--- a/aspnet-core/Directory.Build.props
+++ b/aspnet-core/Directory.Build.props
@@ -3,6 +3,28 @@
4.4.0
5.1.4
+ 5.1.4
+ 5.0.12
+ 1.5.0
+ 2.10.0
+ 3.0.1
+ 1.4.0
+ 5.0.0
+ 3.1.1
+ 4.1.0
+ 7.0.0
+ 3.1.0
+ 8.4.1
+ 7.14.1
+ 2.0.3
+ 6.1.4
+ 16.9.1
+ 4.2.2
+ 4.0.3
+ 2.4.1
+ 2.4.3
+ 17.0.0
+ 6.2.3
\ No newline at end of file
diff --git a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/Lion.Abp.ElasticSearch.csproj b/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/Lion.Abp.ElasticSearch.csproj
deleted file mode 100644
index fc45aead..00000000
--- a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/Lion.Abp.ElasticSearch.csproj
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- net5.0
-
-
-
-
-
-
diff --git a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/LionAbpElasticSearchModule.cs b/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/LionAbpElasticSearchModule.cs
deleted file mode 100644
index 76d7aee4..00000000
--- a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/LionAbpElasticSearchModule.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-using Volo.Abp.Modularity;
-
-namespace Lion.Abp.ElasticSearch
-{
- public class LionAbpElasticSearchModule : AbpModule
- {
- }
-}
\ No newline at end of file
diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/INotificationAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/INotificationAppService.cs
index 91bf6982..f9ba4182 100644
--- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/INotificationAppService.cs
+++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/INotificationAppService.cs
@@ -1,6 +1,8 @@
using System.Collections.Generic;
+using System.Threading;
using System.Threading.Tasks;
using CompanyName.ProjectName.NotificationManagement.Notifications.Dtos;
+using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace CompanyName.ProjectName.NotificationManagement.Notifications
@@ -27,5 +29,21 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications
///
///
Task CreateAsync(CreateNotificationInput input);
+
+ ///
+ /// 分页获取用户普通文本消息
+ ///
+ ///
+ ///
+ Task> GetPageTextNotificationByUserIdAsync(
+ PagingNotificationListInput listInput);
+
+ ///
+ /// 分页获取广播消息
+ ///
+ ///
+ ///
+ Task> GetPageBroadCastNotificationByUserIdAsync(
+ PagingNotificationListInput listInput);
}
}
\ No newline at end of file
diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/IQueryNotificationAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/IQueryNotificationAppService.cs
deleted file mode 100644
index 9a54599c..00000000
--- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/IQueryNotificationAppService.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System.Threading;
-using System.Threading.Tasks;
-using CompanyName.ProjectName.NotificationManagement.Notifications.Dtos;
-using Volo.Abp.Application.Services;
-using Volo.Abp.Application.Dtos;
-
-namespace CompanyName.ProjectName.NotificationManagement.Notifications
-{
- public interface IQueryNotificationAppService : IApplicationService
- {
- ///
- /// 分页获取用户普通文本消息
- ///
- ///
- ///
- ///
- Task> GetPageTextNotificationByUserIdAsync(
- PagingNotificationListInput listInput,
- CancellationToken cancellationToken = default);
-
- ///
- /// 分页获取广播消息
- ///
- ///
- ///
- ///
- Task> GetPageBroadCastNotificationByUserIdAsync(
- PagingNotificationListInput listInput,
- CancellationToken cancellationToken = default);
- }
-}
\ No newline at end of file
diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/NotificationCreatedDistributedEventHandler.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/NotificationCreatedDistributedEventHandler.cs
index acd0c069..2726c5b2 100644
--- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/NotificationCreatedDistributedEventHandler.cs
+++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/NotificationCreatedDistributedEventHandler.cs
@@ -9,8 +9,8 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications.Distribut
///
/// 创建消息事件处理
///
- public class
- NotificationCreatedDistributedEventHandler : IDistributedEventHandler,
+ public class NotificationCreatedDistributedEventHandler :
+ IDistributedEventHandler,
ITransientDependency
{
private readonly INotificationAppService _hubAppService;
diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/NotificationAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/NotificationAppService.cs
index e6a86d47..255ff969 100644
--- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/NotificationAppService.cs
+++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/NotificationAppService.cs
@@ -5,6 +5,7 @@ using CompanyName.ProjectName.NotificationManagement.Hubs;
using CompanyName.ProjectName.NotificationManagement.Notifications.Dtos;
using Microsoft.AspNetCore.SignalR;
using Volo.Abp;
+using Volo.Abp.Application.Dtos;
using Volo.Abp.Users;
namespace CompanyName.ProjectName.NotificationManagement.Notifications
@@ -14,14 +15,17 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications
private readonly IHubContext _hubContext;
private readonly NotificationManager _notificationManager;
private readonly ICurrentUser _currentUser;
-
+ private readonly IDapperNotificationRepository _dapperNotificationRepository;
public NotificationAppService(
- IHubContext hubContext, NotificationManager notificationManager,
- ICurrentUser currentUser)
+ IHubContext hubContext,
+ NotificationManager notificationManager,
+ ICurrentUser currentUser,
+ IDapperNotificationRepository dapperNotificationRepository)
{
_hubContext = hubContext;
_notificationManager = notificationManager;
_currentUser = currentUser;
+ _dapperNotificationRepository = dapperNotificationRepository;
}
public Task SetReadAsync(SetReadInput input)
@@ -54,7 +58,48 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications
}
}
+ ///
+ /// 分页获取用户普通文本消息
+ ///
+ ///
+ ///
+ public async Task> GetPageTextNotificationByUserIdAsync(
+ PagingNotificationListInput listInput)
+ {
+ if (!_currentUser.Id.HasValue)
+ {
+ return null;
+ }
+
+ var totalCount =
+ await _dapperNotificationRepository.GetPageTextNotificationCountByUserIdAsync(_currentUser.Id.Value);
+ var list = await _dapperNotificationRepository.GetPageTextNotificationByUserIdAsync(_currentUser.Id.Value,
+ listInput.PageSize,
+ listInput.SkipCount);
+ return new PagedResultDto(totalCount, list);
+ }
+ ///
+ /// 分页获取广播消息
+ ///
+ ///
+ ///
+ public async Task> GetPageBroadCastNotificationByUserIdAsync(
+ PagingNotificationListInput listInput)
+ {
+ if (!_currentUser.Id.HasValue)
+ {
+ return null;
+ }
+
+ var totalCount =
+ await _dapperNotificationRepository.GetPageBroadCastNotificationCountByUserIdAsync(_currentUser.Id.Value);
+ var list = await _dapperNotificationRepository.GetPageBroadCastNotificationByUserIdAsync(_currentUser.Id.Value,
+ listInput.PageSize,
+ listInput.SkipCount);
+ return new PagedResultDto(totalCount, list);
+ }
+
///
/// 发送消息指定客户端用户
///
@@ -82,5 +127,6 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications
await _hubContext.Clients.All.ReceiveBroadCastMessageAsync(sendNotificationDto);
}
+
}
}
\ No newline at end of file
diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/QueryNotificationAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/QueryNotificationAppService.cs
deleted file mode 100644
index 1884de55..00000000
--- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/QueryNotificationAppService.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using System.Threading;
-using System.Threading.Tasks;
-using CompanyName.ProjectName.NotificationManagement.Notifications.Dtos;
-using Volo.Abp.Application.Dtos;
-using Volo.Abp.Users;
-
-
-namespace CompanyName.ProjectName.NotificationManagement.Notifications
-{
- public class QueryNotificationAppService : NotificationManagementAppService, IQueryNotificationAppService
- {
- private readonly IDapperNotificationRepository _dapperNotificationRepository;
- private readonly ICurrentUser _currentUser;
-
- public QueryNotificationAppService(IDapperNotificationRepository dapperNotificationRepository, ICurrentUser currentUser)
- {
- _dapperNotificationRepository = dapperNotificationRepository;
- _currentUser = currentUser;
- }
-
- ///
- /// 分页获取用户普通文本消息
- ///
- ///
- ///
- ///
- public async Task> GetPageTextNotificationByUserIdAsync(
- PagingNotificationListInput listInput,
- CancellationToken cancellationToken = default)
- {
- if (!_currentUser.Id.HasValue)
- {
- return null;
- }
-
- var totalCount =
- await _dapperNotificationRepository.GetPageTextNotificationCountByUserIdAsync(_currentUser.Id.Value, cancellationToken);
- var list = await _dapperNotificationRepository.GetPageTextNotificationByUserIdAsync(_currentUser.Id.Value,
- listInput.PageSize,
- listInput.SkipCount, cancellationToken);
- return new PagedResultDto(totalCount, list);
- }
-
- ///
- /// 分页获取广播消息
- ///
- ///
- ///
- ///
- public async Task> GetPageBroadCastNotificationByUserIdAsync(
- PagingNotificationListInput listInput,
- CancellationToken cancellationToken = default)
- {
- if (!_currentUser.Id.HasValue)
- {
- return null;
- }
-
- var totalCount =
- await _dapperNotificationRepository.GetPageBroadCastNotificationCountByUserIdAsync(_currentUser.Id.Value,
- cancellationToken);
- var list = await _dapperNotificationRepository.GetPageBroadCastNotificationByUserIdAsync(_currentUser.Id.Value,
- listInput.PageSize,
- listInput.SkipCount, cancellationToken);
- return new PagedResultDto(totalCount, list);
- }
- }
-}
\ No newline at end of file
diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/Notifications/NotificationController.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/Notifications/NotificationController.cs
index 9f9b5e9e..fcea88eb 100644
--- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/Notifications/NotificationController.cs
+++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/Notifications/NotificationController.cs
@@ -11,13 +11,12 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications
[Route("Notification")]
public class NotificationController : AbpController, IApplicationService
{
- private readonly IQueryNotificationAppService _queryNotificationAppService;
+
private readonly INotificationAppService _notificationAppService;
- public NotificationController(IQueryNotificationAppService queryNotificationAppService,
+ public NotificationController(
INotificationAppService notificationAppService)
{
- _queryNotificationAppService = queryNotificationAppService;
_notificationAppService = notificationAppService;
}
@@ -32,7 +31,7 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications
public Task> GetPageTextNotificationByUserIdAsync(
PagingNotificationListInput listInput)
{
- return _queryNotificationAppService.GetPageTextNotificationByUserIdAsync(listInput);
+ return _notificationAppService.GetPageTextNotificationByUserIdAsync(listInput);
}
///
@@ -45,7 +44,7 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications
public Task> GetPageBroadCastNotificationByUserIdAsync(
PagingNotificationListInput listInput)
{
- return _queryNotificationAppService.GetPageBroadCastNotificationByUserIdAsync(listInput);
+ return _notificationAppService.GetPageBroadCastNotificationByUserIdAsync(listInput);
}
[HttpPost("Read")]
diff --git a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Extensions/SerilogToEsExtensions.cs b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Extensions/SerilogToEsExtensions.cs
index 999c4161..0bedb99c 100644
--- a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Extensions/SerilogToEsExtensions.cs
+++ b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Extensions/SerilogToEsExtensions.cs
@@ -31,7 +31,7 @@ namespace CompanyName.ProjectName.Extensions
loggerConfiguration.WriteTo.File("logs/logs.txt", rollingInterval: RollingInterval.Day);
}
loggerConfiguration.WriteTo.File("logs/logs.txt", rollingInterval: RollingInterval.Day);
- var writeToElasticSearch = configuration.GetValue("LogToElasticSearch:Enabled", false);
+ var writeToElasticSearch = configuration.GetValue("ElasticSearch:Enabled", false);
// LogToElasticSearch:Enabled = true 才输出至ES
@@ -40,20 +40,20 @@ namespace CompanyName.ProjectName.Extensions
var applicationName = "CompanyName.ProjectName.HttpApi.Host";
- var esUrl = configuration["LogToElasticSearch:ElasticSearch:Url"];
+ var esUrl = configuration["ElasticSearch:Url"];
// 需要设置ES URL
if (string.IsNullOrEmpty(esUrl))
return;
- var indexFormat = configuration["LogToElasticSearch:ElasticSearch:IndexFormat"];
+ var indexFormat = configuration["ElasticSearch:IndexFormat"];
// 需要设置ES URL
if (string.IsNullOrEmpty(indexFormat))
return;
- var esUserName = configuration["LogToElasticSearch:ElasticSearch:UserName"];
- var esPassword = configuration["LogToElasticSearch:ElasticSearch:Password"];
+ var esUserName = configuration["ElasticSearch:UserName"];
+ var esPassword = configuration["ElasticSearch:Password"];
loggerConfiguration.Enrich.FromLogContext().Enrich.WithExceptionDetails().WriteTo
.Elasticsearch(BuildElasticSearchSinkOptions(esUrl, indexFormat, esUserName, esPassword));
diff --git a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Development.json b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Development.json
index 51a34d72..14b754e3 100644
--- a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Development.json
+++ b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Development.json
@@ -38,15 +38,13 @@
"Password": "admin"
}
},
- "LogToElasticSearch": {
+ "ElasticSearch": {
"Enabled": "false",
- "ElasticSearch": {
- "Url": "http://es.cn",
- "IndexFormat": "companyname.projectname.development",
- "UserName": "elastic",
- "Password": "aVVhjQ95RP7nbwNy",
- "DashboardIndex": "companyname.projectname"
- }
+ "Url": "http://es.cn",
+ "IndexFormat": "companyname.projectname.development.{0:yyyy.MM.dd}",
+ "UserName": "elastic",
+ "Password": "aVVhjQ95RP7nbwNy",
+ "SearchIndexFormat": "companyname.projectname.development.*"
},
"HttpClient": {
"Sts": {
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/CompanyName.ProjectName.Application.Contracts.csproj b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/CompanyName.ProjectName.Application.Contracts.csproj
index 82bf0b16..c2504c20 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/CompanyName.ProjectName.Application.Contracts.csproj
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/CompanyName.ProjectName.Application.Contracts.csproj
@@ -10,6 +10,7 @@
+
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/ElasticSearchs/ICompanyNameProjectNameLogAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/ElasticSearchs/ICompanyNameProjectNameLogAppService.cs
new file mode 100644
index 00000000..913fddd4
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/ElasticSearchs/ICompanyNameProjectNameLogAppService.cs
@@ -0,0 +1,17 @@
+using System.Threading.Tasks;
+using CompanyName.ProjectName.ElasticsearchRepository.Dto;
+using Lion.Abp.Extension;
+using Volo.Abp.Application.Services;
+
+namespace CompanyName.ProjectName.ElasticSearchs
+{
+ public interface ICompanyNameProjectNameLogAppService : IApplicationService
+ {
+ ///
+ /// 分页查询es日志
+ ///
+ ///
+ ///
+ Task> PaingAsync(PagingElasticSearchLogInput input);
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Permissions/ProjectNamePermissionDefinitionProvider.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Permissions/ProjectNamePermissionDefinitionProvider.cs
index 65b68d35..e81f69fe 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Permissions/ProjectNamePermissionDefinitionProvider.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Permissions/ProjectNamePermissionDefinitionProvider.cs
@@ -21,6 +21,8 @@ namespace CompanyName.ProjectName.Permissions
abpIdentityGroup.AddPermission(ProjectNamePermissions.SystemManagement.Hangfire, L("Permission:HangfireManagement"));
var capManagement = abpIdentityGroup.AddPermission(ProjectNamePermissions.SystemManagement.Cap, L("Permission:CapManagement"));
+
+ var esManagement = abpIdentityGroup.AddPermission(ProjectNamePermissions.SystemManagement.ES, L("Permission:ESManagement"));
#region IdentityServer
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Roles/IRoleAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Roles/IRoleAppService.cs
index 9014856f..6d2b8f46 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Roles/IRoleAppService.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Roles/IRoleAppService.cs
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using CompanyName.ProjectName.Roles.Dtos;
+using Lion.Abp.Extension;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Identity;
@@ -17,10 +18,7 @@ namespace CompanyName.ProjectName.Roles
Task UpdateAsync(UpdateRoleInput input);
- Task DeleteAsync(Guid id);
+ Task DeleteAsync(IdInput input);
- Task GetPermissionAsync(GetPermissionInput input);
-
- Task UpdatePermissionAsync(UpdateRolePermissionsInput input);
}
}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Roles/IRolePermissionAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Roles/IRolePermissionAppService.cs
new file mode 100644
index 00000000..d9500050
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Roles/IRolePermissionAppService.cs
@@ -0,0 +1,14 @@
+using System.Threading.Tasks;
+using CompanyName.ProjectName.Roles.Dtos;
+using Volo.Abp.Application.Services;
+
+namespace CompanyName.ProjectName.Roles
+{
+ public interface IRolePermissionAppService : IApplicationService
+ {
+
+ Task GetPermissionAsync(GetPermissionInput input);
+
+ Task UpdatePermissionAsync(UpdateRolePermissionsInput input);
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Settings/UpdateSettingInput.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Settings/Dtos/UpdateSettingInput.cs
similarity index 100%
rename from aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Settings/UpdateSettingInput.cs
rename to aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Settings/Dtos/UpdateSettingInput.cs
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Settings/ISettingAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Settings/ISettingAppService.cs
new file mode 100644
index 00000000..8d34ae08
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Settings/ISettingAppService.cs
@@ -0,0 +1,22 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using EasyAbp.Abp.SettingUi.Dto;
+using Volo.Abp.Application.Services;
+
+namespace CompanyName.ProjectName.Settings
+{
+ public interface ISettingAppService : IApplicationService
+ {
+ ///
+ /// 获取setting信息
+ ///
+ ///
+ Task> GetAsync();
+
+ ///
+ /// 更新setting
+ ///
+ ///
+ Task UpdateAsync(UpdateSettingInput input);
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/ILoginAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/IAccountAppService.cs
similarity index 82%
rename from aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/ILoginAppService.cs
rename to aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/IAccountAppService.cs
index 5b715b63..a5844611 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/ILoginAppService.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/IAccountAppService.cs
@@ -7,7 +7,7 @@ using Volo.Abp.Application.Services;
namespace CompanyName.ProjectName.Users
{
- public interface ILoginAppService: IApplicationService
+ public interface IAccountAppService: IApplicationService
{
Task LoginAsync(LoginInput input);
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/IUserAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/IUserAppService.cs
index 2769baa8..a6764867 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/IUserAppService.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application.Contracts/Users/IUserAppService.cs
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using CompanyName.ProjectName.Users.Dtos;
+using Lion.Abp.Extension;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Identity;
@@ -33,16 +34,14 @@ namespace CompanyName.ProjectName.Users
///
/// 删除用户
///
- ///
- Task DeleteAsync(Guid id);
+ Task DeleteAsync(IdInput input);
///
/// 获取用户角色信息
///
- ///
///
- Task> GetRoleByUserId(Guid userId);
+ Task> GetRoleByUserId(IdInput input);
///
/// 修改密码
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application/ElasticSearchs/CompanyNameProjectNameLogAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application/ElasticSearchs/CompanyNameProjectNameLogAppService.cs
new file mode 100644
index 00000000..c1d8a987
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application/ElasticSearchs/CompanyNameProjectNameLogAppService.cs
@@ -0,0 +1,22 @@
+using System.Threading.Tasks;
+using CompanyName.ProjectName.ElasticsearchRepository;
+using CompanyName.ProjectName.ElasticsearchRepository.Dto;
+using Lion.Abp.Extension;
+
+namespace CompanyName.ProjectName.ElasticSearchs
+{
+ public class CompanyNameProjectNameLogAppService:ProjectNameAppService,ICompanyNameProjectNameLogAppService
+ {
+ private readonly ICompanyNameProjectNameLogRepository _companyNameProjectNameLogRepository;
+
+ public CompanyNameProjectNameLogAppService(ICompanyNameProjectNameLogRepository companyNameProjectNameLogRepository)
+ {
+ _companyNameProjectNameLogRepository = companyNameProjectNameLogRepository;
+ }
+
+ public Task> PaingAsync(PagingElasticSearchLogInput input)
+ {
+ return _companyNameProjectNameLogRepository.PaingAsync(input);
+ }
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application/ProjectNameApplicationModule.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application/ProjectNameApplicationModule.cs
index ec546d15..b42e70ee 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Application/ProjectNameApplicationModule.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application/ProjectNameApplicationModule.cs
@@ -1,4 +1,5 @@
using CompanyName.ProjectName.DataDictionaryManagement;
+using CompanyName.ProjectName.ElasticsearchRepository;
using CompanyName.ProjectName.FreeSqlRepository;
using CompanyName.ProjectName.NotificationManagement;
using EasyAbp.Abp.SettingUi;
@@ -27,7 +28,8 @@ namespace CompanyName.ProjectName
typeof(DataDictionaryManagementApplicationModule),
typeof(NotificationManagementApplicationModule),
typeof(AbpSettingUiApplicationModule),
- typeof(FreeSqlRepositoryModule)
+ typeof(FreeSqlRepositoryModule),
+ typeof(ProjectNameElasticSearchModule)
)]
public class ProjectNameApplicationModule : AbpModule
{
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application/Roles/RoleAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application/Roles/RoleAppService.cs
index f4c04410..e25e240b 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Application/Roles/RoleAppService.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application/Roles/RoleAppService.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CompanyName.ProjectName.Roles.Dtos;
+using Lion.Abp.Extension;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Identity;
@@ -13,14 +14,15 @@ namespace CompanyName.ProjectName.Roles
public class RoleAppService : ProjectNameAppService, IRoleAppService
{
private readonly IIdentityRoleAppService _identityRoleAppService;
- private readonly IPermissionAppService _permissionAppService;
+
private readonly IIdentityRoleRepository _roleRepository;
- public RoleAppService(IIdentityRoleAppService identityRoleAppService,
- IPermissionAppService permissionAppService, IIdentityRoleRepository roleRepository)
+ public RoleAppService(
+ IIdentityRoleAppService identityRoleAppService,
+ IIdentityRoleRepository roleRepository)
{
_identityRoleAppService = identityRoleAppService;
- _permissionAppService = permissionAppService;
+
_roleRepository = roleRepository;
}
@@ -31,7 +33,8 @@ namespace CompanyName.ProjectName.Roles
public async Task> AllListAsync()
{
List source =
- await _roleRepository.GetListAsync().ConfigureAwait(continueOnCapturedContext: false);
+ await _roleRepository.GetListAsync()
+ .ConfigureAwait(continueOnCapturedContext: false);
return new ListResultDto(
base.ObjectMapper.Map, List>(source));
}
@@ -45,13 +48,16 @@ namespace CompanyName.ProjectName.Roles
{
var request = new GetIdentityRolesInput
{
- Filter = input.Filter?.Trim(), MaxResultCount = input.PageSize, SkipCount = input.SkipCount
+ Filter = input.Filter?.Trim(), MaxResultCount = input.PageSize,
+ SkipCount = input.SkipCount
};
List list = await _roleRepository
- .GetListAsync(request.Sorting, request.MaxResultCount, request.SkipCount, request.Filter)
+ .GetListAsync(request.Sorting, request.MaxResultCount, request.SkipCount,
+ request.Filter)
.ConfigureAwait(continueOnCapturedContext: false);
return new PagedResultDto(
- await _roleRepository.GetCountAsync(request.Filter).ConfigureAwait(continueOnCapturedContext: false),
+ await _roleRepository.GetCountAsync(request.Filter)
+ .ConfigureAwait(continueOnCapturedContext: false),
base.ObjectMapper.Map, List>(list));
}
@@ -80,131 +86,9 @@ namespace CompanyName.ProjectName.Roles
///
/// 删除角色
///
- ///
- public async Task DeleteAsync(Guid id)
- {
- await _identityRoleAppService.DeleteAsync(id);
- }
-
- ///
- /// 获取所有权限
- ///
- ///
- public async Task GetPermissionAsync(GetPermissionInput input)
+ public async Task DeleteAsync(IdInput input)
{
- var permissions = await _permissionAppService.GetAsync(input.ProviderName, input.ProviderKey);
- return BuildTreeData(permissions.Groups);
- }
-
- ///
- /// 更新权限
- ///
- ///
- public async Task UpdatePermissionAsync(UpdateRolePermissionsInput input)
- {
- await _permissionAppService.UpdateAsync(input.ProviderName, input.ProviderKey, input.UpdatePermissionsDto);
- }
-
- ///
- /// 生成权限树
- ///
- ///
- ///
- private PermissionOutput BuildTreeData(List input)
- {
- var result = new PermissionOutput();
- var excludes = new List
- {
- "AbpIdentity.Users.ManagePermissions",
- "FeatureManagement",
- "FeatureManagement.ManageHostFeatures",
- // "AbpTenantManagement",
- // "AbpTenantManagement.Tenants",
- // "AbpTenantManagement.Tenants.Create",
- // "AbpTenantManagement.Tenants.Update",
- // "AbpTenantManagement.Tenants.Delete",
- "AbpTenantManagement.Tenants.ManageFeatures",
- // "AbpTenantManagement.Tenants.ManageConnectionStrings",
- "SettingManagement",
- "SettingManagement.Emailing",
- "SettingUi"
- };
-
- var permissions = new List();
-
- foreach (var group in input)
- {
- if (excludes.Any(e => e == group.Name))
- {
- continue;
- }
-
- var groupPermission = new PermissionTreeDto {Key = @group.Name, Title = @group.DisplayName};
- groupPermission.Key = group.Name;
- groupPermission.Title =
- group.Name == "AbpIdentity" ? L["Permission:SystemManagement"] : group.DisplayName;
- foreach (var item in group.Permissions)
- {
- result.AllGrants.Add(item.Name);
- if (item.IsGranted)
- {
- result.Grants.Add(item.Name);
- }
-
- //获取ParentName=null的权限
- var management = group.Permissions.Where(e => e.ParentName.IsNullOrWhiteSpace()).ToList();
-
- foreach (var managementItem in management)
- {
- if (groupPermission.Children.Any(e => e.Key == managementItem.Name))
- {
- continue;
- }
-
- {
- var managementPermission = new PermissionTreeDto()
- {
- Key = managementItem.Name,
- Title = managementItem.DisplayName
- };
- // 获取management下权限
- var childrenPermission = @group.Permissions.Where(e => e.ParentName == managementItem.Name)
- .ToList();
- foreach (var childrenPermissionItem in childrenPermission)
- {
- managementPermission.Children.Add(new PermissionTreeDto()
- {
- Key = childrenPermissionItem.Name,
- Title = childrenPermissionItem.DisplayName
- });
- }
-
- groupPermission.Children.Add(managementPermission);
- }
- }
- }
-
- permissions.Add(groupPermission);
- }
-
- result.Permissions = permissions;
-
- var settingUIPermisstion = "SettingUi.ShowSettingPage";
- // https://github.com/EasyAbp/Abp.SettingUi/blob/develop/src/EasyAbp.Abp.SettingUi.Application/SettingUiAppService.cs
- // 因为使用的SettingUI模块,想把权限添加到系统管理下
- result.Permissions.First(e => e.Key == "AbpIdentity").Children.Add(new PermissionTreeDto()
- {
- Key = settingUIPermisstion,
- Title = L["Permission:SettingUi:ShowSettingPage"]
- });
- result.AllGrants.Add(settingUIPermisstion);
-
- var setting = input.First(e => e.Name == "SettingUi").Permissions.First(e => e.Name == settingUIPermisstion);
- if (setting.IsGranted)
- {
- result.Grants.Add(settingUIPermisstion);
- }
- return result;
+ await _identityRoleAppService.DeleteAsync(input.Id);
}
}
}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application/Roles/RolePermissionAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application/Roles/RolePermissionAppService.cs
new file mode 100644
index 00000000..1273b5c8
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application/Roles/RolePermissionAppService.cs
@@ -0,0 +1,149 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using CompanyName.ProjectName.Roles.Dtos;
+using Volo.Abp.PermissionManagement;
+
+namespace CompanyName.ProjectName.Roles
+{
+ public class RolePermissionAppService : ProjectNameAppService, IRolePermissionAppService
+ {
+ private readonly IPermissionAppService _rolePermissionAppService;
+
+ public RolePermissionAppService(IPermissionAppService rolePermissionAppService)
+ {
+ _rolePermissionAppService = rolePermissionAppService;
+ }
+
+ ///
+ /// 获取所有权限
+ ///
+ ///
+ public async Task GetPermissionAsync(GetPermissionInput input)
+ {
+ var permissions =
+ await _rolePermissionAppService.GetAsync(input.ProviderName, input.ProviderKey);
+ return BuildTreeData(permissions.Groups);
+ }
+
+ ///
+ /// 更新权限
+ ///
+ ///
+ public async Task UpdatePermissionAsync(UpdateRolePermissionsInput input)
+ {
+ await _rolePermissionAppService.UpdateAsync(input.ProviderName, input.ProviderKey,
+ input.UpdatePermissionsDto);
+ }
+
+ ///
+ /// 生成权限树
+ ///
+ ///
+ ///
+ private PermissionOutput BuildTreeData(List input)
+ {
+ var result = new PermissionOutput();
+ var excludes = new List
+ {
+ "AbpIdentity.Users.ManagePermissions",
+ "FeatureManagement",
+ "FeatureManagement.ManageHostFeatures",
+ // "AbpTenantManagement",
+ // "AbpTenantManagement.Tenants",
+ // "AbpTenantManagement.Tenants.Create",
+ // "AbpTenantManagement.Tenants.Update",
+ // "AbpTenantManagement.Tenants.Delete",
+ "AbpTenantManagement.Tenants.ManageFeatures",
+ // "AbpTenantManagement.Tenants.ManageConnectionStrings",
+ "SettingManagement",
+ "SettingManagement.Emailing",
+ "SettingUi"
+ };
+
+ var permissions = new List();
+
+ foreach (var group in input)
+ {
+ if (excludes.Any(e => e == group.Name))
+ {
+ continue;
+ }
+
+ var groupPermission = new PermissionTreeDto
+ { Key = @group.Name, Title = @group.DisplayName };
+ groupPermission.Key = group.Name;
+ groupPermission.Title =
+ group.Name == "AbpIdentity"
+ ? L["Permission:SystemManagement"]
+ : group.DisplayName;
+ foreach (var item in group.Permissions)
+ {
+ result.AllGrants.Add(item.Name);
+ if (item.IsGranted)
+ {
+ result.Grants.Add(item.Name);
+ }
+
+ //获取ParentName=null的权限
+ var management = group.Permissions
+ .Where(e => string.IsNullOrWhiteSpace(e.ParentName)).ToList();
+
+ foreach (var managementItem in management)
+ {
+ if (groupPermission.Children.Any(e => e.Key == managementItem.Name))
+ {
+ continue;
+ }
+
+ {
+ var managementPermission = new PermissionTreeDto()
+ {
+ Key = managementItem.Name,
+ Title = managementItem.DisplayName
+ };
+ // 获取management下权限
+ var childrenPermission = @group.Permissions
+ .Where(e => e.ParentName == managementItem.Name)
+ .ToList();
+ foreach (var childrenPermissionItem in childrenPermission)
+ {
+ managementPermission.Children.Add(new PermissionTreeDto()
+ {
+ Key = childrenPermissionItem.Name,
+ Title = childrenPermissionItem.DisplayName
+ });
+ }
+
+ groupPermission.Children.Add(managementPermission);
+ }
+ }
+ }
+
+ permissions.Add(groupPermission);
+ }
+
+ result.Permissions = permissions;
+
+ var settingUIPermisstion = "SettingUi.ShowSettingPage";
+ // https://github.com/EasyAbp/Abp.SettingUi/blob/develop/src/EasyAbp.Abp.SettingUi.Application/SettingUiAppService.cs
+ // 因为使用的SettingUI模块,想把权限添加到系统管理下
+ result.Permissions.First(e => e.Key == "AbpIdentity").Children.Add(
+ new PermissionTreeDto()
+ {
+ Key = settingUIPermisstion,
+ Title = L["Permission:SettingUi:ShowSettingPage"]
+ });
+ result.AllGrants.Add(settingUIPermisstion);
+
+ var setting = input.First(e => e.Name == "SettingUi").Permissions
+ .First(e => e.Name == settingUIPermisstion);
+ if (setting.IsGranted)
+ {
+ result.Grants.Add(settingUIPermisstion);
+ }
+
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application/Settings/SettingAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application/Settings/SettingAppService.cs
new file mode 100644
index 00000000..d8bdbfc5
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application/Settings/SettingAppService.cs
@@ -0,0 +1,28 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using EasyAbp.Abp.SettingUi;
+using EasyAbp.Abp.SettingUi.Dto;
+
+namespace CompanyName.ProjectName.Settings
+{
+ public class SettingAppService : ProjectNameAppService, ISettingAppService
+ {
+ private readonly ISettingUiAppService _settingUiAppService;
+
+ public SettingAppService(ISettingUiAppService settingUiAppService)
+ {
+ _settingUiAppService = settingUiAppService;
+ }
+
+
+ public async Task> GetAsync()
+ {
+ return await _settingUiAppService.GroupSettingDefinitions();
+ }
+
+ public async Task UpdateAsync(UpdateSettingInput input)
+ {
+ await _settingUiAppService.SetSettingValues(input.Values);
+ }
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application/Users/LoginAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application/Users/AccountAppService.cs
similarity index 97%
rename from aspnet-core/services/src/CompanyName.ProjectName.Application/Users/LoginAppService.cs
rename to aspnet-core/services/src/CompanyName.ProjectName.Application/Users/AccountAppService.cs
index e7652ef6..50e276d7 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Application/Users/LoginAppService.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application/Users/AccountAppService.cs
@@ -19,7 +19,7 @@ using Volo.Abp.Security.Claims;
namespace CompanyName.ProjectName.Users
{
- public class LoginAppService : ProjectNameAppService, ILoginAppService
+ public class AccountAppService : ProjectNameAppService, IAccountAppService
{
private readonly IdentityUserManager _userManager;
private readonly JwtOptions _jwtOptions;
@@ -29,7 +29,7 @@ namespace CompanyName.ProjectName.Users
private readonly IHttpContextAccessor _contextAccessor;
- public LoginAppService(
+ public AccountAppService(
IdentityUserManager userManager,
IOptionsSnapshot jwtOptions,
Microsoft.AspNetCore.Identity.SignInManager signInManager,
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application/Users/UserAppService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application/Users/UserAppService.cs
index 040d23af..a1fdf072 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Application/Users/UserAppService.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Application/Users/UserAppService.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CompanyName.ProjectName.Users.Dtos;
+using Lion.Abp.Extension;
using Microsoft.AspNetCore.Identity;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
@@ -76,20 +77,18 @@ namespace CompanyName.ProjectName.Users
///
/// 删除用户
///
- ///
- public virtual async Task DeleteAsync(Guid id)
+ public virtual async Task DeleteAsync(IdInput input)
{
- await _identityUserAppService.DeleteAsync(id);
+ await _identityUserAppService.DeleteAsync(input.Id);
}
///
/// 获取用户角色信息
///
- ///
///
- public async Task> GetRoleByUserId(Guid userId)
+ public async Task> GetRoleByUserId(IdInput input)
{
- return await _identityUserAppService.GetRolesAsync(userId);
+ return await _identityUserAppService.GetRolesAsync(input.Id);
}
///
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Domain.Shared/Localization/ProjectName/en.json b/aspnet-core/services/src/CompanyName.ProjectName.Domain.Shared/Localization/ProjectName/en.json
index 94ca13bd..be0f0bd0 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Domain.Shared/Localization/ProjectName/en.json
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Domain.Shared/Localization/ProjectName/en.json
@@ -14,6 +14,7 @@
"Permission:AuditLogManagement": "AuditLog",
"Permission:HangfireManagement": "BackgroundTask",
"Permission:CapManagement": "IntegratedEvent",
+ "Permission:ESManagement": "ESManagement",
"Permission:IdentityServerManagement": "IdentityServer",
"Permission:IdentityServerManagement:Client": "Client",
"Permission:IdentityServerManagement:ApiResource": "ApiResource",
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Domain.Shared/Localization/ProjectName/zh-Hans.json b/aspnet-core/services/src/CompanyName.ProjectName.Domain.Shared/Localization/ProjectName/zh-Hans.json
index 2e4d975d..e1a4a8cc 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.Domain.Shared/Localization/ProjectName/zh-Hans.json
+++ b/aspnet-core/services/src/CompanyName.ProjectName.Domain.Shared/Localization/ProjectName/zh-Hans.json
@@ -14,6 +14,7 @@
"Permission:SystemManagement": "系统管理",
"Permission:HangfireManagement": "后台任务",
"Permission:CapManagement": "集成事件",
+ "Permission:ESManagement": "ES日志",
"Permission:IdentityServerManagement": "IdentityServer",
"Permission:IdentityServerManagement:Client": "客户端",
"Permission:IdentityServerManagement:ApiResource": "Api资源",
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/CompanyName.ProjectName.ElasticsearchRepository.csproj b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/CompanyName.ProjectName.ElasticsearchRepository.csproj
new file mode 100644
index 00000000..a9ed148d
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/CompanyName.ProjectName.ElasticsearchRepository.csproj
@@ -0,0 +1,16 @@
+
+
+
+ net5.0
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/CompanyNameProjectNameLogRepository.cs b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/CompanyNameProjectNameLogRepository.cs
new file mode 100644
index 00000000..28da2819
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/CompanyNameProjectNameLogRepository.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using CompanyName.ProjectName.ElasticsearchRepository.Dto;
+using Lion.Abp.Extension;
+using Microsoft.Extensions.Configuration;
+using Nest;
+
+namespace CompanyName.ProjectName.ElasticsearchRepository
+{
+ public class CompanyNameProjectNameLogRepository : ElasticsearchBasicRepository,
+ ICompanyNameProjectNameLogRepository
+ {
+ private readonly IConfiguration _configuration;
+
+ public CompanyNameProjectNameLogRepository(
+ IElasticsearchProvider elasticsearchProvider,
+ IConfiguration configuration) : base(elasticsearchProvider)
+ {
+ _configuration = configuration;
+ }
+
+ public async Task> PaingAsync(
+ PagingElasticSearchLogInput input)
+ {
+ var IndexName =
+ _configuration.GetValue("ElasticSearch:SearchIndexFormat");
+ // 默认查询当天
+ input.StartCreationTime = input.StartCreationTime?.AddMilliseconds(-1) ??
+ DateTime.Now.Date.AddMilliseconds(-1);
+ input.EndCreationTime =
+ input.EndCreationTime?.AddDays(1).AddMilliseconds(-1) ??
+ DateTime.Now.Date.AddDays(1).AddMilliseconds(-1);
+ var mustFilters =
+ new List,
+ QueryContainer>>
+ {
+ t => t.DateRange(f =>
+ f.Field(fd => fd.CreationTime).TimeZone("Asia/Shanghai")
+ .GreaterThanOrEquals(input.StartCreationTime.Value)),
+ t => t.DateRange(
+ f => f.Field(fd => fd.CreationTime).TimeZone("Asia/Shanghai")
+ .LessThanOrEquals(input.EndCreationTime.Value))
+ };
+
+ if (!string.IsNullOrWhiteSpace(input.Filter))
+ {
+ mustFilters.Add(t =>
+ t.MatchPhrase(f => f.Field(fd => fd.Message).Query(input.Filter.Trim())));
+ }
+
+ var result = await Client.SearchAsync(e => e
+ .Index(IndexName)
+ .From(input.SkipCount)
+ .Size(input.PageSize)
+ .Sort(s => s.Descending(sd => sd.CreationTime))
+ .Query(q => q.Bool(qb => qb.Filter(mustFilters))));
+
+ if (result.HitsMetadata != null)
+ {
+ return new CustomePagedResultDto(
+ result.HitsMetadata.Total.Value, result.Documents.ToList());
+ }
+
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/Dto/PagingElasticSearchLogInput.cs b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/Dto/PagingElasticSearchLogInput.cs
new file mode 100644
index 00000000..df512db8
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/Dto/PagingElasticSearchLogInput.cs
@@ -0,0 +1,14 @@
+using System;
+using Lion.Abp.Extension;
+
+namespace CompanyName.ProjectName.ElasticsearchRepository.Dto
+{
+ public class PagingElasticSearchLogInput : PagingBase
+ {
+ public string Filter { get; set; }
+
+ public DateTime? StartCreationTime { get; set; }
+
+ public DateTime? EndCreationTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/Dto/PagingElasticSearchLogOutput.cs b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/Dto/PagingElasticSearchLogOutput.cs
new file mode 100644
index 00000000..e4a4f122
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/Dto/PagingElasticSearchLogOutput.cs
@@ -0,0 +1,27 @@
+using System;
+using Nest;
+
+namespace CompanyName.ProjectName.ElasticsearchRepository.Dto
+{
+ [Serializable]
+ public class PagingElasticSearchLogOutput
+ {
+ ///
+ /// 日志级别
+ ///
+ public string Level { get; set; }
+
+
+ ///
+ /// 日志内容
+ ///
+ public string Message { get; set; }
+
+
+ ///
+ /// 创建时间
+ ///
+ [PropertyName("@timestamp")]
+ public DateTime CreationTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/ElasticsearchBasicRepository.cs b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ElasticsearchBasicRepository.cs
similarity index 89%
rename from aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/ElasticsearchBasicRepository.cs
rename to aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ElasticsearchBasicRepository.cs
index 0f62da8f..61bb1313 100644
--- a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/ElasticsearchBasicRepository.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ElasticsearchBasicRepository.cs
@@ -1,7 +1,7 @@
using Nest;
using Volo.Abp.Domain.Services;
-namespace Lion.Abp.ElasticSearch
+namespace CompanyName.ProjectName.ElasticsearchRepository
{
public abstract class ElasticsearchBasicRepository : DomainService
{
diff --git a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/ElasticsearchProvider.cs b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ElasticsearchProvider.cs
similarity index 94%
rename from aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/ElasticsearchProvider.cs
rename to aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ElasticsearchProvider.cs
index b28fa7c3..5f77a46f 100644
--- a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/ElasticsearchProvider.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ElasticsearchProvider.cs
@@ -4,7 +4,7 @@ using Microsoft.Extensions.Configuration;
using Nest;
using Volo.Abp.DependencyInjection;
-namespace Lion.Abp.ElasticSearch
+namespace CompanyName.ProjectName.ElasticsearchRepository
{
public class ElasticsearchProvider : IElasticsearchProvider, ISingletonDependency
{
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ICompanyNameProjectNameLogRepository.cs b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ICompanyNameProjectNameLogRepository.cs
new file mode 100644
index 00000000..c8e8d2f1
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ICompanyNameProjectNameLogRepository.cs
@@ -0,0 +1,17 @@
+using System.Threading.Tasks;
+using CompanyName.ProjectName.ElasticsearchRepository.Dto;
+using Lion.Abp.Extension;
+using Volo.Abp.DependencyInjection;
+
+namespace CompanyName.ProjectName.ElasticsearchRepository
+{
+ public interface ICompanyNameProjectNameLogRepository : ITransientDependency
+ {
+ ///
+ /// 分页查询es日志
+ ///
+ ///
+ ///
+ Task> PaingAsync(PagingElasticSearchLogInput input);
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/IElasticsearchProvider.cs b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/IElasticsearchProvider.cs
similarity index 74%
rename from aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/IElasticsearchProvider.cs
rename to aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/IElasticsearchProvider.cs
index 52bcb74b..292f3fd0 100644
--- a/aspnet-core/frameworks/ElasticSearch/src/Lion.Abp.ElasticSearch/IElasticsearchProvider.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/IElasticsearchProvider.cs
@@ -1,7 +1,7 @@
using Nest;
using Volo.Abp.DependencyInjection;
-namespace Lion.Abp.ElasticSearch
+namespace CompanyName.ProjectName.ElasticsearchRepository
{
public interface IElasticsearchProvider : ISingletonDependency
{
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ProjectNameElasticSearchModule.cs b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ProjectNameElasticSearchModule.cs
new file mode 100644
index 00000000..f7796252
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.ElasticsearchRepository/ProjectNameElasticSearchModule.cs
@@ -0,0 +1,10 @@
+using Volo.Abp.Modularity;
+
+namespace CompanyName.ProjectName.ElasticsearchRepository
+{
+
+ public class ProjectNameElasticSearchModule : AbpModule
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AccountController.cs b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AccountController.cs
index be7f12e0..f2b9f324 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AccountController.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AccountController.cs
@@ -6,27 +6,27 @@ using Swashbuckle.AspNetCore.Annotations;
namespace CompanyName.ProjectName.Controllers.Systems
{
- public class AccountController : ProjectNameController,ILoginAppService
+ public class AccountController : ProjectNameController,IAccountAppService
{
- private readonly ILoginAppService _loginAppService;
+ private readonly IAccountAppService _accountAppService;
- public AccountController(ILoginAppService loginAppService)
+ public AccountController(IAccountAppService accountAppService)
{
- _loginAppService = loginAppService;
+ _accountAppService = accountAppService;
}
[SwaggerOperation(summary: "登录", Tags = new[] {"Account"})]
public Task LoginAsync(LoginInput input)
{
- return _loginAppService.LoginAsync(input);
+ return _accountAppService.LoginAsync(input);
}
[SwaggerOperation(summary: "登录", Tags = new[] {"Account"})]
[HttpPost("/api/app/account/login/Sts")]
public Task StsLoginAsync(string accessToken)
{
- return _loginAppService.StsLoginAsync(accessToken);
+ return _accountAppService.StsLoginAsync(accessToken);
}
}
}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/CompanyNameProjectNameLogController.cs b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/CompanyNameProjectNameLogController.cs
new file mode 100644
index 00000000..e4f8ee39
--- /dev/null
+++ b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/CompanyNameProjectNameLogController.cs
@@ -0,0 +1,30 @@
+using System.Threading.Tasks;
+using CompanyName.ProjectName.ElasticsearchRepository.Dto;
+using CompanyName.ProjectName.ElasticSearchs;
+using CompanyName.ProjectName.Permissions;
+using Lion.Abp.Extension;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Swashbuckle.AspNetCore.Annotations;
+
+namespace CompanyName.ProjectName.Controllers.Systems
+{
+ [Route("EsLog")]
+ public class CompanyNameProjectNameLogController: ProjectNameController,ICompanyNameProjectNameLogAppService
+ {
+ private readonly ICompanyNameProjectNameLogAppService _companyNameProjectNameLogAppService;
+
+ public CompanyNameProjectNameLogController(ICompanyNameProjectNameLogAppService companyNameProjectNameLogAppService)
+ {
+ _companyNameProjectNameLogAppService = companyNameProjectNameLogAppService;
+ }
+
+ [HttpPost("page")]
+ [SwaggerOperation(summary: "分页获取Es日志", Tags = new[] { "EsLog" })]
+ [Authorize(Policy = ProjectNamePermissions.SystemManagement.ES)]
+ public Task> PaingAsync(PagingElasticSearchLogInput input)
+ {
+ return _companyNameProjectNameLogAppService.PaingAsync(input);
+ }
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/PermissionController.cs b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/PermissionController.cs
index e910a7ed..7c1a7bce 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/PermissionController.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/PermissionController.cs
@@ -10,20 +10,21 @@ namespace CompanyName.ProjectName.Controllers.Systems
{
[Route("Permissions")]
[Authorize]
- public class PermissionController : ProjectNameController
+ public class PermissionController : ProjectNameController,IRolePermissionAppService
{
- private readonly IRoleAppService _roleAppService;
+ private readonly IRolePermissionAppService _rolePermissionAppService;
- public PermissionController(IRoleAppService roleAppService)
+ public PermissionController(IRolePermissionAppService rolePermissionAppService)
{
- _roleAppService = roleAppService;
+ _rolePermissionAppService = rolePermissionAppService;
}
-
+
+
[HttpPost("tree")]
[SwaggerOperation(summary: "获取角色权限", Tags = new[] { "Permissions" })]
public Task GetPermissionAsync(GetPermissionInput input)
{
- return _roleAppService.GetPermissionAsync(input);
+ return _rolePermissionAppService.GetPermissionAsync(input);
}
[HttpPost("update")]
@@ -31,7 +32,7 @@ namespace CompanyName.ProjectName.Controllers.Systems
[SwaggerOperation(summary: "更新角色", Tags = new[] { "Permissions" })]
public Task UpdatePermissionAsync(UpdateRolePermissionsInput input)
{
- return _roleAppService.UpdatePermissionAsync(input);
+ return _rolePermissionAppService.UpdatePermissionAsync(input);
}
}
}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/RoleController.cs b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/RoleController.cs
index 3bf30d95..415f8374 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/RoleController.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/RoleController.cs
@@ -1,4 +1,5 @@
-using System.Threading.Tasks;
+using System;
+using System.Threading.Tasks;
using CompanyName.ProjectName.Roles;
using CompanyName.ProjectName.Roles.Dtos;
using Lion.Abp.Extension;
@@ -12,7 +13,7 @@ namespace CompanyName.ProjectName.Controllers.Systems
{
[Route("Roles")]
[Authorize(Policy = IdentityPermissions.Roles.Default)]
- public class RoleController : ProjectNameController
+ public class RoleController : ProjectNameController,IRoleAppService
{
private readonly IRoleAppService _roleAppService;
@@ -51,12 +52,13 @@ namespace CompanyName.ProjectName.Controllers.Systems
return _roleAppService.UpdateAsync(input);
}
+
[HttpPost("delete")]
[Authorize(IdentityPermissions.Roles.Delete)]
[SwaggerOperation(summary: "删除角色", Tags = new[] { "Roles" })]
public Task DeleteAsync(IdInput input)
{
- return _roleAppService.DeleteAsync(input.Id);
+ return _roleAppService.DeleteAsync(input);
}
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/SettingController.cs b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/SettingController.cs
index 10932d0b..64c6a414 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/SettingController.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/SettingController.cs
@@ -9,27 +9,27 @@ using Swashbuckle.AspNetCore.Annotations;
namespace CompanyName.ProjectName.Controllers.Systems
{
[Route("Settings")]
- public class SettingController : ProjectNameController
+ public class SettingController : ProjectNameController,ISettingAppService
{
- private readonly ISettingUiAppService _settingUiAppService;
+ private readonly ISettingAppService _settingAppService;
- public SettingController(ISettingUiAppService settingUiAppService)
+ public SettingController(ISettingAppService settingAppService)
{
- _settingUiAppService = settingUiAppService;
+ _settingAppService = settingAppService;
}
[HttpPost("all")]
- [SwaggerOperation(summary: "获取所有Setting", Tags = new[] {"Settings"})]
+ [SwaggerOperation(summary: "获取所有Setting", Tags = new[] { "Settings" })]
public async Task> GetAsync()
{
- return await _settingUiAppService.GroupSettingDefinitions();
+ return await _settingAppService.GetAsync();
}
[HttpPost("update")]
- [SwaggerOperation(summary: "更新Setting", Tags = new[] {"Settings"})]
+ [SwaggerOperation(summary: "更新Setting", Tags = new[] { "Settings" })]
public async Task UpdateAsync(UpdateSettingInput input)
{
- await _settingUiAppService.SetSettingValues(input.Values);
+ await _settingAppService.UpdateAsync(input);
}
}
}
\ No newline at end of file
diff --git a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/UserController.cs b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/UserController.cs
index a1ba04ee..136292ed 100644
--- a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/UserController.cs
+++ b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/UserController.cs
@@ -1,4 +1,5 @@
-using System.Threading.Tasks;
+using System;
+using System.Threading.Tasks;
using CompanyName.ProjectName.Permissions;
using CompanyName.ProjectName.Users;
using CompanyName.ProjectName.Users.Dtos;
@@ -13,7 +14,7 @@ namespace CompanyName.ProjectName.Controllers.Systems
{
[Route("Users")]
[Authorize(Policy = IdentityPermissions.Users.Default)]
- public class UserContoller:ProjectNameController
+ public class UserContoller:ProjectNameController,IUserAppService
{
private readonly IUserAppService _userAppService;
@@ -50,14 +51,15 @@ namespace CompanyName.ProjectName.Controllers.Systems
[SwaggerOperation(summary: "删除用户", Tags = new[] { "Users" })]
public Task DeleteAsync(IdInput input)
{
- return _userAppService.DeleteAsync(input.Id);
+ return _userAppService.DeleteAsync(input);
}
+
[HttpPost("role")]
[SwaggerOperation(summary: "获取用户角色信息", Tags = new[] { "Users" })]
public Task> GetRoleByUserId(IdInput input)
{
- return _userAppService.GetRoleByUserId(input.Id);
+ return _userAppService.GetRoleByUserId(input);
}
[HttpPost("changePassword")]
diff --git a/vben271/nswag/nswag.json b/vben271/nswag/nswag.json
index 3c9ba9da..ad3f1fde 100644
--- a/vben271/nswag/nswag.json
+++ b/vben271/nswag/nswag.json
@@ -3,7 +3,7 @@
"defaultVariables": null,
"documentGenerator": {
"fromDocument": {
- "url": "http://localhost:44315/swagger/v1/swagger.json",
+ "url": "http://localhost:44315/swagger/ProjectName/swagger.json",
"output": null,
"newLineBehavior": "Auto"
}
diff --git a/vben271/src/router/routes/modules/admin.ts b/vben271/src/router/routes/modules/admin.ts
index fd26fd72..e742050a 100644
--- a/vben271/src/router/routes/modules/admin.ts
+++ b/vben271/src/router/routes/modules/admin.ts
@@ -1,10 +1,6 @@
import type { AppRouteModule } from '/@/router/types';
import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';
-const IFrame = () => import('/@/views/sys/iframe/FrameBlank.vue');
-import { useUserStoreWithOut } from '/@/store/modules/user';
-const userStore = useUserStoreWithOut();
-const token = userStore.getToken;
const admin: AppRouteModule = {
path: '/admin',
@@ -66,29 +62,7 @@ const admin: AppRouteModule = {
policy: 'System.ES',
icon: 'ant-design:snippets-twotone',
},
- },
- {
- path: 'hangfire',
- name: 'Hangfire',
- component: IFrame,
- meta: {
- frameSrc: import.meta.env.VITE_API_URL + '/hangfire?access_token=' + token,
- title: t('routes.admin.backgroundTask'),
- policy: 'System.Hangfire',
- icon: 'ant-design:clock-circle-outlined',
- },
- },
- {
- path: 'cap',
- name: 'Cap',
- component: IFrame,
- meta: {
- frameSrc: import.meta.env.VITE_API_URL + '/cap?access_token=' + token,
- title: t('routes.admin.integratedEvent'),
- policy: 'System.Cap',
- icon: 'ant-design:sync-outlined',
- },
- },
+ }
],
};
diff --git a/vben271/src/services/ServiceProxies.ts b/vben271/src/services/ServiceProxies.ts
index e88088bc..d08b91f0 100644
--- a/vben271/src/services/ServiceProxies.ts
+++ b/vben271/src/services/ServiceProxies.ts
@@ -3315,6 +3315,112 @@ export class ClientServiceProxy extends ServiceProxyBase {
}
}
+export class EsLogServiceProxy extends ServiceProxyBase {
+ private instance: AxiosInstance;
+ private baseUrl: string;
+ protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;
+
+ constructor(baseUrl?: string, instance?: AxiosInstance) {
+ super();
+ this.instance = instance ? instance : axios.create();
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "";
+ }
+
+ /**
+ * 分页获取Es日志
+ * @param body (optional)
+ * @return Success
+ */
+ page(body: PagingElasticSearchLogInput | undefined , cancelToken?: CancelToken | undefined): Promise {
+ let url_ = this.baseUrl + "/EsLog/page";
+ url_ = url_.replace(/[?&]$/, "");
+
+ const content_ = JSON.stringify(body);
+
+ let options_ = {
+ data: content_,
+ method: "POST",
+ url: url_,
+ headers: {
+ "Content-Type": "application/json",
+ "Accept": "text/plain"
+ },
+ cancelToken
+ };
+
+ return this.transformOptions(options_).then(transformedOptions_ => {
+ return this.instance.request(transformedOptions_);
+ }).catch((_error: any) => {
+ if (isAxiosError(_error) && _error.response) {
+ return _error.response;
+ } else {
+ throw _error;
+ }
+ }).then((_response: AxiosResponse) => {
+ return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response));
+ });
+ }
+
+ protected processPage(response: AxiosResponse): Promise {
+ const status = response.status;
+ let _headers: any = {};
+ if (response.headers && typeof response.headers === "object") {
+ for (let k in response.headers) {
+ if (response.headers.hasOwnProperty(k)) {
+ _headers[k] = response.headers[k];
+ }
+ }
+ }
+ if (status === 200) {
+ const _responseText = response.data;
+ let result200: any = null;
+ let resultData200 = _responseText;
+ result200 = PagingElasticSearchLogOutputCustomePagedResultDto.fromJS(resultData200);
+ return result200;
+ } else if (status === 403) {
+ const _responseText = response.data;
+ let result403: any = null;
+ let resultData403 = _responseText;
+ result403 = RemoteServiceErrorResponse.fromJS(resultData403);
+ return throwException("Forbidden", status, _responseText, _headers, result403);
+ } else if (status === 401) {
+ const _responseText = response.data;
+ let result401: any = null;
+ let resultData401 = _responseText;
+ result401 = RemoteServiceErrorResponse.fromJS(resultData401);
+ return throwException("Unauthorized", status, _responseText, _headers, result401);
+ } else if (status === 400) {
+ const _responseText = response.data;
+ let result400: any = null;
+ let resultData400 = _responseText;
+ result400 = RemoteServiceErrorResponse.fromJS(resultData400);
+ return throwException("Bad Request", status, _responseText, _headers, result400);
+ } else if (status === 404) {
+ const _responseText = response.data;
+ let result404: any = null;
+ let resultData404 = _responseText;
+ result404 = RemoteServiceErrorResponse.fromJS(resultData404);
+ return throwException("Not Found", status, _responseText, _headers, result404);
+ } else if (status === 501) {
+ const _responseText = response.data;
+ let result501: any = null;
+ let resultData501 = _responseText;
+ result501 = RemoteServiceErrorResponse.fromJS(resultData501);
+ return throwException("Server Error", status, _responseText, _headers, result501);
+ } else if (status === 500) {
+ const _responseText = response.data;
+ let result500: any = null;
+ let resultData500 = _responseText;
+ result500 = RemoteServiceErrorResponse.fromJS(resultData500);
+ return throwException("Server Error", status, _responseText, _headers, result500);
+ } else if (status !== 200 && status !== 204) {
+ const _responseText = response.data;
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
+ }
+ return Promise.resolve(null);
+ }
+}
+
export class DataDictionaryServiceProxy extends ServiceProxyBase {
private instance: AxiosInstance;
private baseUrl: string;
@@ -3785,7 +3891,7 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase {
}
}
-export class ElasticSearchServiceProxy extends ServiceProxyBase {
+export class FileConfigurationServiceProxy extends ServiceProxyBase {
private instance: AxiosInstance;
private baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;
@@ -3796,12 +3902,60 @@ export class ElasticSearchServiceProxy extends ServiceProxyBase {
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "";
}
+ /**
+ * @return Success
+ */
+ configurationGet( cancelToken?: CancelToken | undefined): Promise {
+ let url_ = this.baseUrl + "/configuration";
+ url_ = url_.replace(/[?&]$/, "");
+
+ let options_ = {
+ method: "GET",
+ url: url_,
+ headers: {
+ },
+ cancelToken
+ };
+
+ return this.transformOptions(options_).then(transformedOptions_ => {
+ return this.instance.request(transformedOptions_);
+ }).catch((_error: any) => {
+ if (isAxiosError(_error) && _error.response) {
+ return _error.response;
+ } else {
+ throw _error;
+ }
+ }).then((_response: AxiosResponse) => {
+ return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processConfigurationGet(_response));
+ });
+ }
+
+ protected processConfigurationGet(response: AxiosResponse): Promise {
+ const status = response.status;
+ let _headers: any = {};
+ if (response.headers && typeof response.headers === "object") {
+ for (let k in response.headers) {
+ if (response.headers.hasOwnProperty(k)) {
+ _headers[k] = response.headers[k];
+ }
+ }
+ }
+ if (status === 200) {
+ const _responseText = response.data;
+ return Promise.resolve(null);
+ } else if (status !== 200 && status !== 204) {
+ const _responseText = response.data;
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
+ }
+ return Promise.resolve(null);
+ }
+
/**
* @param body (optional)
* @return Success
*/
- paging(body: PagingElasticSearchLogInput | undefined , cancelToken?: CancelToken | undefined): Promise {
- let url_ = this.baseUrl + "/api/QueryManagement/ElasticSearch/paging";
+ configurationPost(body: FileConfiguration | undefined , cancelToken?: CancelToken | undefined): Promise {
+ let url_ = this.baseUrl + "/configuration";
url_ = url_.replace(/[?&]$/, "");
const content_ = JSON.stringify(body);
@@ -3812,7 +3966,6 @@ export class ElasticSearchServiceProxy extends ServiceProxyBase {
url: url_,
headers: {
"Content-Type": "application/json",
- "Accept": "text/plain"
},
cancelToken
};
@@ -3826,11 +3979,11 @@ export class ElasticSearchServiceProxy extends ServiceProxyBase {
throw _error;
}
}).then((_response: AxiosResponse) => {
- return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPaging(_response));
+ return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processConfigurationPost(_response));
});
}
- protected processPaging(response: AxiosResponse): Promise {
+ protected processConfigurationPost(response: AxiosResponse): Promise {
const status = response.status;
let _headers: any = {};
if (response.headers && typeof response.headers === "object") {
@@ -3842,51 +3995,12 @@ export class ElasticSearchServiceProxy extends ServiceProxyBase {
}
if (status === 200) {
const _responseText = response.data;
- let result200: any = null;
- let resultData200 = _responseText;
- result200 = PagingElasticSearchLogOutputCustomePagedResultDto.fromJS(resultData200);
- return result200;
- } else if (status === 403) {
- const _responseText = response.data;
- let result403: any = null;
- let resultData403 = _responseText;
- result403 = RemoteServiceErrorResponse.fromJS(resultData403);
- return throwException("Forbidden", status, _responseText, _headers, result403);
- } else if (status === 401) {
- const _responseText = response.data;
- let result401: any = null;
- let resultData401 = _responseText;
- result401 = RemoteServiceErrorResponse.fromJS(resultData401);
- return throwException("Unauthorized", status, _responseText, _headers, result401);
- } else if (status === 400) {
- const _responseText = response.data;
- let result400: any = null;
- let resultData400 = _responseText;
- result400 = RemoteServiceErrorResponse.fromJS(resultData400);
- return throwException("Bad Request", status, _responseText, _headers, result400);
- } else if (status === 404) {
- const _responseText = response.data;
- let result404: any = null;
- let resultData404 = _responseText;
- result404 = RemoteServiceErrorResponse.fromJS(resultData404);
- return throwException("Not Found", status, _responseText, _headers, result404);
- } else if (status === 501) {
- const _responseText = response.data;
- let result501: any = null;
- let resultData501 = _responseText;
- result501 = RemoteServiceErrorResponse.fromJS(resultData501);
- return throwException("Server Error", status, _responseText, _headers, result501);
- } else if (status === 500) {
- const _responseText = response.data;
- let result500: any = null;
- let resultData500 = _responseText;
- result500 = RemoteServiceErrorResponse.fromJS(resultData500);
- return throwException("Server Error", status, _responseText, _headers, result500);
+ return Promise.resolve(null);
} else if (status !== 200 && status !== 204) {
const _responseText = response.data;
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
}
- return Promise.resolve(null);
+ return Promise.resolve(null);
}
}
@@ -4374,7 +4488,7 @@ export class NotificationServiceProxy extends ServiceProxyBase {
}
/**
- * 分页查询普通消息
+ * 分页获取用户普通文本消息
* @param body (optional)
* @return Success
*/
@@ -4468,7 +4582,7 @@ export class NotificationServiceProxy extends ServiceProxyBase {
}
/**
- * 分页查询广播消息
+ * 分页获取广播消息
* @param body (optional)
* @return Success
*/
@@ -4742,6 +4856,69 @@ export class NotificationServiceProxy extends ServiceProxyBase {
}
}
+export class OutputCacheServiceProxy extends ServiceProxyBase {
+ private instance: AxiosInstance;
+ private baseUrl: string;
+ protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;
+
+ constructor(baseUrl?: string, instance?: AxiosInstance) {
+ super();
+ this.instance = instance ? instance : axios.create();
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "";
+ }
+
+ /**
+ * @return Success
+ */
+ outputcache(region: string , cancelToken?: CancelToken | undefined): Promise {
+ let url_ = this.baseUrl + "/outputcache/{region}";
+ if (region === undefined || region === null)
+ throw new Error("The parameter 'region' must be defined.");
+ url_ = url_.replace("{region}", encodeURIComponent("" + region));
+ url_ = url_.replace(/[?&]$/, "");
+
+ let options_ = {
+ method: "DELETE",
+ url: url_,
+ headers: {
+ },
+ cancelToken
+ };
+
+ return this.transformOptions(options_).then(transformedOptions_ => {
+ return this.instance.request(transformedOptions_);
+ }).catch((_error: any) => {
+ if (isAxiosError(_error) && _error.response) {
+ return _error.response;
+ } else {
+ throw _error;
+ }
+ }).then((_response: AxiosResponse) => {
+ return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processOutputcache(_response));
+ });
+ }
+
+ protected processOutputcache(response: AxiosResponse): Promise {
+ const status = response.status;
+ let _headers: any = {};
+ if (response.headers && typeof response.headers === "object") {
+ for (let k in response.headers) {
+ if (response.headers.hasOwnProperty(k)) {
+ _headers[k] = response.headers[k];
+ }
+ }
+ }
+ if (status === 200) {
+ const _responseText = response.data;
+ return Promise.resolve(null);
+ } else if (status !== 200 && status !== 204) {
+ const _responseText = response.data;
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
+ }
+ return Promise.resolve(null);
+ }
+}
+
export class PermissionsServiceProxy extends ServiceProxyBase {
private instance: AxiosInstance;
private baseUrl: string;
@@ -6483,11 +6660,12 @@ export interface IAddRedirectUriInput {
uri: string;
}
-export class ApiResourceClaimOutput implements IApiResourceClaimOutput {
- apiResourceId!: string;
- type!: string | undefined;
+export class AggregateRouteConfig implements IAggregateRouteConfig {
+ routeKey!: string | undefined;
+ parameter!: string | undefined;
+ jsonPath!: string | undefined;
- constructor(data?: IApiResourceClaimOutput) {
+ constructor(data?: IAggregateRouteConfig) {
if (data) {
for (var property in data) {
if (data.hasOwnProperty(property))
@@ -6498,29 +6676,72 @@ export class ApiResourceClaimOutput implements IApiResourceClaimOutput {
init(_data?: any) {
if (_data) {
- this.apiResourceId = _data["apiResourceId"];
- this.type = _data["type"];
+ this.routeKey = _data["routeKey"];
+ this.parameter = _data["parameter"];
+ this.jsonPath = _data["jsonPath"];
}
}
- static fromJS(data: any): ApiResourceClaimOutput {
+ static fromJS(data: any): AggregateRouteConfig {
data = typeof data === 'object' ? data : {};
- let result = new ApiResourceClaimOutput();
+ let result = new AggregateRouteConfig();
result.init(data);
return result;
}
toJSON(data?: any) {
data = typeof data === 'object' ? data : {};
- data["apiResourceId"] = this.apiResourceId;
- data["type"] = this.type;
+ data["routeKey"] = this.routeKey;
+ data["parameter"] = this.parameter;
+ data["jsonPath"] = this.jsonPath;
return data;
}
}
-export interface IApiResourceClaimOutput {
- apiResourceId: string;
- type: string | undefined;
+export interface IAggregateRouteConfig {
+ routeKey: string | undefined;
+ parameter: string | undefined;
+ jsonPath: string | undefined;
+}
+
+export class ApiResourceClaimOutput implements IApiResourceClaimOutput {
+ apiResourceId!: string;
+ type!: string | undefined;
+
+ constructor(data?: IApiResourceClaimOutput) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.apiResourceId = _data["apiResourceId"];
+ this.type = _data["type"];
+ }
+ }
+
+ static fromJS(data: any): ApiResourceClaimOutput {
+ data = typeof data === 'object' ? data : {};
+ let result = new ApiResourceClaimOutput();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["apiResourceId"] = this.apiResourceId;
+ data["type"] = this.type;
+ return data;
+ }
+}
+
+export interface IApiResourceClaimOutput {
+ apiResourceId: string;
+ type: string | undefined;
}
export class ApiResourceOutput implements IApiResourceOutput {
@@ -8092,9 +8313,13 @@ export interface ICreateIdentityResourceInput {
}
export class CreateNotificationInput implements ICreateNotificationInput {
+ /** 消息标题 */
title!: string | undefined;
+ /** 消息内容 */
content!: string | undefined;
messageType!: MessageType;
+ /** 接收人
+如果消息类型是广播消息,接收人字段为空 */
receiveIds!: string[] | undefined;
constructor(data?: ICreateNotificationInput) {
@@ -8141,9 +8366,13 @@ export class CreateNotificationInput implements ICreateNotificationInput {
}
export interface ICreateNotificationInput {
+ /** 消息标题 */
title: string | undefined;
+ /** 消息内容 */
content: string | undefined;
messageType: MessageType;
+ /** 接收人
+如果消息类型是广播消息,接收人字段为空 */
receiveIds: string[] | undefined;
}
@@ -9287,6 +9516,1042 @@ export interface IFeatureProviderDto {
key: string | undefined;
}
+export class FileAggregateRoute implements IFileAggregateRoute {
+ routeKeys!: string[] | undefined;
+ routeKeysConfig!: AggregateRouteConfig[] | undefined;
+ upstreamPathTemplate!: string | undefined;
+ upstreamHost!: string | undefined;
+ routeIsCaseSensitive!: boolean;
+ aggregator!: string | undefined;
+ readonly upstreamHttpMethod!: string[] | undefined;
+ priority!: number;
+
+ constructor(data?: IFileAggregateRoute) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ if (Array.isArray(_data["routeKeys"])) {
+ this.routeKeys = [] as any;
+ for (let item of _data["routeKeys"])
+ this.routeKeys!.push(item);
+ }
+ if (Array.isArray(_data["routeKeysConfig"])) {
+ this.routeKeysConfig = [] as any;
+ for (let item of _data["routeKeysConfig"])
+ this.routeKeysConfig!.push(AggregateRouteConfig.fromJS(item));
+ }
+ this.upstreamPathTemplate = _data["upstreamPathTemplate"];
+ this.upstreamHost = _data["upstreamHost"];
+ this.routeIsCaseSensitive = _data["routeIsCaseSensitive"];
+ this.aggregator = _data["aggregator"];
+ if (Array.isArray(_data["upstreamHttpMethod"])) {
+ (this).upstreamHttpMethod = [] as any;
+ for (let item of _data["upstreamHttpMethod"])
+ (this).upstreamHttpMethod!.push(item);
+ }
+ this.priority = _data["priority"];
+ }
+ }
+
+ static fromJS(data: any): FileAggregateRoute {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileAggregateRoute();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ if (Array.isArray(this.routeKeys)) {
+ data["routeKeys"] = [];
+ for (let item of this.routeKeys)
+ data["routeKeys"].push(item);
+ }
+ if (Array.isArray(this.routeKeysConfig)) {
+ data["routeKeysConfig"] = [];
+ for (let item of this.routeKeysConfig)
+ data["routeKeysConfig"].push(item.toJSON());
+ }
+ data["upstreamPathTemplate"] = this.upstreamPathTemplate;
+ data["upstreamHost"] = this.upstreamHost;
+ data["routeIsCaseSensitive"] = this.routeIsCaseSensitive;
+ data["aggregator"] = this.aggregator;
+ if (Array.isArray(this.upstreamHttpMethod)) {
+ data["upstreamHttpMethod"] = [];
+ for (let item of this.upstreamHttpMethod)
+ data["upstreamHttpMethod"].push(item);
+ }
+ data["priority"] = this.priority;
+ return data;
+ }
+}
+
+export interface IFileAggregateRoute {
+ routeKeys: string[] | undefined;
+ routeKeysConfig: AggregateRouteConfig[] | undefined;
+ upstreamPathTemplate: string | undefined;
+ upstreamHost: string | undefined;
+ routeIsCaseSensitive: boolean;
+ aggregator: string | undefined;
+ upstreamHttpMethod: string[] | undefined;
+ priority: number;
+}
+
+export class FileAuthenticationOptions implements IFileAuthenticationOptions {
+ authenticationProviderKey!: string | undefined;
+ allowedScopes!: string[] | undefined;
+
+ constructor(data?: IFileAuthenticationOptions) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.authenticationProviderKey = _data["authenticationProviderKey"];
+ if (Array.isArray(_data["allowedScopes"])) {
+ this.allowedScopes = [] as any;
+ for (let item of _data["allowedScopes"])
+ this.allowedScopes!.push(item);
+ }
+ }
+ }
+
+ static fromJS(data: any): FileAuthenticationOptions {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileAuthenticationOptions();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["authenticationProviderKey"] = this.authenticationProviderKey;
+ if (Array.isArray(this.allowedScopes)) {
+ data["allowedScopes"] = [];
+ for (let item of this.allowedScopes)
+ data["allowedScopes"].push(item);
+ }
+ return data;
+ }
+}
+
+export interface IFileAuthenticationOptions {
+ authenticationProviderKey: string | undefined;
+ allowedScopes: string[] | undefined;
+}
+
+export class FileCacheOptions implements IFileCacheOptions {
+ ttlSeconds!: number;
+ region!: string | undefined;
+
+ constructor(data?: IFileCacheOptions) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.ttlSeconds = _data["ttlSeconds"];
+ this.region = _data["region"];
+ }
+ }
+
+ static fromJS(data: any): FileCacheOptions {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileCacheOptions();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["ttlSeconds"] = this.ttlSeconds;
+ data["region"] = this.region;
+ return data;
+ }
+}
+
+export interface IFileCacheOptions {
+ ttlSeconds: number;
+ region: string | undefined;
+}
+
+export class FileConfiguration implements IFileConfiguration {
+ routes!: FileRoute[] | undefined;
+ dynamicRoutes!: FileDynamicRoute[] | undefined;
+ aggregates!: FileAggregateRoute[] | undefined;
+ globalConfiguration!: FileGlobalConfiguration;
+
+ constructor(data?: IFileConfiguration) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ if (Array.isArray(_data["routes"])) {
+ this.routes = [] as any;
+ for (let item of _data["routes"])
+ this.routes!.push(FileRoute.fromJS(item));
+ }
+ if (Array.isArray(_data["dynamicRoutes"])) {
+ this.dynamicRoutes = [] as any;
+ for (let item of _data["dynamicRoutes"])
+ this.dynamicRoutes!.push(FileDynamicRoute.fromJS(item));
+ }
+ if (Array.isArray(_data["aggregates"])) {
+ this.aggregates = [] as any;
+ for (let item of _data["aggregates"])
+ this.aggregates!.push(FileAggregateRoute.fromJS(item));
+ }
+ this.globalConfiguration = _data["globalConfiguration"] ? FileGlobalConfiguration.fromJS(_data["globalConfiguration"]) : undefined;
+ }
+ }
+
+ static fromJS(data: any): FileConfiguration {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileConfiguration();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ if (Array.isArray(this.routes)) {
+ data["routes"] = [];
+ for (let item of this.routes)
+ data["routes"].push(item.toJSON());
+ }
+ if (Array.isArray(this.dynamicRoutes)) {
+ data["dynamicRoutes"] = [];
+ for (let item of this.dynamicRoutes)
+ data["dynamicRoutes"].push(item.toJSON());
+ }
+ if (Array.isArray(this.aggregates)) {
+ data["aggregates"] = [];
+ for (let item of this.aggregates)
+ data["aggregates"].push(item.toJSON());
+ }
+ data["globalConfiguration"] = this.globalConfiguration ? this.globalConfiguration.toJSON() : undefined;
+ return data;
+ }
+}
+
+export interface IFileConfiguration {
+ routes: FileRoute[] | undefined;
+ dynamicRoutes: FileDynamicRoute[] | undefined;
+ aggregates: FileAggregateRoute[] | undefined;
+ globalConfiguration: FileGlobalConfiguration;
+}
+
+export class FileDynamicRoute implements IFileDynamicRoute {
+ serviceName!: string | undefined;
+ rateLimitRule!: FileRateLimitRule;
+ downstreamHttpVersion!: string | undefined;
+
+ constructor(data?: IFileDynamicRoute) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.serviceName = _data["serviceName"];
+ this.rateLimitRule = _data["rateLimitRule"] ? FileRateLimitRule.fromJS(_data["rateLimitRule"]) : undefined;
+ this.downstreamHttpVersion = _data["downstreamHttpVersion"];
+ }
+ }
+
+ static fromJS(data: any): FileDynamicRoute {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileDynamicRoute();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["serviceName"] = this.serviceName;
+ data["rateLimitRule"] = this.rateLimitRule ? this.rateLimitRule.toJSON() : undefined;
+ data["downstreamHttpVersion"] = this.downstreamHttpVersion;
+ return data;
+ }
+}
+
+export interface IFileDynamicRoute {
+ serviceName: string | undefined;
+ rateLimitRule: FileRateLimitRule;
+ downstreamHttpVersion: string | undefined;
+}
+
+export class FileGlobalConfiguration implements IFileGlobalConfiguration {
+ requestIdKey!: string | undefined;
+ serviceDiscoveryProvider!: FileServiceDiscoveryProvider;
+ rateLimitOptions!: FileRateLimitOptions;
+ qoSOptions!: FileQoSOptions;
+ baseUrl!: string | undefined;
+ loadBalancerOptions!: FileLoadBalancerOptions;
+ downstreamScheme!: string | undefined;
+ httpHandlerOptions!: FileHttpHandlerOptions;
+ downstreamHttpVersion!: string | undefined;
+
+ constructor(data?: IFileGlobalConfiguration) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.requestIdKey = _data["requestIdKey"];
+ this.serviceDiscoveryProvider = _data["serviceDiscoveryProvider"] ? FileServiceDiscoveryProvider.fromJS(_data["serviceDiscoveryProvider"]) : undefined;
+ this.rateLimitOptions = _data["rateLimitOptions"] ? FileRateLimitOptions.fromJS(_data["rateLimitOptions"]) : undefined;
+ this.qoSOptions = _data["qoSOptions"] ? FileQoSOptions.fromJS(_data["qoSOptions"]) : undefined;
+ this.baseUrl = _data["baseUrl"];
+ this.loadBalancerOptions = _data["loadBalancerOptions"] ? FileLoadBalancerOptions.fromJS(_data["loadBalancerOptions"]) : undefined;
+ this.downstreamScheme = _data["downstreamScheme"];
+ this.httpHandlerOptions = _data["httpHandlerOptions"] ? FileHttpHandlerOptions.fromJS(_data["httpHandlerOptions"]) : undefined;
+ this.downstreamHttpVersion = _data["downstreamHttpVersion"];
+ }
+ }
+
+ static fromJS(data: any): FileGlobalConfiguration {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileGlobalConfiguration();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["requestIdKey"] = this.requestIdKey;
+ data["serviceDiscoveryProvider"] = this.serviceDiscoveryProvider ? this.serviceDiscoveryProvider.toJSON() : undefined;
+ data["rateLimitOptions"] = this.rateLimitOptions ? this.rateLimitOptions.toJSON() : undefined;
+ data["qoSOptions"] = this.qoSOptions ? this.qoSOptions.toJSON() : undefined;
+ data["baseUrl"] = this.baseUrl;
+ data["loadBalancerOptions"] = this.loadBalancerOptions ? this.loadBalancerOptions.toJSON() : undefined;
+ data["downstreamScheme"] = this.downstreamScheme;
+ data["httpHandlerOptions"] = this.httpHandlerOptions ? this.httpHandlerOptions.toJSON() : undefined;
+ data["downstreamHttpVersion"] = this.downstreamHttpVersion;
+ return data;
+ }
+}
+
+export interface IFileGlobalConfiguration {
+ requestIdKey: string | undefined;
+ serviceDiscoveryProvider: FileServiceDiscoveryProvider;
+ rateLimitOptions: FileRateLimitOptions;
+ qoSOptions: FileQoSOptions;
+ baseUrl: string | undefined;
+ loadBalancerOptions: FileLoadBalancerOptions;
+ downstreamScheme: string | undefined;
+ httpHandlerOptions: FileHttpHandlerOptions;
+ downstreamHttpVersion: string | undefined;
+}
+
+export class FileHostAndPort implements IFileHostAndPort {
+ host!: string | undefined;
+ port!: number;
+
+ constructor(data?: IFileHostAndPort) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.host = _data["host"];
+ this.port = _data["port"];
+ }
+ }
+
+ static fromJS(data: any): FileHostAndPort {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileHostAndPort();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["host"] = this.host;
+ data["port"] = this.port;
+ return data;
+ }
+}
+
+export interface IFileHostAndPort {
+ host: string | undefined;
+ port: number;
+}
+
+export class FileHttpHandlerOptions implements IFileHttpHandlerOptions {
+ allowAutoRedirect!: boolean;
+ useCookieContainer!: boolean;
+ useTracing!: boolean;
+ useProxy!: boolean;
+ maxConnectionsPerServer!: number;
+
+ constructor(data?: IFileHttpHandlerOptions) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.allowAutoRedirect = _data["allowAutoRedirect"];
+ this.useCookieContainer = _data["useCookieContainer"];
+ this.useTracing = _data["useTracing"];
+ this.useProxy = _data["useProxy"];
+ this.maxConnectionsPerServer = _data["maxConnectionsPerServer"];
+ }
+ }
+
+ static fromJS(data: any): FileHttpHandlerOptions {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileHttpHandlerOptions();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["allowAutoRedirect"] = this.allowAutoRedirect;
+ data["useCookieContainer"] = this.useCookieContainer;
+ data["useTracing"] = this.useTracing;
+ data["useProxy"] = this.useProxy;
+ data["maxConnectionsPerServer"] = this.maxConnectionsPerServer;
+ return data;
+ }
+}
+
+export interface IFileHttpHandlerOptions {
+ allowAutoRedirect: boolean;
+ useCookieContainer: boolean;
+ useTracing: boolean;
+ useProxy: boolean;
+ maxConnectionsPerServer: number;
+}
+
+export class FileLoadBalancerOptions implements IFileLoadBalancerOptions {
+ type!: string | undefined;
+ key!: string | undefined;
+ expiry!: number;
+
+ constructor(data?: IFileLoadBalancerOptions) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.type = _data["type"];
+ this.key = _data["key"];
+ this.expiry = _data["expiry"];
+ }
+ }
+
+ static fromJS(data: any): FileLoadBalancerOptions {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileLoadBalancerOptions();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["type"] = this.type;
+ data["key"] = this.key;
+ data["expiry"] = this.expiry;
+ return data;
+ }
+}
+
+export interface IFileLoadBalancerOptions {
+ type: string | undefined;
+ key: string | undefined;
+ expiry: number;
+}
+
+export class FileQoSOptions implements IFileQoSOptions {
+ exceptionsAllowedBeforeBreaking!: number;
+ durationOfBreak!: number;
+ timeoutValue!: number;
+
+ constructor(data?: IFileQoSOptions) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.exceptionsAllowedBeforeBreaking = _data["exceptionsAllowedBeforeBreaking"];
+ this.durationOfBreak = _data["durationOfBreak"];
+ this.timeoutValue = _data["timeoutValue"];
+ }
+ }
+
+ static fromJS(data: any): FileQoSOptions {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileQoSOptions();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["exceptionsAllowedBeforeBreaking"] = this.exceptionsAllowedBeforeBreaking;
+ data["durationOfBreak"] = this.durationOfBreak;
+ data["timeoutValue"] = this.timeoutValue;
+ return data;
+ }
+}
+
+export interface IFileQoSOptions {
+ exceptionsAllowedBeforeBreaking: number;
+ durationOfBreak: number;
+ timeoutValue: number;
+}
+
+export class FileRateLimitOptions implements IFileRateLimitOptions {
+ clientIdHeader!: string | undefined;
+ quotaExceededMessage!: string | undefined;
+ rateLimitCounterPrefix!: string | undefined;
+ disableRateLimitHeaders!: boolean;
+ httpStatusCode!: number;
+
+ constructor(data?: IFileRateLimitOptions) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.clientIdHeader = _data["clientIdHeader"];
+ this.quotaExceededMessage = _data["quotaExceededMessage"];
+ this.rateLimitCounterPrefix = _data["rateLimitCounterPrefix"];
+ this.disableRateLimitHeaders = _data["disableRateLimitHeaders"];
+ this.httpStatusCode = _data["httpStatusCode"];
+ }
+ }
+
+ static fromJS(data: any): FileRateLimitOptions {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileRateLimitOptions();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["clientIdHeader"] = this.clientIdHeader;
+ data["quotaExceededMessage"] = this.quotaExceededMessage;
+ data["rateLimitCounterPrefix"] = this.rateLimitCounterPrefix;
+ data["disableRateLimitHeaders"] = this.disableRateLimitHeaders;
+ data["httpStatusCode"] = this.httpStatusCode;
+ return data;
+ }
+}
+
+export interface IFileRateLimitOptions {
+ clientIdHeader: string | undefined;
+ quotaExceededMessage: string | undefined;
+ rateLimitCounterPrefix: string | undefined;
+ disableRateLimitHeaders: boolean;
+ httpStatusCode: number;
+}
+
+export class FileRateLimitRule implements IFileRateLimitRule {
+ clientWhitelist!: string[] | undefined;
+ enableRateLimiting!: boolean;
+ period!: string | undefined;
+ periodTimespan!: number;
+ limit!: number;
+
+ constructor(data?: IFileRateLimitRule) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ if (Array.isArray(_data["clientWhitelist"])) {
+ this.clientWhitelist = [] as any;
+ for (let item of _data["clientWhitelist"])
+ this.clientWhitelist!.push(item);
+ }
+ this.enableRateLimiting = _data["enableRateLimiting"];
+ this.period = _data["period"];
+ this.periodTimespan = _data["periodTimespan"];
+ this.limit = _data["limit"];
+ }
+ }
+
+ static fromJS(data: any): FileRateLimitRule {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileRateLimitRule();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ if (Array.isArray(this.clientWhitelist)) {
+ data["clientWhitelist"] = [];
+ for (let item of this.clientWhitelist)
+ data["clientWhitelist"].push(item);
+ }
+ data["enableRateLimiting"] = this.enableRateLimiting;
+ data["period"] = this.period;
+ data["periodTimespan"] = this.periodTimespan;
+ data["limit"] = this.limit;
+ return data;
+ }
+}
+
+export interface IFileRateLimitRule {
+ clientWhitelist: string[] | undefined;
+ enableRateLimiting: boolean;
+ period: string | undefined;
+ periodTimespan: number;
+ limit: number;
+}
+
+export class FileRoute implements IFileRoute {
+ downstreamPathTemplate!: string | undefined;
+ upstreamPathTemplate!: string | undefined;
+ upstreamHttpMethod!: string[] | undefined;
+ downstreamHttpMethod!: string | undefined;
+ addHeadersToRequest!: { [key: string]: string; } | undefined;
+ upstreamHeaderTransform!: { [key: string]: string; } | undefined;
+ downstreamHeaderTransform!: { [key: string]: string; } | undefined;
+ addClaimsToRequest!: { [key: string]: string; } | undefined;
+ routeClaimsRequirement!: { [key: string]: string; } | undefined;
+ addQueriesToRequest!: { [key: string]: string; } | undefined;
+ changeDownstreamPathTemplate!: { [key: string]: string; } | undefined;
+ requestIdKey!: string | undefined;
+ fileCacheOptions!: FileCacheOptions;
+ routeIsCaseSensitive!: boolean;
+ serviceName!: string | undefined;
+ serviceNamespace!: string | undefined;
+ downstreamScheme!: string | undefined;
+ qoSOptions!: FileQoSOptions;
+ loadBalancerOptions!: FileLoadBalancerOptions;
+ rateLimitOptions!: FileRateLimitRule;
+ authenticationOptions!: FileAuthenticationOptions;
+ httpHandlerOptions!: FileHttpHandlerOptions;
+ downstreamHostAndPorts!: FileHostAndPort[] | undefined;
+ upstreamHost!: string | undefined;
+ key!: string | undefined;
+ delegatingHandlers!: string[] | undefined;
+ priority!: number;
+ timeout!: number;
+ dangerousAcceptAnyServerCertificateValidator!: boolean;
+ securityOptions!: FileSecurityOptions;
+ downstreamHttpVersion!: string | undefined;
+
+ constructor(data?: IFileRoute) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.downstreamPathTemplate = _data["downstreamPathTemplate"];
+ this.upstreamPathTemplate = _data["upstreamPathTemplate"];
+ if (Array.isArray(_data["upstreamHttpMethod"])) {
+ this.upstreamHttpMethod = [] as any;
+ for (let item of _data["upstreamHttpMethod"])
+ this.upstreamHttpMethod!.push(item);
+ }
+ this.downstreamHttpMethod = _data["downstreamHttpMethod"];
+ if (_data["addHeadersToRequest"]) {
+ this.addHeadersToRequest = {} as any;
+ for (let key in _data["addHeadersToRequest"]) {
+ if (_data["addHeadersToRequest"].hasOwnProperty(key))
+ (this.addHeadersToRequest)![key] = _data["addHeadersToRequest"][key];
+ }
+ }
+ if (_data["upstreamHeaderTransform"]) {
+ this.upstreamHeaderTransform = {} as any;
+ for (let key in _data["upstreamHeaderTransform"]) {
+ if (_data["upstreamHeaderTransform"].hasOwnProperty(key))
+ (this.upstreamHeaderTransform)![key] = _data["upstreamHeaderTransform"][key];
+ }
+ }
+ if (_data["downstreamHeaderTransform"]) {
+ this.downstreamHeaderTransform = {} as any;
+ for (let key in _data["downstreamHeaderTransform"]) {
+ if (_data["downstreamHeaderTransform"].hasOwnProperty(key))
+ (this.downstreamHeaderTransform)![key] = _data["downstreamHeaderTransform"][key];
+ }
+ }
+ if (_data["addClaimsToRequest"]) {
+ this.addClaimsToRequest = {} as any;
+ for (let key in _data["addClaimsToRequest"]) {
+ if (_data["addClaimsToRequest"].hasOwnProperty(key))
+ (this.addClaimsToRequest)![key] = _data["addClaimsToRequest"][key];
+ }
+ }
+ if (_data["routeClaimsRequirement"]) {
+ this.routeClaimsRequirement = {} as any;
+ for (let key in _data["routeClaimsRequirement"]) {
+ if (_data["routeClaimsRequirement"].hasOwnProperty(key))
+ (this.routeClaimsRequirement)![key] = _data["routeClaimsRequirement"][key];
+ }
+ }
+ if (_data["addQueriesToRequest"]) {
+ this.addQueriesToRequest = {} as any;
+ for (let key in _data["addQueriesToRequest"]) {
+ if (_data["addQueriesToRequest"].hasOwnProperty(key))
+ (this.addQueriesToRequest)![key] = _data["addQueriesToRequest"][key];
+ }
+ }
+ if (_data["changeDownstreamPathTemplate"]) {
+ this.changeDownstreamPathTemplate = {} as any;
+ for (let key in _data["changeDownstreamPathTemplate"]) {
+ if (_data["changeDownstreamPathTemplate"].hasOwnProperty(key))
+ (this.changeDownstreamPathTemplate)![key] = _data["changeDownstreamPathTemplate"][key];
+ }
+ }
+ this.requestIdKey = _data["requestIdKey"];
+ this.fileCacheOptions = _data["fileCacheOptions"] ? FileCacheOptions.fromJS(_data["fileCacheOptions"]) : undefined;
+ this.routeIsCaseSensitive = _data["routeIsCaseSensitive"];
+ this.serviceName = _data["serviceName"];
+ this.serviceNamespace = _data["serviceNamespace"];
+ this.downstreamScheme = _data["downstreamScheme"];
+ this.qoSOptions = _data["qoSOptions"] ? FileQoSOptions.fromJS(_data["qoSOptions"]) : undefined;
+ this.loadBalancerOptions = _data["loadBalancerOptions"] ? FileLoadBalancerOptions.fromJS(_data["loadBalancerOptions"]) : undefined;
+ this.rateLimitOptions = _data["rateLimitOptions"] ? FileRateLimitRule.fromJS(_data["rateLimitOptions"]) : undefined;
+ this.authenticationOptions = _data["authenticationOptions"] ? FileAuthenticationOptions.fromJS(_data["authenticationOptions"]) : undefined;
+ this.httpHandlerOptions = _data["httpHandlerOptions"] ? FileHttpHandlerOptions.fromJS(_data["httpHandlerOptions"]) : undefined;
+ if (Array.isArray(_data["downstreamHostAndPorts"])) {
+ this.downstreamHostAndPorts = [] as any;
+ for (let item of _data["downstreamHostAndPorts"])
+ this.downstreamHostAndPorts!.push(FileHostAndPort.fromJS(item));
+ }
+ this.upstreamHost = _data["upstreamHost"];
+ this.key = _data["key"];
+ if (Array.isArray(_data["delegatingHandlers"])) {
+ this.delegatingHandlers = [] as any;
+ for (let item of _data["delegatingHandlers"])
+ this.delegatingHandlers!.push(item);
+ }
+ this.priority = _data["priority"];
+ this.timeout = _data["timeout"];
+ this.dangerousAcceptAnyServerCertificateValidator = _data["dangerousAcceptAnyServerCertificateValidator"];
+ this.securityOptions = _data["securityOptions"] ? FileSecurityOptions.fromJS(_data["securityOptions"]) : undefined;
+ this.downstreamHttpVersion = _data["downstreamHttpVersion"];
+ }
+ }
+
+ static fromJS(data: any): FileRoute {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileRoute();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["downstreamPathTemplate"] = this.downstreamPathTemplate;
+ data["upstreamPathTemplate"] = this.upstreamPathTemplate;
+ if (Array.isArray(this.upstreamHttpMethod)) {
+ data["upstreamHttpMethod"] = [];
+ for (let item of this.upstreamHttpMethod)
+ data["upstreamHttpMethod"].push(item);
+ }
+ data["downstreamHttpMethod"] = this.downstreamHttpMethod;
+ if (this.addHeadersToRequest) {
+ data["addHeadersToRequest"] = {};
+ for (let key in this.addHeadersToRequest) {
+ if (this.addHeadersToRequest.hasOwnProperty(key))
+ (data["addHeadersToRequest"])[key] = this.addHeadersToRequest[key];
+ }
+ }
+ if (this.upstreamHeaderTransform) {
+ data["upstreamHeaderTransform"] = {};
+ for (let key in this.upstreamHeaderTransform) {
+ if (this.upstreamHeaderTransform.hasOwnProperty(key))
+ (data["upstreamHeaderTransform"])[key] = this.upstreamHeaderTransform[key];
+ }
+ }
+ if (this.downstreamHeaderTransform) {
+ data["downstreamHeaderTransform"] = {};
+ for (let key in this.downstreamHeaderTransform) {
+ if (this.downstreamHeaderTransform.hasOwnProperty(key))
+ (data["downstreamHeaderTransform"])[key] = this.downstreamHeaderTransform[key];
+ }
+ }
+ if (this.addClaimsToRequest) {
+ data["addClaimsToRequest"] = {};
+ for (let key in this.addClaimsToRequest) {
+ if (this.addClaimsToRequest.hasOwnProperty(key))
+ (data["addClaimsToRequest"])[key] = this.addClaimsToRequest[key];
+ }
+ }
+ if (this.routeClaimsRequirement) {
+ data["routeClaimsRequirement"] = {};
+ for (let key in this.routeClaimsRequirement) {
+ if (this.routeClaimsRequirement.hasOwnProperty(key))
+ (data["routeClaimsRequirement"])[key] = this.routeClaimsRequirement[key];
+ }
+ }
+ if (this.addQueriesToRequest) {
+ data["addQueriesToRequest"] = {};
+ for (let key in this.addQueriesToRequest) {
+ if (this.addQueriesToRequest.hasOwnProperty(key))
+ (data["addQueriesToRequest"])[key] = this.addQueriesToRequest[key];
+ }
+ }
+ if (this.changeDownstreamPathTemplate) {
+ data["changeDownstreamPathTemplate"] = {};
+ for (let key in this.changeDownstreamPathTemplate) {
+ if (this.changeDownstreamPathTemplate.hasOwnProperty(key))
+ (data["changeDownstreamPathTemplate"])[key] = this.changeDownstreamPathTemplate[key];
+ }
+ }
+ data["requestIdKey"] = this.requestIdKey;
+ data["fileCacheOptions"] = this.fileCacheOptions ? this.fileCacheOptions.toJSON() : undefined;
+ data["routeIsCaseSensitive"] = this.routeIsCaseSensitive;
+ data["serviceName"] = this.serviceName;
+ data["serviceNamespace"] = this.serviceNamespace;
+ data["downstreamScheme"] = this.downstreamScheme;
+ data["qoSOptions"] = this.qoSOptions ? this.qoSOptions.toJSON() : undefined;
+ data["loadBalancerOptions"] = this.loadBalancerOptions ? this.loadBalancerOptions.toJSON() : undefined;
+ data["rateLimitOptions"] = this.rateLimitOptions ? this.rateLimitOptions.toJSON() : undefined;
+ data["authenticationOptions"] = this.authenticationOptions ? this.authenticationOptions.toJSON() : undefined;
+ data["httpHandlerOptions"] = this.httpHandlerOptions ? this.httpHandlerOptions.toJSON() : undefined;
+ if (Array.isArray(this.downstreamHostAndPorts)) {
+ data["downstreamHostAndPorts"] = [];
+ for (let item of this.downstreamHostAndPorts)
+ data["downstreamHostAndPorts"].push(item.toJSON());
+ }
+ data["upstreamHost"] = this.upstreamHost;
+ data["key"] = this.key;
+ if (Array.isArray(this.delegatingHandlers)) {
+ data["delegatingHandlers"] = [];
+ for (let item of this.delegatingHandlers)
+ data["delegatingHandlers"].push(item);
+ }
+ data["priority"] = this.priority;
+ data["timeout"] = this.timeout;
+ data["dangerousAcceptAnyServerCertificateValidator"] = this.dangerousAcceptAnyServerCertificateValidator;
+ data["securityOptions"] = this.securityOptions ? this.securityOptions.toJSON() : undefined;
+ data["downstreamHttpVersion"] = this.downstreamHttpVersion;
+ return data;
+ }
+}
+
+export interface IFileRoute {
+ downstreamPathTemplate: string | undefined;
+ upstreamPathTemplate: string | undefined;
+ upstreamHttpMethod: string[] | undefined;
+ downstreamHttpMethod: string | undefined;
+ addHeadersToRequest: { [key: string]: string; } | undefined;
+ upstreamHeaderTransform: { [key: string]: string; } | undefined;
+ downstreamHeaderTransform: { [key: string]: string; } | undefined;
+ addClaimsToRequest: { [key: string]: string; } | undefined;
+ routeClaimsRequirement: { [key: string]: string; } | undefined;
+ addQueriesToRequest: { [key: string]: string; } | undefined;
+ changeDownstreamPathTemplate: { [key: string]: string; } | undefined;
+ requestIdKey: string | undefined;
+ fileCacheOptions: FileCacheOptions;
+ routeIsCaseSensitive: boolean;
+ serviceName: string | undefined;
+ serviceNamespace: string | undefined;
+ downstreamScheme: string | undefined;
+ qoSOptions: FileQoSOptions;
+ loadBalancerOptions: FileLoadBalancerOptions;
+ rateLimitOptions: FileRateLimitRule;
+ authenticationOptions: FileAuthenticationOptions;
+ httpHandlerOptions: FileHttpHandlerOptions;
+ downstreamHostAndPorts: FileHostAndPort[] | undefined;
+ upstreamHost: string | undefined;
+ key: string | undefined;
+ delegatingHandlers: string[] | undefined;
+ priority: number;
+ timeout: number;
+ dangerousAcceptAnyServerCertificateValidator: boolean;
+ securityOptions: FileSecurityOptions;
+ downstreamHttpVersion: string | undefined;
+}
+
+export class FileSecurityOptions implements IFileSecurityOptions {
+ ipAllowedList!: string[] | undefined;
+ ipBlockedList!: string[] | undefined;
+
+ constructor(data?: IFileSecurityOptions) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ if (Array.isArray(_data["ipAllowedList"])) {
+ this.ipAllowedList = [] as any;
+ for (let item of _data["ipAllowedList"])
+ this.ipAllowedList!.push(item);
+ }
+ if (Array.isArray(_data["ipBlockedList"])) {
+ this.ipBlockedList = [] as any;
+ for (let item of _data["ipBlockedList"])
+ this.ipBlockedList!.push(item);
+ }
+ }
+ }
+
+ static fromJS(data: any): FileSecurityOptions {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileSecurityOptions();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ if (Array.isArray(this.ipAllowedList)) {
+ data["ipAllowedList"] = [];
+ for (let item of this.ipAllowedList)
+ data["ipAllowedList"].push(item);
+ }
+ if (Array.isArray(this.ipBlockedList)) {
+ data["ipBlockedList"] = [];
+ for (let item of this.ipBlockedList)
+ data["ipBlockedList"].push(item);
+ }
+ return data;
+ }
+}
+
+export interface IFileSecurityOptions {
+ ipAllowedList: string[] | undefined;
+ ipBlockedList: string[] | undefined;
+}
+
+export class FileServiceDiscoveryProvider implements IFileServiceDiscoveryProvider {
+ scheme!: string | undefined;
+ host!: string | undefined;
+ port!: number;
+ type!: string | undefined;
+ token!: string | undefined;
+ configurationKey!: string | undefined;
+ pollingInterval!: number;
+ namespace!: string | undefined;
+
+ constructor(data?: IFileServiceDiscoveryProvider) {
+ if (data) {
+ for (var property in data) {
+ if (data.hasOwnProperty(property))
+ (this)[property] = (data)[property];
+ }
+ }
+ }
+
+ init(_data?: any) {
+ if (_data) {
+ this.scheme = _data["scheme"];
+ this.host = _data["host"];
+ this.port = _data["port"];
+ this.type = _data["type"];
+ this.token = _data["token"];
+ this.configurationKey = _data["configurationKey"];
+ this.pollingInterval = _data["pollingInterval"];
+ this.namespace = _data["namespace"];
+ }
+ }
+
+ static fromJS(data: any): FileServiceDiscoveryProvider {
+ data = typeof data === 'object' ? data : {};
+ let result = new FileServiceDiscoveryProvider();
+ result.init(data);
+ return result;
+ }
+
+ toJSON(data?: any) {
+ data = typeof data === 'object' ? data : {};
+ data["scheme"] = this.scheme;
+ data["host"] = this.host;
+ data["port"] = this.port;
+ data["type"] = this.type;
+ data["token"] = this.token;
+ data["configurationKey"] = this.configurationKey;
+ data["pollingInterval"] = this.pollingInterval;
+ data["namespace"] = this.namespace;
+ return data;
+ }
+}
+
+export interface IFileServiceDiscoveryProvider {
+ scheme: string | undefined;
+ host: string | undefined;
+ port: number;
+ type: string | undefined;
+ token: string | undefined;
+ configurationKey: string | undefined;
+ pollingInterval: number;
+ namespace: string | undefined;
+}
+
export class FindTenantByNameInput implements IFindTenantByNameInput {
name!: string | undefined;
@@ -10718,8 +11983,11 @@ export interface ILockUserInput {
locked: boolean;
}
+/** 登录 */
export class LoginInput implements ILoginInput {
+ /** 用户名或者邮箱 */
name!: string | undefined;
+ /** 密码 */
password!: string | undefined;
constructor(data?: ILoginInput) {
@@ -10753,8 +12021,11 @@ export class LoginInput implements ILoginInput {
}
}
+/** 登录 */
export interface ILoginInput {
+ /** 用户名或者邮箱 */
name: string | undefined;
+ /** 密码 */
password: string | undefined;
}
@@ -10826,6 +12097,7 @@ export enum LoginResultType {
RequiresTwoFactor = 5,
}
+/** 消息类型 */
export enum MessageType {
BroadCast = 10,
Text = 20,
@@ -11897,11 +13169,17 @@ export interface IPagingDataDictionaryDetailInput {
export class PagingDataDictionaryDetailOutput implements IPagingDataDictionaryDetailOutput {
id!: string;
+ /** 所属字典Id */
dataDictionaryId!: string;
+ /** 字典明细编码 */
code!: string | undefined;
+ /** 展现列表时排序用 */
order!: number;
+ /** 英文显示名 */
displayText!: string | undefined;
+ /** 描述 */
description!: string | undefined;
+ /** 启/停用(默认启用) */
isEnabled!: boolean;
constructor(data?: IPagingDataDictionaryDetailOutput) {
@@ -11947,11 +13225,17 @@ export class PagingDataDictionaryDetailOutput implements IPagingDataDictionaryDe
export interface IPagingDataDictionaryDetailOutput {
id: string;
+ /** 所属字典Id */
dataDictionaryId: string;
+ /** 字典明细编码 */
code: string | undefined;
+ /** 展现列表时排序用 */
order: number;
+ /** 英文显示名 */
displayText: string | undefined;
+ /** 描述 */
description: string | undefined;
+ /** 启/停用(默认启用) */
isEnabled: boolean;
}
@@ -12053,8 +13337,11 @@ export interface IPagingDataDictionaryInput {
export class PagingDataDictionaryOutput implements IPagingDataDictionaryOutput {
id!: string;
+ /** 字典编码 */
code!: string | undefined;
+ /** 显示名 */
displayText!: string | undefined;
+ /** 描述 */
description!: string | undefined;
constructor(data?: IPagingDataDictionaryOutput) {
@@ -12094,8 +13381,11 @@ export class PagingDataDictionaryOutput implements IPagingDataDictionaryOutput {
export interface IPagingDataDictionaryOutput {
id: string;
+ /** 字典编码 */
code: string | undefined;
+ /** 显示名 */
displayText: string | undefined;
+ /** 描述 */
description: string | undefined;
}
@@ -12699,6 +13989,7 @@ export class PagingUserListInput implements IPagingUserListInput {
pageIndex!: number;
pageSize!: number;
readonly skipCount!: number;
+ /** 关键字 */
filter!: string | undefined;
constructor(data?: IPagingUserListInput) {
@@ -12740,6 +14031,7 @@ export interface IPagingUserListInput {
pageIndex: number;
pageSize: number;
skipCount: number;
+ /** 关键字 */
filter: string | undefined;
}
diff --git a/vben271/src/views/admin/elasticSearch/ElasticSearch.ts b/vben271/src/views/admin/elasticSearch/ElasticSearch.ts
index e57cea50..e088b7d6 100644
--- a/vben271/src/views/admin/elasticSearch/ElasticSearch.ts
+++ b/vben271/src/views/admin/elasticSearch/ElasticSearch.ts
@@ -4,7 +4,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
import moment from 'moment';
import {
- ElasticSearchServiceProxy,
+ EsLogServiceProxy,
PagingElasticSearchLogInput,
PagingElasticSearchLogOutputCustomePagedResultDto,
} from '/@/services/ServiceProxies';
@@ -55,6 +55,6 @@ export const tableColumns: BasicColumn[] = [
export async function getElasticSearchLogAsync(
request: PagingElasticSearchLogInput
): Promise {
- const _elasticSearchServiceProxy = new ElasticSearchServiceProxy();
- return await _elasticSearchServiceProxy.paging(request);
+ const _elasticSearchServiceProxy = new EsLogServiceProxy();
+ return await _elasticSearchServiceProxy.page(request);
}