Browse Source

Merge pull request #862 from leehom0123/master

本地化支持修改
pull/865/head
yx lin 2 years ago
committed by GitHub
parent
commit
7c72807496
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/vue/run.bat
  2. 5
      apps/vue/src/api/localization/languages.ts
  3. 4
      apps/vue/src/api/localization/model/languagesModel.ts
  4. 4
      apps/vue/src/api/localization/model/resourcesModel.ts
  5. 5
      apps/vue/src/api/localization/resources.ts
  6. 3
      apps/vue/src/utils/http/axios/index.ts
  7. 4
      apps/vue/src/views/localization/languages/components/LanguageTable.vue
  8. 8
      apps/vue/src/views/localization/resources/components/ResourceTable.vue
  9. 2
      apps/vue/src/views/messages/notifications/datas/ModalData.ts
  10. 2
      apps/vue/src/views/messages/notifications/datas/TableData.ts
  11. 2
      apps/vue/src/views/saas/tenant/components/TenantTable.vue
  12. 25
      aspnet-core/migrate-database.bat
  13. 17
      aspnet-core/migrate-db-cmd.bat
  14. 11
      aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs
  15. 9
      aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs
  16. 7
      aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs
  17. 7
      aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs
  18. 2
      aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ILanguageAppService.cs
  19. 2
      aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/IResourceAppService.cs
  20. 17
      aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs
  21. 4
      aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageController.cs
  22. 14
      aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs
  23. 4
      aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceController.cs
  24. 4
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj
  25. 9
      aspnet-core/modules/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs
  26. 4
      aspnet-core/modules/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN.Abp.Rules.RulesEngine.csproj
  27. 4
      aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN.Abp.TextTemplating.Application.csproj
  28. 2
      aspnet-core/modules/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN.Abp.TuiJuhe.csproj
  29. 4
      aspnet-core/modules/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN/Abp/TuiJuhe/AbpTuiJuheModule.cs
  30. 12
      aspnet-core/modules/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN/Abp/TuiJuhe/TuiJuheResult.cs
  31. 1
      aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/Program.cs
  32. 3
      aspnet-core/services/LY.MicroService.AuthServer/Program.cs
  33. 1
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Program.cs
  34. 1
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/Program.cs
  35. 10
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.Configure.cs
  36. 1
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/Program.cs
  37. 2
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/Program.cs
  38. 1
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/Program.cs
  39. 2
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs
  40. 1
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Program.cs
  41. 14
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.Configure.cs
  42. 1
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Program.cs
  43. 1
      aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/Program.cs
  44. 1
      aspnet-core/services/LY.MicroService.identityServer/Program.cs
  45. 2
      aspnet-core/start-all-service.bat
  46. 5
      aspnet-core/start-http-api-host.bat
  47. 7
      aspnet-core/start-internal-gateway.bat
  48. 1
      aspnet-core/templates/content/host/PackageName.CompanyName.ProjectName.HttpApi.Host/Program.cs
  49. 2
      build/build-aspnetcore-common.ps1
  50. 17
      build/modules.dependencies.json
  51. 83
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Ocelot/Configuration/AutoConfigOcelot.cs
  52. 129
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.aggregate.json
  53. 1268
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.backendadmin.json
  54. 48
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.global.json
  55. 435
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.idsadmin.json
  56. 247
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.localization.json
  57. 714
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.messages.json
  58. 617
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.platform.json
  59. 183
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.task.json
  60. 121
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.webhook.json
  61. 13
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Program.cs
  62. 1895
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.Development.json
  63. 4349
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.json
  64. 26
      starter/00.auto-config-docker.cmd
  65. 4
      starter/01.migrate-db.cmd
  66. 4
      starter/10.start-ids.bat
  67. 4
      starter/11.start-ids-admin.bat
  68. 4
      starter/12.start-localization.bat
  69. 4
      starter/13.start-platform.bat
  70. 4
      starter/14.start-messages.bat
  71. 4
      starter/15.start-task-management.bat
  72. 4
      starter/16.start-webhooks-management.bat
  73. 4
      starter/17.start-workflow-management.bat
  74. 4
      starter/18.start-admin.bat
  75. 4
      starter/70.start-internal-gateway.bat
  76. 9
      starter/80.start-host.cmd
  77. 6
      starter/91.install-node-module.cmd
  78. 5
      starter/99.start-ui.cmd
  79. 8
      starter/readme.md

1
apps/vue/run.bat

@ -1 +1,2 @@
title abp-next-admin-vben
npm run dev npm run dev

5
apps/vue/src/api/localization/languages.ts

@ -1,5 +1,5 @@
import { defAbpHttp } from '/@/utils/http/abp'; import { defAbpHttp } from '/@/utils/http/abp';
import { LanguageListResult, LanguageCreate, LanguageUpdate, Language } from './model/languagesModel'; import { LanguageListResult, LanguageCreate, LanguageUpdate, Language, GetLanguageWithFilter } from './model/languagesModel';
const remoteServiceName = 'LocalizationManagement'; const remoteServiceName = 'LocalizationManagement';
const controllerName = 'Language'; const controllerName = 'Language';
@ -8,9 +8,10 @@ enum Api {
GetList = '/api/abp/localization/languages', GetList = '/api/abp/localization/languages',
} }
export const getList = () => { export const getList = (input: GetLanguageWithFilter) => {
return defAbpHttp.get<LanguageListResult>({ return defAbpHttp.get<LanguageListResult>({
url: Api.GetList, url: Api.GetList,
params: input,
}); });
}; };

4
apps/vue/src/api/localization/model/languagesModel.ts

@ -26,3 +26,7 @@ export interface LanguagePagedResult extends PagedResultDto<Language> {}
export interface GetLanguagePagedRequest extends PagedAndSortedResultRequestDto { export interface GetLanguagePagedRequest extends PagedAndSortedResultRequestDto {
filter?: string; filter?: string;
} }
export interface GetLanguageWithFilter {
filter?: string;
}

4
apps/vue/src/api/localization/model/resourcesModel.ts

@ -26,3 +26,7 @@ export interface ResourcePagedResult extends PagedResultDto<Resource> {}
export interface GetResourcePagedRequest extends PagedAndSortedResultRequestDto { export interface GetResourcePagedRequest extends PagedAndSortedResultRequestDto {
filter?: string; filter?: string;
} }
export interface GetResourceWithFilter {
filter?: string;
}

5
apps/vue/src/api/localization/resources.ts

@ -1,5 +1,5 @@
import { defAbpHttp } from '/@/utils/http/abp'; import { defAbpHttp } from '/@/utils/http/abp';
import { ResourceListResult, Resource, ResourceCreate, ResourceUpdate } from './model/resourcesModel'; import { ResourceListResult, Resource, ResourceCreate, ResourceUpdate, GetResourceWithFilter } from './model/resourcesModel';
const remoteServiceName = 'LocalizationManagement'; const remoteServiceName = 'LocalizationManagement';
const controllerName = 'Resource'; const controllerName = 'Resource';
@ -8,9 +8,10 @@ enum Api {
GetList = '/api/abp/localization/resources', GetList = '/api/abp/localization/resources',
} }
export const getList = () => { export const getList = (input: GetResourceWithFilter) => {
return defAbpHttp.get<ResourceListResult>({ return defAbpHttp.get<ResourceListResult>({
url: Api.GetList, url: Api.GetList,
params: input,
}); });
}; };

3
apps/vue/src/utils/http/axios/index.ts

@ -136,6 +136,9 @@ const transform: AxiosTransform = {
if ((config as Recordable)?.requestOptions?.withAcceptLanguage !== false) { if ((config as Recordable)?.requestOptions?.withAcceptLanguage !== false) {
const localeStore = useLocaleStoreWithOut(); const localeStore = useLocaleStoreWithOut();
config.headers['Accept-Language'] = localeStore.getLocale; config.headers['Accept-Language'] = localeStore.getLocale;
if (config.headers['Accept-Language'] == 'zh_CN') {
config.headers['Accept-Language'] = 'zh-Hans';
}
} }
return config; return config;
}, },

4
apps/vue/src/views/localization/languages/components/LanguageTable.vue

@ -89,8 +89,8 @@
function fetchLanguages() { function fetchLanguages() {
const form = getForm(); const form = getForm();
return form.validate().then(() => { return form.validate().then((input) => {
return getList().then((res) => { return getList(input).then((res) => {
setTableData(res.items); setTableData(res.items);
}); });
}); });

8
apps/vue/src/views/localization/resources/components/ResourceTable.vue

@ -47,7 +47,9 @@
import { getList, GetAsyncByName, DeleteAsyncByName } from '/@/api/localization/resources'; import { getList, GetAsyncByName, DeleteAsyncByName } from '/@/api/localization/resources';
import { Resource } from '/@/api/localization/model/resourcesModel'; import { Resource } from '/@/api/localization/model/resourcesModel';
import { getDataColumns } from './TableData'; import { getDataColumns } from './TableData';
import { reactive } from 'vue';
import ResourceModal from './ResourceModal.vue'; import ResourceModal from './ResourceModal.vue';
const { createConfirm, createMessage } = useMessage(); const { createConfirm, createMessage } = useMessage();
const { L } = useLocalization(['LocalizationManagement', 'AbpLocalization', 'AbpUi']); const { L } = useLocalization(['LocalizationManagement', 'AbpLocalization', 'AbpUi']);
@ -72,7 +74,7 @@
component: 'Input', component: 'Input',
label: L('Search'), label: L('Search'),
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: '', defaultValue: ''
}, },
], ],
submitFunc: fetchResources, submitFunc: fetchResources,
@ -87,8 +89,8 @@
function fetchResources() { function fetchResources() {
const form = getForm(); const form = getForm();
return form.validate().then(() => { return form.validate().then((input) => {
return getList().then((res) => { return getList(input).then((res) => {
setTableData(res.items); setTableData(res.items);
}); });
}); });

2
apps/vue/src/views/messages/notifications/datas/ModalData.ts

@ -2,7 +2,7 @@ import { useLocalization } from '/@/hooks/abp/useLocalization';
import { FormProps } from '/@/components/Form'; import { FormProps } from '/@/components/Form';
import { NotificationReadState } from '/@/api/messages/model/notificationsModel'; import { NotificationReadState } from '/@/api/messages/model/notificationsModel';
const { L } = useLocalization(['AbpMessageService', 'AbpUi']); const { L } = useLocalization(['AbpMessageService', 'Notifications', 'AbpUi']);
export function getSearchFormSchemas(): Partial<FormProps> { export function getSearchFormSchemas(): Partial<FormProps> {
return { return {

2
apps/vue/src/views/messages/notifications/datas/TableData.ts

@ -2,7 +2,7 @@ import { useLocalization } from '/@/hooks/abp/useLocalization';
import { BasicColumn } from '/@/components/Table'; import { BasicColumn } from '/@/components/Table';
import { formatToDateTime } from '/@/utils/dateUtil'; import { formatToDateTime } from '/@/utils/dateUtil';
const { L } = useLocalization('AbpMessageService'); const { L } = useLocalization('Notifications');
export function getDataColumns(): BasicColumn[] { export function getDataColumns(): BasicColumn[] {
return [ return [

2
apps/vue/src/views/saas/tenant/components/TenantTable.vue

@ -73,7 +73,7 @@
import TenantModal from './TenantModal.vue'; import TenantModal from './TenantModal.vue';
import ConnectionTableModal from './ConnectionTableModal.vue'; import ConnectionTableModal from './ConnectionTableModal.vue';
const { L } = useLocalization(['AbpSaas', 'AbpFeatureManagement']); const { L } = useLocalization(['AbpSaas', 'AbpFeatureManagement','WeChat']);
const { hasPermission } = usePermission(); const { hasPermission } = usePermission();
const tableElRef = ref<Nullable<TableActionType>>(null); const tableElRef = ref<Nullable<TableActionType>>(null);
const [registerConnectModal, { openModal: openConnectModal }] = useModal(); const [registerConnectModal, { openModal: openConnectModal }] = useModal();

25
aspnet-core/migrate-database.bat

@ -1,19 +1,12 @@
@echo off @echo off
cls cls
set stime=8
start .\migrate-db-cmd.bat LY.MicroService.BackendAdmin.DbMigrator admin --run call .\migrate-db-cmd.bat LY.MicroService.BackendAdmin.DbMigrator admin --run
ping -n %stime% 127.1 >nul call .\migrate-db-cmd.bat LY.MicroService.AuthServer.DbMigrator auth-server --run
start .\migrate-db-cmd.bat LY.MicroService.AuthServer.DbMigrator auth-server --run call .\migrate-db-cmd.bat LY.MicroService.IdentityServer.DbMigrator identityserver4-admin --run
ping -n %stime% 127.1 >nul call .\migrate-db-cmd.bat LY.MicroService.LocalizationManagement.DbMigrator localization --run
start .\migrate-db-cmd.bat LY.MicroService.IdentityServer.DbMigrator identityserver4-admin --run call .\migrate-db-cmd.bat LY.MicroService.Platform.DbMigrator platform --run
ping -n %stime% 127.1 >nul call .\migrate-db-cmd.bat LY.MicroService.RealtimeMessage.DbMigrator messages --run
start .\migrate-db-cmd.bat LY.MicroService.LocalizationManagement.DbMigrator localization --run call .\migrate-db-cmd.bat LY.MicroService.TaskManagement.DbMigrator task-management --run
ping -n %stime% 127.1 >nul call .\migrate-db-cmd.bat LY.MicroService.WebhooksManagement.DbMigrator webhooks-management --run
start .\migrate-db-cmd.bat LY.MicroService.Platform.DbMigrator platform --run pause
ping -n %stime% 127.1 >nul
start .\migrate-db-cmd.bat LY.MicroService.RealtimeMessage.DbMigrator messages --run
ping -n %stime% 127.1 >nul
start .\migrate-db-cmd.bat LY.MicroService.TaskManagement.DbMigrator task-management --run
ping -n %stime% 127.1 >nul
start .\migrate-db-cmd.bat LY.MicroService.WebhooksManagement.DbMigrator webhooks-management --run

17
aspnet-core/migrate-db-cmd.bat

@ -1,10 +1,9 @@
@echo off @echo off
cls
chcp 65001 chcp 65001
title %2 title %2
@echo %2 migration running @echo %2 migrating
cd .\migrations\%1 cd .\migrations\%1
@ -15,14 +14,18 @@ if '%3' equ '' goto run
exit exit
:run :run
dotnet run dotnet run
pause goto end
exit
:restore :restore
dotnet restore dotnet restore
exit goto end
:efu :efu
dotnet ef databse update dotnet ef databse update
exit goto end
:end
cd ..\..\
@echo %2 migrated
@echo --------

11
aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs

@ -41,6 +41,9 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
protected IUserGroupStore UserGroupStore => LazyServiceProvider.LazyGetRequiredService<IUserGroupStore>(); protected IUserGroupStore UserGroupStore => LazyServiceProvider.LazyGetRequiredService<IUserGroupStore>();
protected AbpExceptionHandlingOptions ExceptionHandlingOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpExceptionHandlingOptions>>().Value;
public override async Task OnConnectedAsync() public override async Task OnConnectedAsync()
{ {
await base.OnConnectedAsync(); await base.OnConnectedAsync();
@ -167,8 +170,8 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
{ {
var errorInfo = ErrorInfoConverter.Convert(ex, options => var errorInfo = ErrorInfoConverter.Convert(ex, options =>
{ {
options.SendExceptionsDetailsToClients = false; options.SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients;
options.SendStackTraceToClients = false; options.SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients;
}); });
await SendMessageAsync( await SendMessageAsync(
@ -230,8 +233,8 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
{ {
var errorInfo = ErrorInfoConverter.Convert(ex, options => var errorInfo = ErrorInfoConverter.Convert(ex, options =>
{ {
options.SendExceptionsDetailsToClients = false; options.SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients;
options.SendStackTraceToClients = false; options.SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients;
}); });
if (!chatMessage.GroupId.IsNullOrWhiteSpace()) if (!chatMessage.GroupId.IsNullOrWhiteSpace())
{ {

9
aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs

@ -19,14 +19,17 @@ namespace LINGYUN.Abp.IM.SignalR.Messages
private readonly AbpIMSignalROptions _options; private readonly AbpIMSignalROptions _options;
private readonly IHubContext<MessagesHub> _hubContext; private readonly IHubContext<MessagesHub> _hubContext;
private readonly AbpExceptionHandlingOptions _exceptionHandlingOptions;
public SignalRMessageSenderProvider( public SignalRMessageSenderProvider(
IHubContext<MessagesHub> hubContext, IHubContext<MessagesHub> hubContext,
IAbpLazyServiceProvider serviceProvider, IAbpLazyServiceProvider serviceProvider,
IOptions<AbpIMSignalROptions> options) IOptions<AbpIMSignalROptions> options,
IOptions<AbpExceptionHandlingOptions> exceptionHandlingOptions)
: base(serviceProvider) : base(serviceProvider)
{ {
_options = options.Value; _options = options.Value;
_exceptionHandlingOptions = exceptionHandlingOptions.Value;
_hubContext = hubContext; _hubContext = hubContext;
} }
@ -99,8 +102,8 @@ namespace LINGYUN.Abp.IM.SignalR.Messages
{ {
var errorInfo = errorInfoConverter.Convert(ex, options => var errorInfo = errorInfoConverter.Convert(ex, options =>
{ {
options.SendExceptionsDetailsToClients = false; options.SendExceptionsDetailsToClients = _exceptionHandlingOptions.SendExceptionsDetailsToClients;
options.SendStackTraceToClients = false; options.SendStackTraceToClients = _exceptionHandlingOptions.SendStackTraceToClients;
}); });
if (!chatMessage.GroupId.IsNullOrWhiteSpace()) if (!chatMessage.GroupId.IsNullOrWhiteSpace())
{ {

7
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs

@ -0,0 +1,7 @@
namespace LINGYUN.Abp.AspNetCore.Mvc.Localization
{
public class GetLanguageWithFilterDto
{
public string Filter { get; set; }
}
}

7
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs

@ -0,0 +1,7 @@
namespace LINGYUN.Abp.AspNetCore.Mvc.Localization
{
public class GetResourceWithFilterDto
{
public string Filter { get; set; }
}
}

2
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ILanguageAppService.cs

@ -6,6 +6,6 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Localization
{ {
public interface ILanguageAppService : IApplicationService public interface ILanguageAppService : IApplicationService
{ {
Task<ListResultDto<LanguageDto>> GetListAsync(); Task<ListResultDto<LanguageDto>> GetListAsync(GetLanguageWithFilterDto input);
} }
} }

2
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/IResourceAppService.cs

@ -6,6 +6,6 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Localization
{ {
public interface IResourceAppService : IApplicationService public interface IResourceAppService : IApplicationService
{ {
Task<ListResultDto<ResourceDto>> GetListAsync(); Task<ListResultDto<ResourceDto>> GetListAsync(GetResourceWithFilterDto input);
} }
} }

17
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs

@ -1,9 +1,17 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using System.Linq; using Microsoft.Extensions.Options;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Volo.Abp;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Localization.External;
namespace LINGYUN.Abp.AspNetCore.Mvc.Localization namespace LINGYUN.Abp.AspNetCore.Mvc.Localization
{ {
@ -16,9 +24,12 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Localization
_languageProvider = languageProvider; _languageProvider = languageProvider;
} }
public async virtual Task<ListResultDto<LanguageDto>> GetListAsync() public async virtual Task<ListResultDto<LanguageDto>> GetListAsync(GetLanguageWithFilterDto input)
{ {
var languages = await _languageProvider.GetLanguagesAsync(); var languages = (await _languageProvider.GetLanguagesAsync())
.WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.CultureName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0
|| x.UiCultureName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0
|| x.DisplayName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0);
return new ListResultDto<LanguageDto>( return new ListResultDto<LanguageDto>(
languages.Select(l => new LanguageDto languages.Select(l => new LanguageDto

4
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageController.cs

@ -19,9 +19,9 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Localization
} }
[HttpGet] [HttpGet]
public virtual Task<ListResultDto<LanguageDto>> GetListAsync() public virtual Task<ListResultDto<LanguageDto>> GetListAsync(GetLanguageWithFilterDto input)
{ {
return _service.GetListAsync(); return _service.GetListAsync(input);
} }
} }
} }

14
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs

@ -1,6 +1,12 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using System.Linq; using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Volo.Abp;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
@ -23,12 +29,14 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Localization
_externalLocalizationStore = externalLocalizationStore; _externalLocalizationStore = externalLocalizationStore;
} }
public virtual async Task<ListResultDto<ResourceDto>> GetListAsync() public virtual async Task<ListResultDto<ResourceDto>> GetListAsync(GetResourceWithFilterDto input)
{ {
var externalResources = await _externalLocalizationStore.GetResourcesAsync(); var externalResources = (await _externalLocalizationStore.GetResourcesAsync())
.WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0);
var resources = _localizationOptions var resources = _localizationOptions
.Resources .Resources
.WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.Value.ResourceName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0)
.Select(x => new ResourceDto .Select(x => new ResourceDto
{ {
Name = x.Value.ResourceName, Name = x.Value.ResourceName,

4
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceController.cs

@ -19,9 +19,9 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Localization
} }
[HttpGet] [HttpGet]
public virtual Task<ListResultDto<ResourceDto>> GetListAsync() public virtual Task<ListResultDto<ResourceDto>> GetListAsync(GetResourceWithFilterDto input)
{ {
return _service.GetListAsync(); return _service.GetListAsync(input);
} }
} }
} }

4
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj

@ -8,10 +8,6 @@
<RootNamespace /> <RootNamespace />
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\Notifications\DynamicNotificationDefinitionStore.cs~RF299208b7.TMP" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Caching" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Caching" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(VoloAbpPackageVersion)" />

9
aspnet-core/modules/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs

@ -26,17 +26,20 @@ namespace LINGYUN.Abp.OpenApi.Authorization
private readonly AbpOpenApiOptions _openApiOptions; private readonly AbpOpenApiOptions _openApiOptions;
private readonly ICurrentClient _currentClient; private readonly ICurrentClient _currentClient;
private readonly IWebClientInfoProvider _clientInfoProvider; private readonly IWebClientInfoProvider _clientInfoProvider;
private readonly AbpExceptionHandlingOptions _exceptionHandlingOptions;
public OpenApiAuthorizationService( public OpenApiAuthorizationService(
IAppKeyStore appKeyStore, IAppKeyStore appKeyStore,
ICurrentClient currentClient, ICurrentClient currentClient,
IWebClientInfoProvider clientInfoProvider, IWebClientInfoProvider clientInfoProvider,
IOptionsMonitor<AbpOpenApiOptions> options) IOptionsMonitor<AbpOpenApiOptions> options,
IOptions<AbpExceptionHandlingOptions> exceptionHandlingOptions)
{ {
_appKeyStore = appKeyStore; _appKeyStore = appKeyStore;
_currentClient = currentClient; _currentClient = currentClient;
_clientInfoProvider = clientInfoProvider; _clientInfoProvider = clientInfoProvider;
_openApiOptions = options.CurrentValue; _openApiOptions = options.CurrentValue;
_exceptionHandlingOptions = exceptionHandlingOptions.Value;
} }
public async virtual Task<bool> AuthorizeAsync(HttpContext httpContext) public async virtual Task<bool> AuthorizeAsync(HttpContext httpContext)
@ -177,8 +180,8 @@ namespace LINGYUN.Abp.OpenApi.Authorization
var errorInfoConverter = context.RequestServices.GetRequiredService<IExceptionToErrorInfoConverter>(); var errorInfoConverter = context.RequestServices.GetRequiredService<IExceptionToErrorInfoConverter>();
var errorInfo = errorInfoConverter.Convert(exception, options => var errorInfo = errorInfoConverter.Convert(exception, options =>
{ {
options.SendExceptionsDetailsToClients = false; options.SendExceptionsDetailsToClients = _exceptionHandlingOptions.SendExceptionsDetailsToClients;
options.SendStackTraceToClients = false; options.SendStackTraceToClients = _exceptionHandlingOptions.SendStackTraceToClients;
}); });
if (context.Request.CanAccept(MimeTypes.Application.Json) || if (context.Request.CanAccept(MimeTypes.Application.Json) ||

4
aspnet-core/modules/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN.Abp.Rules.RulesEngine.csproj

@ -8,10 +8,6 @@
<RootNamespace /> <RootNamespace />
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\Rules\RulesEngine\IWorkflowsResolver.cs~RF3e2c1c6.TMP" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="RulesEngine" Version="4.0.0" /> <PackageReference Include="RulesEngine" Version="4.0.0" />
<PackageReference Include="Volo.Abp.Json" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Json" Version="$(VoloAbpPackageVersion)" />

4
aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN.Abp.TextTemplating.Application.csproj

@ -8,10 +8,6 @@
<RootNamespace /> <RootNamespace />
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\TextTemplating\TextTemplateDefinitionAppService.cs~RF1f4f741d.TMP" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Ddd.Application" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.AutoMapper" Version="$(VoloAbpPackageVersion)" />

2
aspnet-core/modules/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN.Abp.TuiJuhe.csproj

@ -18,7 +18,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Caching" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Caching" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Json.Newtonsoft" Version="$(VoloAbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Json.SystemTextJson" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Http" Version="$(MicrosoftPackageVersion)" /> <PackageReference Include="Microsoft.Extensions.Http" Version="$(MicrosoftPackageVersion)" />
</ItemGroup> </ItemGroup>

4
aspnet-core/modules/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN/Abp/TuiJuhe/AbpTuiJuheModule.cs

@ -2,7 +2,7 @@
using LINGYUN.Abp.TuiJuhe.Localization; using LINGYUN.Abp.TuiJuhe.Localization;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.Json.Newtonsoft; using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Settings; using Volo.Abp.Settings;
@ -11,7 +11,7 @@ using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.TuiJuhe; namespace LINGYUN.Abp.TuiJuhe;
[DependsOn( [DependsOn(
typeof(AbpJsonNewtonsoftModule), typeof(AbpJsonSystemTextJsonModule),
typeof(AbpSettingsModule), typeof(AbpSettingsModule),
typeof(AbpCachingModule), typeof(AbpCachingModule),
typeof(AbpFeaturesLimitValidationModule))] typeof(AbpFeaturesLimitValidationModule))]

12
aspnet-core/modules/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN/Abp/TuiJuhe/TuiJuheResult.cs

@ -1,5 +1,5 @@
using Newtonsoft.Json; using System;
using System; using System.Text.Json.Serialization;
namespace LINGYUN.Abp.TuiJuhe; namespace LINGYUN.Abp.TuiJuhe;
@ -9,22 +9,22 @@ public class TuiJuheResult<TParam, TResult>
/// <summary> /// <summary>
/// 状态码 /// 状态码
/// </summary> /// </summary>
[JsonProperty("code")] [JsonPropertyName("code")]
public int Code { get; set; } public int Code { get; set; }
/// <summary> /// <summary>
/// 错误消息 /// 错误消息
/// </summary> /// </summary>
[JsonProperty("reason")] [JsonPropertyName("reason")]
public string Reason { get; set; } public string Reason { get; set; }
/// <summary> /// <summary>
/// 响应数据 /// 响应数据
/// </summary> /// </summary>
[JsonProperty("result")] [JsonPropertyName("result")]
public TResult Result { get; set; } public TResult Result { get; set; }
/// <summary> /// <summary>
/// 响应参数 /// 响应参数
/// </summary> /// </summary>
[JsonProperty("params")] [JsonPropertyName("params")]
public TParam Params { get; set; } public TParam Params { get; set; }
[JsonIgnore] [JsonIgnore]

1
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/Program.cs

@ -18,6 +18,7 @@ public class Program
{ {
try try
{ {
Console.Title = "IdentityServer.HttpApi.Host";
Log.Information("Starting IdentityServer.HttpApi.Host."); Log.Information("Starting IdentityServer.HttpApi.Host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

3
aspnet-core/services/LY.MicroService.AuthServer/Program.cs

@ -18,8 +18,9 @@ public class Program
{ {
try try
{ {
Console.Title = "IdentityServer";
Log.Information("Starting IdentityServer."); Log.Information("Starting IdentityServer.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson() builder.Host.AddAppSettingsSecretsJson()
.UseAutofac() .UseAutofac()

1
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Program.cs

@ -18,6 +18,7 @@ public class Program
{ {
try try
{ {
Console.Title = "BackendAdmin.Host";
Log.Information("Starting BackendAdmin.Host."); Log.Information("Starting BackendAdmin.Host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

1
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/Program.cs

@ -18,6 +18,7 @@ public class Program
{ {
try try
{ {
Console.Title = "LocalizationManagement.HttpApi.Host";
Log.Information("Starting LocalizationManagement.HttpApi.Host."); Log.Information("Starting LocalizationManagement.HttpApi.Host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

10
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.Configure.cs

@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.Caching.StackExchangeRedis; using Microsoft.Extensions.Caching.StackExchangeRedis;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using StackExchange.Redis; using StackExchange.Redis;
using System; using System;
@ -164,10 +165,11 @@ public partial class PlatformManagementHttpApiHostModule
}); });
Configure<Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingOptions>(options => Configure<Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingOptions>(options =>
{ {
// 是否发送错误详情 // 是否发送错误详情
options.SendExceptionsDetailsToClients = false; options.SendExceptionsDetailsToClients = true;
}); options.SendStackTraceToClients = true;
});
} }
private void ConfigureAuditing(IConfiguration configuration) private void ConfigureAuditing(IConfiguration configuration)

1
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/Program.cs

@ -18,6 +18,7 @@ public class Program
{ {
try try
{ {
Console.Title = "PlatformManagement.HttpApi.Host";
Log.Information("Starting PlatformManagement.HttpApi.Host."); Log.Information("Starting PlatformManagement.HttpApi.Host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

2
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/Program.cs

@ -18,8 +18,8 @@ public class Program
{ {
try try
{ {
Console.Title = "RealtimeMessage.HttpApi.Host";
Log.Information("Starting RealtimeMessage.HttpApi.Host."); Log.Information("Starting RealtimeMessage.HttpApi.Host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson() builder.Host.AddAppSettingsSecretsJson()
.UseAutofac() .UseAutofac()

1
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/Program.cs

@ -18,6 +18,7 @@ public class Program
{ {
try try
{ {
Console.Title = "TaskManagement.HttpApi.Host";
Log.Information("Starting TaskManagement.HttpApi.Host."); Log.Information("Starting TaskManagement.HttpApi.Host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

2
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs

@ -251,7 +251,7 @@ public partial class TaskManagementHttpApiHostModule
services.AddSwaggerGen( services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new OpenApiInfo { Title = "WorkflowManagement API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "TaskManagement API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme

1
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Program.cs

@ -18,6 +18,7 @@ public class Program
{ {
try try
{ {
Console.Title = "Web.Host";
Log.Information("Starting web host."); Log.Information("Starting web host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

14
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.Configure.cs

@ -2,6 +2,7 @@
using LINGYUN.Abp.BackgroundTasks; using LINGYUN.Abp.BackgroundTasks;
using LINGYUN.Abp.ExceptionHandling; using LINGYUN.Abp.ExceptionHandling;
using LINGYUN.Abp.ExceptionHandling.Emailing; using LINGYUN.Abp.ExceptionHandling.Emailing;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.Serilog.Enrichers.Application; using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Webhooks; using LINGYUN.Abp.Webhooks;
@ -358,6 +359,19 @@ public partial class WebhooksManagementHttpApiHostModule
options.UsePersistence<WebhooksManagementResource>(); options.UsePersistence<WebhooksManagementResource>();
}); });
Configure<AbpLocalizationCultureMapOptions>(options =>
{
var zhHansCultureMapInfo = new CultureMapInfo
{
TargetCulture = "zh-Hans",
SourceCultures = new string[] { "zh", "zh_CN", "zh-CN" }
};
options.CulturesMaps.Add(zhHansCultureMapInfo);
options.UiCulturesMaps.Add(zhHansCultureMapInfo);
});
} }
private void ConfigureSecurity(IServiceCollection services, IConfiguration configuration, bool isDevelopment = false) private void ConfigureSecurity(IServiceCollection services, IConfiguration configuration, bool isDevelopment = false)

1
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Program.cs

@ -18,6 +18,7 @@ public class Program
{ {
try try
{ {
Console.Title = "WorkflowManagement.HttpApi.Host";
Log.Information("Starting WorkflowManagement.HttpApi.Host."); Log.Information("Starting WorkflowManagement.HttpApi.Host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

1
aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/Program.cs

@ -18,6 +18,7 @@ public class Program
{ {
try try
{ {
Console.Title = "IdentityServer.HttpApi.Host";
Log.Information("Starting IdentityServer.HttpApi.Host."); Log.Information("Starting IdentityServer.HttpApi.Host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

1
aspnet-core/services/LY.MicroService.identityServer/Program.cs

@ -18,6 +18,7 @@ public class Program
{ {
try try
{ {
Console.Title = "IdentityServer";
Log.Information("Starting IdentityServer."); Log.Information("Starting IdentityServer.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

2
aspnet-core/start-all-service.bat

@ -16,8 +16,6 @@ start .\start-http-api-host.bat LY.MicroService.TaskManagement.HttpApi.Host task
ping -n %stime% 127.1 >nul ping -n %stime% 127.1 >nul
start .\start-http-api-host.bat LY.MicroService.WebhooksManagement.HttpApi.Host webhooks-management--run start .\start-http-api-host.bat LY.MicroService.WebhooksManagement.HttpApi.Host webhooks-management--run
ping -n %stime% 127.1 >nul ping -n %stime% 127.1 >nul
start .\start-http-api-host.bat LY.MicroService.RealtimeMessage.HttpApi.Host realtime-message --run
ping -n %stime% 127.1 >nul
start .\start-http-api-host.bat LY.MicroService.WorkflowManagement.HttpApi.Host workflow-management --run start .\start-http-api-host.bat LY.MicroService.WorkflowManagement.HttpApi.Host workflow-management --run
ping -n %stime% 127.1 >nul ping -n %stime% 127.1 >nul
start .\start-http-api-host.bat LY.MicroService.BackendAdmin.HttpApi.Host admin --run start .\start-http-api-host.bat LY.MicroService.BackendAdmin.HttpApi.Host admin --run

5
aspnet-core/start-http-api-host.bat

@ -8,6 +8,7 @@ title %2-host
cd .\services\%1 cd .\services\%1
if '%3' equ '--publish' goto publish if '%3' equ '--publish' goto publish
if '%3' equ '--watchrun' goto watchrun
if '%3' equ '--run' goto run if '%3' equ '--run' goto run
if '%3' equ '--restore' goto restore if '%3' equ '--restore' goto restore
if '%3' equ '--ef-u' goto efu if '%3' equ '--ef-u' goto efu
@ -23,6 +24,10 @@ exit
dotnet run dotnet run
exit exit
:watchrun
dotnet watch run --no-restore
exit
:restore :restore
dotnet restore dotnet restore
exit exit

7
aspnet-core/start-internal-gateway.bat

@ -2,12 +2,15 @@
cls cls
chcp 65001 chcp 65001
title internal-apigateway
echo. 启动内部网关 echo. 启动内部网关
cd ..\gateways\internal\LINGYUN.MicroService.Internal.ApiGateway\src\LINGYUN.MicroService.Internal.ApiGateway\ cd ..\gateways\internal\LINGYUN.MicroService.Internal.ApiGateway\src\LINGYUN.MicroService.Internal.ApiGateway\
if '%1' equ '--publish' goto publish if '%1' equ '--publish' goto publish
if '%1' equ '--run' goto run if '%1' equ '--run' goto run
if '%1' equ '--watchrun' goto watchrun
if '%1' equ '--restore' goto restore if '%1' equ '--restore' goto restore
if '%1' equ '' goto run if '%1' equ '' goto run
exit exit
@ -21,6 +24,10 @@ exit
dotnet run dotnet run
exit exit
:watchrun
dotnet watch run --no-restore
exit
:restore :restore
dotnet restore dotnet restore
exit exit

1
aspnet-core/templates/content/host/PackageName.CompanyName.ProjectName.HttpApi.Host/Program.cs

@ -19,6 +19,7 @@ public class Program
{ {
try try
{ {
Console.Title = "Web.Host";
Log.Information("Starting web host."); Log.Information("Starting web host.");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

2
build/build-aspnetcore-common.ps1

@ -14,6 +14,8 @@ $serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.
$serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/"; Service = "platform" } $serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/"; Service = "platform" }
$serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/"; Service = "messages" } $serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/"; Service = "messages" }
$serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/"; Service = "task-management" } $serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/"; Service = "task-management" }
$serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/"; Service = "webhooks" }
$serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/"; Service = "workflow" }
$serviceArray += [PsObject]@{ Path = $rootFolder + "/../gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/"; Service = "internal-apigateway" } $serviceArray += [PsObject]@{ Path = $rootFolder + "/../gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/"; Service = "internal-apigateway" }
[PsObject[]]$solutionArray = @() [PsObject[]]$solutionArray = @()

17
build/modules.dependencies.json

@ -1,6 +1,6 @@
[ [
{ {
"tag": "net6.0", "tag": "net7.0",
"dependencies": [ "dependencies": [
{ {
"service": "Backend-Admin", "service": "Backend-Admin",
@ -26,7 +26,10 @@
"LINGYUN.Platform.Domain.Shared.dll", "LINGYUN.Platform.Domain.Shared.dll",
"LINGYUN.Abp.Tencent.dll", "LINGYUN.Abp.Tencent.dll",
"LINGYUN.Abp.Tencent.QQ.dll", "LINGYUN.Abp.Tencent.QQ.dll",
"LINGYUN.Abp.Tencent.SettingManagement.dll" "LINGYUN.Abp.Tencent.SettingManagement.dll",
"LINGYUN.Abp.WxPusher.SettingManagement.dll",
"LINGYUN.Abp.PushPlus.SettingManagement.dll",
"LINGYUN.Abp.TuiJuhe.SettingManagement.dll"
] ]
}, },
{ {
@ -43,8 +46,7 @@
"Volo.Abp.Users.Domain.Shared.dll", "Volo.Abp.Users.Domain.Shared.dll",
"Volo.Abp.Users.Abstractions.dll", "Volo.Abp.Users.Abstractions.dll",
"LINGYUN.Abp.IdentityServer.Application.Contracts.dll", "LINGYUN.Abp.IdentityServer.Application.Contracts.dll",
"Volo.Abp.IdentityServer.Domain.Shared.dll", "Volo.Abp.IdentityServer.Domain.Shared.dll"
"Volo.Abp.Json.Newtonsoft.dll"
] ]
} }
] ]
@ -60,8 +62,6 @@
"LINGYUN.Abp.Account.Templates.dll", "LINGYUN.Abp.Account.Templates.dll",
"LINGYUN.Abp.Features.LimitValidation.dll", "LINGYUN.Abp.Features.LimitValidation.dll",
"LINGYUN.Abp.Features.LimitValidation.Redis.dll", "LINGYUN.Abp.Features.LimitValidation.Redis.dll",
"LINGYUN.Abp.WorkflowManagement.Application.Contracts.dll",
"LINGYUN.Abp.WorkflowManagement.Domain.Shared.dll",
"LINGYUN.Abp.BackgroundTasks.Abstractions.dll", "LINGYUN.Abp.BackgroundTasks.Abstractions.dll",
"LINGYUN.Linq.Dynamic.Queryable.dll", "LINGYUN.Linq.Dynamic.Queryable.dll",
"LINGYUN.Abp.Dynamic.Queryable.Application.Contracts.dll", "LINGYUN.Abp.Dynamic.Queryable.Application.Contracts.dll",
@ -69,7 +69,10 @@
"LINGYUN.Abp.TaskManagement.Domain.Shared.dll", "LINGYUN.Abp.TaskManagement.Domain.Shared.dll",
"LINGYUN.Abp.Notifications.Core.dll", "LINGYUN.Abp.Notifications.Core.dll",
"LINGYUN.Abp.Notifications.Common.dll", "LINGYUN.Abp.Notifications.Common.dll",
"LINGYUN.Abp.Notifications.dll" "LINGYUN.Abp.Notifications.dll",
"LINGYUN.Abp.PushPlus.dll",
"LINGYUN.Abp.WxPusher.dll",
"LINGYUN.Abp.TuiJuhe.dll"
] ]
} }
] ]

83
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Ocelot/Configuration/AutoConfigOcelot.cs

@ -0,0 +1,83 @@

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using Castle.Core.Logging;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Memory;
using Newtonsoft.Json;
using Ocelot.Configuration.File;
using Serilog;
using Serilog.Core;
namespace Ocelot.DependencyInjection
{
public static class ConfigurationBuilderExtensions
{
public static IConfigurationBuilder AddAutoOcelotConfig(this IConfigurationBuilder builder, IWebHostEnvironment env)
{
return builder.AddAutoOcelotConfig(".", env);
}
static object locker = new object();
public static IConfigurationBuilder AddAutoOcelotConfig(this IConfigurationBuilder builder, string folder, IWebHostEnvironment env)
{
WriteFile(folder, env);
Action<object, FileSystemEventArgs> fileChanged = (sender, e) =>
{
lock (locker)
{
Log.Debug("Ocelot config regenerate...");
Thread.Sleep(100); //解决vs文件保存时多次触发change事件时引起异常
WriteFile(folder, env);
}
};
FileSystemWatcher watcher = new FileSystemWatcher("OcelotConfig", "*.json");
watcher.Changed += new FileSystemEventHandler(fileChanged);
watcher.Deleted += new FileSystemEventHandler(fileChanged);
watcher.Created += new FileSystemEventHandler(fileChanged);
watcher.Renamed += new RenamedEventHandler(fileChanged);
watcher.EnableRaisingEvents = true;
builder.AddJsonFile("ocelot.json", optional: true, reloadOnChange: true);
return builder;
}
private static void WriteFile(string folder, IWebHostEnvironment env)
{
string excludeConfigName = ((env != null && env.EnvironmentName != null) ? ("ocelot." + env.EnvironmentName + ".json") : string.Empty);
Regex reg = new Regex("^ocelot\\.(.*?)\\.json$", RegexOptions.IgnoreCase | RegexOptions.Singleline);
List<FileInfo> list = (from fi in new DirectoryInfo(folder).EnumerateFiles()
where reg.IsMatch(fi.Name) && fi.Name != excludeConfigName
select fi).ToList();
FileConfiguration fileConfiguration = new FileConfiguration();
foreach (FileInfo item in list)
{
if (list.Count <= 1 || !item.Name.Equals("ocelot.json", StringComparison.OrdinalIgnoreCase))
{
FileConfiguration fileConfiguration2 = JsonConvert.DeserializeObject<FileConfiguration>(File.ReadAllText(item.FullName));
if (fileConfiguration2 == null)
{
Log.Fatal($"Ocelot config file \"{item.FullName}\" is empty");
}
if (item.Name.Equals("ocelot.global.json", StringComparison.OrdinalIgnoreCase))
{
fileConfiguration.GlobalConfiguration = fileConfiguration2.GlobalConfiguration;
}
fileConfiguration.Aggregates.AddRange(fileConfiguration2.Aggregates);
fileConfiguration.Routes.AddRange(fileConfiguration2.Routes);
}
}
string contents = JsonConvert.SerializeObject(fileConfiguration, Formatting.Indented);
File.WriteAllText("ocelot.json", contents);
}
}
}

129
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.aggregate.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.aggregate.json

@ -1,67 +1,62 @@
{ {
"Aggregates": [ "Aggregates": [
// ̬ۺ {
{ "RouteKeys": [
"RouteKeys": [ "platform-api-definition",
"platform-api-definition", "backend-admin-api-definition",
"backend-admin-api-definition", "messages-api-definition",
"messages-api-definition", "ids-admin-api-definition",
"ids-admin-api-definition", "localization-api-definition",
"localization-api-definition", "task-api-definition",
"task-api-definition", "webhook-api-definition"
"webhook-api-definition" ],
], "UpstreamPathTemplate": "/api/abp/api-definition",
"UpstreamPathTemplate": "/api/abp/api-definition", "Aggregator": "AbpResponseMergeAggregator"
"Aggregator": "AbpResponseMergeAggregator", },
"Priority": 99 {
}, "RouteKeys": [
// þۺ "platform-configuration",
{ "backend-admin-configuration",
"RouteKeys": [ "messages-configuration",
"platform-configuration", "ids-admin-configuration",
"backend-admin-configuration", "localization-configuration",
"messages-configuration", "task-configuration"
"ids-admin-configuration", ],
"localization-configuration", "UpstreamPathTemplate": "/api/abp/application-configuration",
"task-configuration" "Aggregator": "AbpResponseMergeAggregator",
], "Priority": 99
"UpstreamPathTemplate": "/api/abp/application-configuration", },
"Aggregator": "AbpResponseMergeAggregator", {
"Priority": 99 "RouteKeys": [
}, "setting-global",
// ȫ "wechat-setting-global",
{ "tencent-cloud-setting-global",
"RouteKeys": [ "aliyun-setting-global",
"setting-global", "oss-management-setting-global"
"wechat-setting-global", ],
"aliyun-setting-global", "UpstreamPathTemplate": "/api/setting-management/settings/by-global",
"oss-management-setting-global" "Aggregator": "AbpResponseMergeAggregator",
], "Priority": 99
"UpstreamPathTemplate": "/api/setting-management/settings/by-global", },
"Aggregator": "AbpResponseMergeAggregator", {
"Priority": 99 "RouteKeys": [
}, "setting-current-tenant",
// "wechat-setting-current-tenant",
{ "tencent-cloud-setting-current-tenant",
"RouteKeys": [ "aliyun-setting-current-tenant",
"setting-current-tenant", "oss-management-setting-current-tenant"
"wechat-setting-current-tenant", ],
"aliyun-setting-current-tenant", "UpstreamPathTemplate": "/api/setting-management/settings/by-current-tenant",
"oss-management-setting-current-tenant" "Aggregator": "AbpResponseMergeAggregator",
], "Priority": 99
"UpstreamPathTemplate": "/api/setting-management/settings/by-current-tenant", },
"Aggregator": "AbpResponseMergeAggregator", {
"Priority": 99 "RouteKeys": [
}, "setting-current-user"
// û ],
{ "UpstreamPathTemplate": "/api/setting-management/settings/by-current-user",
"RouteKeys": [ "Aggregator": "AbpResponseMergeAggregator",
"assignables-notifilers", "Priority": 99
"my-subscribes" }
], ]
"UpstreamPathTemplate": "/api/my-subscribes/assignables-notifilers", }
"Aggregator": "AbpResponseMergeAggregator",
"Priority": 99
}
]
}

1268
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.backendadmin.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.backendadmin.json

File diff suppressed because it is too large

48
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.global.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.global.json

@ -1,24 +1,24 @@
{ {
"GlobalConfiguration": { "GlobalConfiguration": {
"BaseUrl": "http://localhost:30000", "BaseUrl": "http://localhost:30000",
"DownstreamScheme": "HTTP", "DownstreamScheme": "HTTP",
"HttpHandlerOptions": { "HttpHandlerOptions": {
"UseTracing": true "UseTracing": true
}, },
"RateLimitOptions": { "RateLimitOptions": {
"DisableRateLimitHeaders": false, "DisableRateLimitHeaders": false,
"ClientIdHeader": "ClientId", "ClientIdHeader": "ClientId",
"RateLimitCounterPrefix": "ocelot", "RateLimitCounterPrefix": "ocelot",
"QuotaExceededMessage": "您的操作过快,请稍后再试!", "QuotaExceededMessage": "您的操作过快,请稍后再试!",
"HttpStatusCode": 429 "HttpStatusCode": 429
}, },
"QoSOptions": { "QoSOptions": {
"TimeoutValue": 30000, "TimeoutValue": 30000,
"DurationOfBreak": 60000, "DurationOfBreak": 60000,
"ExceptionsAllowedBeforeBreaking": 30 "ExceptionsAllowedBeforeBreaking": 30
}, },
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
} }
} }
} }

435
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.idsadmin.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.idsadmin.json

@ -1,180 +1,255 @@
{ {
"Routes": [ "Routes": [
// //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30015 "Port": 30015
} }
], ],
"UpstreamPathTemplate": "/api/abp/ids-admin/application-configuration", "UpstreamPathTemplate": "/api/abp/ids-admin/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "ids-admin-configuration" "UseTracing": true
}, },
// API "Key": "ids-admin-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30015 {
} "Host": "127.0.0.1",
], "Port": 30015
"UpstreamPathTemplate": "/api/abp/ids-admin/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/ids-admin/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "ids-admin-api-definition" },
}, "HttpHandlerOptions": {
// "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/identity/{everything}", "Key": "ids-admin-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ //
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/identity/{everything}",
"Port": 30015 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/identity/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30015
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/identity/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
}, },
// "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/api/identity-server/{everything}", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {
"Host": "127.0.0.1", "UseTracing": true
"Port": 30015 }
} },
], //
"UpstreamPathTemplate": "/api/identity-server/{everything}", {
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "DownstreamPathTemplate": "/api/identity-server/{everything}",
"LoadBalancerOptions": { "DownstreamScheme": "http",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30015
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/api/identity-server/{everything}",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET",
"QoSOptions": { "POST",
"ExceptionsAllowedBeforeBreaking": 10, "PUT",
"DurationOfBreak": 1000, "DELETE"
"TimeoutValue": 10000 ],
}, "LoadBalancerOptions": {
"HttpHandlerOptions": { "Type": "RoundRobin"
"UseTracing": true },
} "RateLimitOptions": {
}, "ClientWhitelist": [],
// "EnableRateLimiting": true,
{ "Period": "1s",
"DownstreamPathTemplate": "/api/account/{everything}", "PeriodTimespan": 1,
"DownstreamScheme": "http", "Limit": 100
"DownstreamHostAndPorts": [ },
{ "QoSOptions": {
"Host": "127.0.0.1", "ExceptionsAllowedBeforeBreaking": 10,
"Port": 30015 "DurationOfBreak": 1000,
} "TimeoutValue": 10000
], },
"UpstreamPathTemplate": "/api/account/{everything}", "HttpHandlerOptions": {
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UseTracing": true
"LoadBalancerOptions": { }
"Type": "RoundRobin" },
}, //
"RateLimitOptions": { {
"ClientWhitelist": [], "DownstreamPathTemplate": "/api/account/{everything}",
"EnableRateLimiting": true, "DownstreamScheme": "http",
"Period": "1s", "DownstreamHostAndPorts": [
"PeriodTimespan": 1, {
"Limit": 5 "Host": "127.0.0.1",
}, "Port": 30015
"QoSOptions": { }
"ExceptionsAllowedBeforeBreaking": 10, ],
"DurationOfBreak": 1000, "UpstreamPathTemplate": "/api/account/{everything}",
"TimeoutValue": 10000 "UpstreamHttpMethod": [
}, "GET",
"HttpHandlerOptions": { "POST",
"UseTracing": true "PUT",
} "DELETE"
}, ],
// API "LoadBalancerOptions": {
{ "Type": "RoundRobin"
"DownstreamPathTemplate": "/swagger/v1/swagger.json", },
"DownstreamScheme": "http", "RateLimitOptions": {
"DownstreamHostAndPorts": [ "ClientWhitelist": [],
{ "EnableRateLimiting": true,
"Host": "127.0.0.1", "Period": "1s",
"Port": 30015 "PeriodTimespan": 1,
} "Limit": 100
], },
"UpstreamPathTemplate": "/ids-admin/v1/swagger.json", "QoSOptions": {
"UpstreamHttpMethod": [ "GET" ], "ExceptionsAllowedBeforeBreaking": 10,
"LoadBalancerOptions": { "DurationOfBreak": 1000,
"Type": "RoundRobin" "TimeoutValue": 10000
}, },
"RateLimitOptions": { "HttpHandlerOptions": {
"ClientWhitelist": [], "UseTracing": true
"EnableRateLimiting": true, }
"Period": "1s", },
"PeriodTimespan": 1, //
"Limit": 5 {
}, "DownstreamPathTemplate": "/.well-known/openid-configuration",
"QoSOptions": { "DownstreamScheme": "http",
"ExceptionsAllowedBeforeBreaking": 10, "DownstreamHostAndPorts": [
"DurationOfBreak": 1000, {
"TimeoutValue": 10000 "Host": "127.0.0.1",
}, "Port": 44385
"HttpHandlerOptions": { }
"UseTracing": true ],
} "UpstreamPathTemplate": "/.well-known/openid-configuration",
} "UpstreamHttpMethod": [
] "GET"
} ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/connect/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 44385
}
],
"UpstreamPathTemplate": "/connect/{everything}",
"UpstreamHttpMethod": [
"GET",
"POST"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
// API
{
"DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30015
}
],
"UpstreamPathTemplate": "/ids-admin/v1/swagger.json",
"UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
}
]
}

247
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.localization.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.localization.json

@ -1,118 +1,129 @@
{ {
"Routes": [ "Routes": [
// //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30030 "Port": 30030
} }
], ],
"UpstreamPathTemplate": "/api/abp/localization/application-configuration", "UpstreamPathTemplate": "/api/abp/localization/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "localization-configuration" "UseTracing": true
}, },
// API "Key": "localization-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30030 {
} "Host": "127.0.0.1",
], "Port": 30030
"UpstreamPathTemplate": "/api/abp/localization/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/localization/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "localization-api-definition" },
}, "HttpHandlerOptions": {
// "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/localization/{everything}", "Key": "localization-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ //
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/localization/{everything}",
"Port": 30030 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/localization/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30030
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/localization/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
}, },
// API "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/swagger/v1/swagger.json", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {
"Host": "127.0.0.1", "UseTracing": true
"Port": 30030 }
} },
], // API
"UpstreamPathTemplate": "/localization/v1/swagger.json", {
"UpstreamHttpMethod": [ "GET" ], "DownstreamPathTemplate": "/swagger/v1/swagger.json",
"LoadBalancerOptions": { "DownstreamScheme": "http",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30030
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/localization/v1/swagger.json",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET"
"QoSOptions": { ],
"ExceptionsAllowedBeforeBreaking": 10, "LoadBalancerOptions": {
"DurationOfBreak": 1000, "Type": "RoundRobin"
"TimeoutValue": 10000 },
}, "RateLimitOptions": {
"HttpHandlerOptions": { "ClientWhitelist": [],
"UseTracing": true "EnableRateLimiting": true,
} "Period": "1s",
} "PeriodTimespan": 1,
] "Limit": 100
} },
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
}
]
}

714
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.messages.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.messages.json

@ -1,423 +1,291 @@
{ {
"Routes": [ "Routes": [
// ܶ˵ //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30020 "Port": 30020
} }
], ],
"UpstreamPathTemplate": "/api/abp/messages/application-configuration", "UpstreamPathTemplate": "/api/abp/messages/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "messages-configuration" "UseTracing": true
}, },
// ̬ܶAPI˵ "Key": "messages-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30020 {
} "Host": "127.0.0.1",
], "Port": 30020
"UpstreamPathTemplate": "/api/abp/messages/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/messages/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "messages-api-definition" },
}, "HttpHandlerOptions": {
// ʱͨѶ "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/im/{everything}", "Key": "messages-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ //
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/im/{everything}",
"Port": 30020 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/im/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30020
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/im/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
}, },
// Hangfire DZ "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/hangfire/{everything}", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {
"Host": "127.0.0.1", "UseTracing": true
"Port": 30020 }
} },
], // Hangfire
"UpstreamPathTemplate": "/hangfire/{everything}", {
"UpstreamHttpMethod": [ "GET" ], "DownstreamPathTemplate": "/hangfire/{everything}",
"LoadBalancerOptions": { "DownstreamScheme": "http",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30020
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/hangfire/{everything}",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET"
"QoSOptions": { ],
"ExceptionsAllowedBeforeBreaking": 10, "LoadBalancerOptions": {
"DurationOfBreak": 1000, "Type": "RoundRobin"
"TimeoutValue": 10000 },
}, "RateLimitOptions": {
"HttpHandlerOptions": { "ClientWhitelist": [],
"UseTracing": true "EnableRateLimiting": true,
} "Period": "1s",
}, "PeriodTimespan": 1,
{ "Limit": 100
"DownstreamPathTemplate": "/api/my-subscribes", },
"DownstreamScheme": "http", "QoSOptions": {
"DownstreamHostAndPorts": [ "ExceptionsAllowedBeforeBreaking": 10,
{ "DurationOfBreak": 1000,
"Host": "127.0.0.1", "TimeoutValue": 10000
"Port": 30020 },
} "HttpHandlerOptions": {
], "UseTracing": true
"UpstreamPathTemplate": "/api/my-subscribes", }
"UpstreamHttpMethod": [ },
"GET", //
"POST", {
"PUT", "DownstreamPathTemplate": "/api/notifications/{everything}",
"DELETE" "DownstreamScheme": "http",
], "DownstreamHostAndPorts": [
"LoadBalancerOptions": { {
"Type": "RoundRobin" "Host": "127.0.0.1",
}, "Port": 30020
"RateLimitOptions": { }
"ClientWhitelist": [], ],
"EnableRateLimiting": true, "UpstreamPathTemplate": "/api/notifications/{everything}",
"Period": "1s", "UpstreamHttpMethod": [
"PeriodTimespan": 1, "GET",
"Limit": 5 "POST",
}, "PUT",
"QoSOptions": { "DELETE"
"ExceptionsAllowedBeforeBreaking": 10, ],
"DurationOfBreak": 1000, "LoadBalancerOptions": {
"TimeoutValue": 10000 "Type": "RoundRobin"
}, },
"HttpHandlerOptions": { "RateLimitOptions": {
"UseTracing": true "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"Priority": 99 "Period": "1s",
}, "PeriodTimespan": 1,
// û "Limit": 100
{ },
"DownstreamPathTemplate": "/api/my-subscribes/{everything}", "QoSOptions": {
"DownstreamScheme": "http", "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamHostAndPorts": [ "DurationOfBreak": 1000,
{ "TimeoutValue": 10000
"Host": "127.0.0.1", },
"Port": 30020 "HttpHandlerOptions": {
} "UseTracing": true
], }
"UpstreamPathTemplate": "/api/my-subscribes/{everything}", },
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], // Api
"LoadBalancerOptions": { {
"Type": "RoundRobin" "DownstreamPathTemplate": "/swagger/v1/swagger.json",
}, "DownstreamScheme": "http",
"RateLimitOptions": { "DownstreamHostAndPorts": [
"ClientWhitelist": [], {
"EnableRateLimiting": true, "Host": "127.0.0.1",
"Period": "1s", "Port": 30020
"PeriodTimespan": 1, }
"Limit": 5 ],
}, "UpstreamPathTemplate": "/messages/v1/swagger.json",
"QoSOptions": { "UpstreamHttpMethod": [
"ExceptionsAllowedBeforeBreaking": 10, "GET"
"DurationOfBreak": 1000, ],
"TimeoutValue": 10000 "LoadBalancerOptions": {
}, "Type": "RoundRobin"
"HttpHandlerOptions": { },
"UseTracing": true "RateLimitOptions": {
} "ClientWhitelist": [],
}, "EnableRateLimiting": true,
// ûб "Period": "1s",
{ "PeriodTimespan": 1,
"DownstreamPathTemplate": "/api/my-subscribes/all", "Limit": 100
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"Host": "127.0.0.1", "DurationOfBreak": 1000,
"Port": 30020 "TimeoutValue": 10000
} },
], "HttpHandlerOptions": {
"UpstreamPathTemplate": "/api/my-subscribes/all", "UseTracing": true
"UpstreamHttpMethod": [ "GET" ], }
"LoadBalancerOptions": { },
"Type": "RoundRobin" // signalr
}, {
"RateLimitOptions": { "DownstreamPathTemplate": "/signalr-hubs/messages",
"ClientWhitelist": [], "DownstreamScheme": "ws",
"EnableRateLimiting": true, "DownstreamHostAndPorts": [
"Period": "1s", {
"PeriodTimespan": 1, "Host": "127.0.0.1",
"Limit": 5 "Port": 30020
}, }
"QoSOptions": { ],
"ExceptionsAllowedBeforeBreaking": 10, "UpstreamPathTemplate": "/signalr-hubs/messages",
"DurationOfBreak": 1000, "UpstreamHttpMethod": [
"TimeoutValue": 10000 "GET",
}, "POST",
"HttpHandlerOptions": { "PUT",
"UseTracing": true "DELETE",
}, "OPTIONS"
"Priority": 99, ],
"Key": "my-subscribes" "LoadBalancerOptions": {
}, "Type": "RoundRobin"
// û֪ͨ },
{ "RateLimitOptions": {},
"DownstreamPathTemplate": "/api/notifications/my-notifilers/assignables", "QoSOptions": {
"DownstreamScheme": "http", "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamHostAndPorts": [ "DurationOfBreak": 1000,
{ "TimeoutValue": 10000
"Host": "127.0.0.1", },
"Port": 30020 "HttpHandlerOptions": {},
} "DangerousAcceptAnyServerCertificateValidator": true,
], "RouteIsCaseSensitive": false,
"UpstreamPathTemplate": "/api/notifications/my-notifilers/assignables", "Priority": 99
"UpstreamHttpMethod": [ "GET" ], },
"LoadBalancerOptions": { {
"Type": "RoundRobin" "DownstreamPathTemplate": "/signalr-hubs/notifications",
}, "DownstreamScheme": "ws",
"RateLimitOptions": { "DownstreamHostAndPorts": [
"ClientWhitelist": [], {
"EnableRateLimiting": true, "Host": "127.0.0.1",
"Period": "1s", "Port": 30020
"PeriodTimespan": 1, }
"Limit": 5 ],
}, "UpstreamPathTemplate": "/signalr-hubs/notifications",
"QoSOptions": { "UpstreamHttpMethod": [
"ExceptionsAllowedBeforeBreaking": 10, "GET",
"DurationOfBreak": 1000, "POST",
"TimeoutValue": 10000 "PUT",
}, "DELETE",
"HttpHandlerOptions": { "OPTIONS"
"UseTracing": true ],
}, "LoadBalancerOptions": {
"Priority": 99, "Type": "RoundRobin"
"Key": "assignables-notifilers" },
}, "RateLimitOptions": {},
// û֪ͨ "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/api/notifications/my-notifilers", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {},
"Host": "127.0.0.1", "DangerousAcceptAnyServerCertificateValidator": true,
"Port": 30020 "RouteIsCaseSensitive": false,
} "Priority": 99
], },
"UpstreamPathTemplate": "/api/notifications/my-notifilers", {
"UpstreamHttpMethod": [ "GET" ], "DownstreamPathTemplate": "/signalr-hubs/{everything}",
"LoadBalancerOptions": { "DownstreamScheme": "ws",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30020
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/signalr-hubs/{everything}",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET",
"QoSOptions": { "POST",
"ExceptionsAllowedBeforeBreaking": 10, "PUT",
"DurationOfBreak": 1000, "DELETE",
"TimeoutValue": 10000 "OPTIONS"
}, ],
"HttpHandlerOptions": { "LoadBalancerOptions": {
"UseTracing": true "Type": "RoundRobin"
} },
}, "RateLimitOptions": {},
{ "QoSOptions": {
"DownstreamPathTemplate": "/api/notifications/my-notifilers/{id}", "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamScheme": "http", "DurationOfBreak": 1000,
"DownstreamHostAndPorts": [ "TimeoutValue": 10000
{ },
"Host": "127.0.0.1", "HttpHandlerOptions": {},
"Port": 30020 "DangerousAcceptAnyServerCertificateValidator": true,
} "RouteIsCaseSensitive": false
], }
"UpstreamPathTemplate": "/api/notifications/my-notifilers/{id}", ]
"UpstreamHttpMethod": [ }
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
// API ĵ
{
"DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/messages/v1/swagger.json",
"UpstreamHttpMethod": [ "GET" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
//
{
"DownstreamPathTemplate": "/signalr-hubs/messages",
"DownstreamScheme": "ws",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/signalr-hubs/messages",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {},
"DangerousAcceptAnyServerCertificateValidator": true,
"RouteIsCaseSensitive": false,
"Priority": 99
},
{
"DownstreamPathTemplate": "/signalr-hubs/notifications",
"DownstreamScheme": "ws",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/signalr-hubs/notifications",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {},
"DangerousAcceptAnyServerCertificateValidator": true,
"RouteIsCaseSensitive": false,
"Priority": 99
},
{
"DownstreamPathTemplate": "/signalr-hubs/{everything}",
"DownstreamScheme": "ws",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/signalr-hubs/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {},
"DangerousAcceptAnyServerCertificateValidator": true,
"RouteIsCaseSensitive": false
}
]
}

617
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.platform.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.platform.json

@ -1,314 +1,303 @@
{ {
"Routes": [ "Routes": [
// ܶ˵ //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30025 "Port": 30025
} }
], ],
"UpstreamPathTemplate": "/api/abp/platform/application-configuration", "UpstreamPathTemplate": "/api/abp/platform/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "platform-configuration" "UseTracing": true
}, },
// ̬ܶAPI˵ "Key": "platform-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30025 {
} "Host": "127.0.0.1",
], "Port": 30025
"UpstreamPathTemplate": "/api/abp/platform/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/platform/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "platform-api-definition" },
}, "HttpHandlerOptions": {
// "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/oss-management/{everything}", "Key": "platform-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ // oss
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/oss-management/{everything}",
"Port": 30025 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/oss-management/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30025
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/oss-management/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
}, },
// ƽ̨ "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/api/platform/{everything}", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {
"Host": "127.0.0.1", "UseTracing": true
"Port": 30025 }
} },
], //
"UpstreamPathTemplate": "/api/platform/{everything}", {
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "DownstreamPathTemplate": "/api/platform/{everything}",
"LoadBalancerOptions": { "DownstreamScheme": "http",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30025
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/api/platform/{everything}",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET",
"QoSOptions": { "POST",
"ExceptionsAllowedBeforeBreaking": 10, "PUT",
"DurationOfBreak": 1000, "DELETE"
"TimeoutValue": 10000 ],
}, "LoadBalancerOptions": {
"HttpHandlerOptions": { "Type": "RoundRobin"
"UseTracing": true },
} "RateLimitOptions": {
}, "ClientWhitelist": [],
// ļ "EnableRateLimiting": true,
{ "Period": "1s",
"DownstreamPathTemplate": "/api/files/{everything}", "PeriodTimespan": 1,
"DownstreamScheme": "http", "Limit": 100
"DownstreamHostAndPorts": [ },
{ "QoSOptions": {
"Host": "127.0.0.1", "ExceptionsAllowedBeforeBreaking": 10,
"Port": 30025 "DurationOfBreak": 1000,
} "TimeoutValue": 10000
], },
"UpstreamPathTemplate": "/api/files/{everything}", "HttpHandlerOptions": {
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UseTracing": true
"LoadBalancerOptions": { }
"Type": "RoundRobin" },
}, //
"RateLimitOptions": { {
"ClientWhitelist": [], "DownstreamPathTemplate": "/api/files/{everything}",
"EnableRateLimiting": true, "DownstreamScheme": "http",
"Period": "1s", "DownstreamHostAndPorts": [
"PeriodTimespan": 1, {
"Limit": 5 "Host": "127.0.0.1",
}, "Port": 30025
"QoSOptions": { }
"ExceptionsAllowedBeforeBreaking": 10, ],
"DurationOfBreak": 1000, "UpstreamPathTemplate": "/api/files/{everything}",
"TimeoutValue": 10000 "UpstreamHttpMethod": [
}, "GET",
"HttpHandlerOptions": { "POST",
"UseTracing": true "PUT",
} "DELETE"
}, ],
{ "LoadBalancerOptions": {
"DownstreamPathTemplate": "/api/files/{everything}", "Type": "RoundRobin"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ "RateLimitOptions": {
{ "ClientWhitelist": [],
"Host": "127.0.0.1", "EnableRateLimiting": true,
"Port": 30025 "Period": "1s",
} "PeriodTimespan": 1,
], "Limit": 100
"UpstreamPathTemplate": "/api/api/files/{everything}", },
"UpstreamHttpMethod": [ "QoSOptions": {
"GET", "ExceptionsAllowedBeforeBreaking": 10,
"POST", "DurationOfBreak": 1000,
"PUT", "TimeoutValue": 10000
"DELETE" },
], "HttpHandlerOptions": {
"LoadBalancerOptions": { "UseTracing": true
"Type": "RoundRobin" }
}, },
"RateLimitOptions": { {
"ClientWhitelist": [], "DownstreamPathTemplate": "/api/files/{everything}",
"EnableRateLimiting": true, "DownstreamScheme": "http",
"Period": "1s", "DownstreamHostAndPorts": [
"PeriodTimespan": 1, {
"Limit": 5 "Host": "127.0.0.1",
}, "Port": 30025
"QoSOptions": { }
"ExceptionsAllowedBeforeBreaking": 10, ],
"DurationOfBreak": 1000, "UpstreamPathTemplate": "/api/api/files/{everything}",
"TimeoutValue": 10000 "UpstreamHttpMethod": [
}, "GET",
"HttpHandlerOptions": { "POST",
"UseTracing": true "PUT",
} "DELETE"
}, ],
{ "LoadBalancerOptions": {
"DownstreamPathTemplate": "/api/task-management/{everything}", "Type": "RoundRobin"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ "RateLimitOptions": {
{ "ClientWhitelist": [],
"Host": "127.0.0.1", "EnableRateLimiting": true,
"Port": 30040 "Period": "1s",
} "PeriodTimespan": 1,
], "Limit": 100
"UpstreamPathTemplate": "/api/task-management/{everything}", },
"UpstreamHttpMethod": [ "QoSOptions": {
"GET", "ExceptionsAllowedBeforeBreaking": 10,
"POST", "DurationOfBreak": 1000,
"PUT", "TimeoutValue": 10000
"DELETE" },
], "HttpHandlerOptions": {
"LoadBalancerOptions": { "UseTracing": true
"Type": "RoundRobin" }
}, },
"RateLimitOptions": { // oss
"ClientWhitelist": [], {
"EnableRateLimiting": true, "DownstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant",
"Period": "1s", "DownstreamScheme": "http",
"PeriodTimespan": 1, "DownstreamHostAndPorts": [
"Limit": 5 {
}, "Host": "127.0.0.1",
"QoSOptions": { "Port": 30025
"ExceptionsAllowedBeforeBreaking": 10, }
"DurationOfBreak": 1000, ],
"TimeoutValue": 10000 "UpstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant",
}, "UpstreamHttpMethod": [
"HttpHandlerOptions": { "GET"
"UseTracing": true ],
} "LoadBalancerOptions": {
}, "Type": "RoundRobin"
// },
{ "RateLimitOptions": {
"DownstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant", "ClientWhitelist": [],
"DownstreamScheme": "http", "EnableRateLimiting": true,
"DownstreamHostAndPorts": [ "Period": "1s",
{ "PeriodTimespan": 1,
"Host": "127.0.0.1", "Limit": 100
"Port": 30025 },
} "QoSOptions": {
], "ExceptionsAllowedBeforeBreaking": 10,
"UpstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant", "DurationOfBreak": 1000,
"UpstreamHttpMethod": [ "GET" ], "TimeoutValue": 10000
"LoadBalancerOptions": { },
"Type": "RoundRobin" "HttpHandlerOptions": {
}, "UseTracing": true
"RateLimitOptions": { },
"ClientWhitelist": [], "Key": "oss-management-setting-current-tenant"
"EnableRateLimiting": true, },
"Period": "1s", {
"PeriodTimespan": 1, "DownstreamPathTemplate": "/api/setting-management/oss-management/by-global",
"Limit": 5 "DownstreamScheme": "http",
}, "DownstreamHostAndPorts": [
"QoSOptions": { {
"ExceptionsAllowedBeforeBreaking": 10, "Host": "127.0.0.1",
"DurationOfBreak": 1000, "Port": 30025
"TimeoutValue": 10000 }
}, ],
"HttpHandlerOptions": { "UpstreamPathTemplate": "/api/setting-management/oss-management/by-global",
"UseTracing": true "UpstreamHttpMethod": [
}, "GET"
"Key": "oss-management-setting-current-tenant" ],
}, "LoadBalancerOptions": {
// ȫ "Type": "RoundRobin"
{ },
"DownstreamPathTemplate": "/api/setting-management/oss-management/by-global", "RateLimitOptions": {
"DownstreamScheme": "http", "ClientWhitelist": [],
"DownstreamHostAndPorts": [ "EnableRateLimiting": true,
{ "Period": "1s",
"Host": "127.0.0.1", "PeriodTimespan": 1,
"Port": 30025 "Limit": 100
} },
], "QoSOptions": {
"UpstreamPathTemplate": "/api/setting-management/oss-management/by-global", "ExceptionsAllowedBeforeBreaking": 10,
"UpstreamHttpMethod": [ "GET" ], "DurationOfBreak": 1000,
"LoadBalancerOptions": { "TimeoutValue": 10000
"Type": "RoundRobin" },
}, "HttpHandlerOptions": {
"RateLimitOptions": { "UseTracing": true
"ClientWhitelist": [], },
"EnableRateLimiting": true, "Key": "oss-management-setting-global"
"Period": "1s", },
"PeriodTimespan": 1, // Api
"Limit": 5 {
}, "DownstreamPathTemplate": "/swagger/v1/swagger.json",
"QoSOptions": { "DownstreamScheme": "http",
"ExceptionsAllowedBeforeBreaking": 10, "DownstreamHostAndPorts": [
"DurationOfBreak": 1000, {
"TimeoutValue": 10000 "Host": "127.0.0.1",
}, "Port": 30025
"HttpHandlerOptions": { }
"UseTracing": true ],
}, "UpstreamPathTemplate": "/platform/v1/swagger.json",
"Key": "oss-management-setting-global" "UpstreamHttpMethod": [
}, "GET"
// API ĵ ],
{ "LoadBalancerOptions": {
"DownstreamPathTemplate": "/swagger/v1/swagger.json", "Type": "RoundRobin"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ "RateLimitOptions": {
{ "ClientWhitelist": [],
"Host": "127.0.0.1", "EnableRateLimiting": true,
"Port": 30025 "Period": "1s",
} "PeriodTimespan": 1,
], "Limit": 100
"UpstreamPathTemplate": "/platform/v1/swagger.json", },
"UpstreamHttpMethod": [ "GET" ], "QoSOptions": {
"LoadBalancerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"Type": "RoundRobin" "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"RateLimitOptions": { },
"ClientWhitelist": [], "HttpHandlerOptions": {
"EnableRateLimiting": true, "UseTracing": true
"Period": "1s", }
"PeriodTimespan": 1, }
"Limit": 5 ]
}, }
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
}
]
}

183
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.task.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.task.json

@ -1,87 +1,96 @@
{ {
"Routes": [ "Routes": [
// //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30040 "Port": 30040
} }
], ],
"UpstreamPathTemplate": "/api/abp/task/application-configuration", "UpstreamPathTemplate": "/api/abp/task/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "task-configuration" "UseTracing": true
}, },
// API "Key": "task-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30040 {
} "Host": "127.0.0.1",
], "Port": 30040
"UpstreamPathTemplate": "/api/abp/task/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/task/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "task-api-definition" },
}, "HttpHandlerOptions": {
// "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/task-management/{everything}", "Key": "task-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ //
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/task-management/{everything}",
"Port": 30040 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/task-management/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30040
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/task-management/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
} },
] "QoSOptions": {
} "ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
}
]
}

121
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.webhook.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.webhook.json

@ -1,59 +1,62 @@
{ {
"Routes": [ "Routes": [
{ // API
"DownstreamPathTemplate": "/api/abp/api-definition", {
"DownstreamScheme": "http", "DownstreamPathTemplate": "/api/abp/api-definition",
"DownstreamHostAndPorts": [ "DownstreamScheme": "http",
{ "DownstreamHostAndPorts": [
"Host": "127.0.0.1", {
"Port": 30045 "Host": "127.0.0.1",
} "Port": 30045
], }
"UpstreamPathTemplate": "/api/abp/webhook/api-definition", ],
"UpstreamHttpMethod": [ "GET" ], "UpstreamPathTemplate": "/api/abp/webhook/api-definition",
"LoadBalancerOptions": { "UpstreamHttpMethod": [
"Type": "RoundRobin" "GET"
}, ],
"RateLimitOptions": {}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {},
"TimeoutValue": 10000 "QoSOptions": {
}, "ExceptionsAllowedBeforeBreaking": 10,
"HttpHandlerOptions": { "DurationOfBreak": 1000,
"UseTracing": true "TimeoutValue": 10000
}, },
"Key": "webhook-api-definition" "HttpHandlerOptions": {
}, "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/webhooks/{everything}", "Key": "webhook-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ // webhooks
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/webhooks/{everything}",
"Port": 30045 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/webhooks/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30045
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/webhooks/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {},
"TimeoutValue": 10000 "QoSOptions": {
}, "ExceptionsAllowedBeforeBreaking": 10,
"HttpHandlerOptions": { "DurationOfBreak": 1000,
"UseTracing": true "TimeoutValue": 30000
} },
} "HttpHandlerOptions": {
] "UseTracing": true
} }
}
]
}

13
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Program.cs

@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Ocelot.DependencyInjection;
using Serilog; using Serilog;
using System; using System;
using System.IO; using System.IO;
@ -25,11 +26,13 @@ public class Program
.UseAutofac() .UseAutofac()
.ConfigureAppConfiguration((context, config) => .ConfigureAppConfiguration((context, config) =>
{ {
// 加入 ocelot配置文件 //// 加入 ocelot配置文件
config.AddJsonFile( //config.AddJsonFile(
$"ocelot.{context.HostingEnvironment.EnvironmentName ?? "Development"}.json", //$"ocelot.{context.HostingEnvironment.EnvironmentName ?? "Development"}.json",
optional: true, //optional: true,
reloadOnChange: true); //reloadOnChange: true);
config.AddAutoOcelotConfig("OcelotConfig", builder.Environment);
var configuration = config.Build(); var configuration = config.Build();
if (configuration.GetSection("AgileConfig").Exists()) if (configuration.GetSection("AgileConfig").Exists())

1895
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.Development.json

File diff suppressed because it is too large

4349
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.json

File diff suppressed because it is too large

26
starter/00.auto-config-docker.cmd

@ -0,0 +1,26 @@
docker network create --subnet=172.18.0.0/16 nt
docker pull mysql
docker volume rm mysql-data
docker volume rm mysql-log
docker volume create mysql-data
docker volume create mysql-log
docker run --ip 172.18.0.10 -d --name mysql --net nt -v mysql-log:/var/log/mysql -v mysql-data:/var/lib/mysql -p 3306:3306 -p 33060:33060 -e MYSQL_ROOT_PASSWORD=123456 -d mysql --init-connect="SET collation_connection=utf8mb4_0900_ai_ci" --init-connect="SET NAMES utf8mb4" --skip-character-set-client-handshake
docker pull rabbitmq:management
docker volume rm rabbitmq-home
docker volume create rabbitmq-home
docker run --ip 172.18.0.40 -d -id --name=rabbitmq --net nt -v rabbitmq-home:/var/lib/rabbitmq -p 15672:15672 -p 5672:5672 -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin rabbitmq:management
docker pull redis
docker volume rm redis-home
docker volume create redis-home
docker run --ip 172.18.0.50 -d --net nt -p 6379:6379 --name redis -v redis-home:/data redis
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.9.0
docker volume rm elasticsearch-home
docker volume create elasticsearch-home
docker run --ip 172.18.0.60 -d --name es --net nt -v elasticsearch-home:/usr/share/elasticsearch/data -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms1G -Xmx1G" -e xpack.security.enabled=false -p 9200:9200 -p 9300:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.9.0
docker pull docker.elastic.co/kibana/kibana:8.9.0
docker run --ip 172.18.0.70 -d --name kib --net nt -p 5601:5601 docker.elastic.co/kibana/kibana:8.9.0

4
starter/01.migrate-db.cmd

@ -0,0 +1,4 @@
@echo off
cd ..\aspnet-core
migrate-database.bat

4
starter/10.start-ids.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-http-api-host.bat LY.MicroService.IdentityServer identityserver --watchrun

4
starter/11.start-ids-admin.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-http-api-host.bat LY.MicroService.IdentityServer.HttpApi.Host identityserver4-admin --watchrun

4
starter/12.start-localization.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-http-api-host.bat LY.MicroService.LocalizationManagement.HttpApi.Host localization --watchrun

4
starter/13.start-platform.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-http-api-host.bat LY.MicroService.PlatformManagement.HttpApi.Host platform --watchrun

4
starter/14.start-messages.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-http-api-host.bat LY.MicroService.RealtimeMessage.HttpApi.Host messages --watchrun

4
starter/15.start-task-management.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-http-api-host.bat LY.MicroService.TaskManagement.HttpApi.Host task-management --watchrun

4
starter/16.start-webhooks-management.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-http-api-host.bat LY.MicroService.WebhooksManagement.HttpApi.Host webhooks-management--watchrun

4
starter/17.start-workflow-management.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-http-api-host.bat LY.MicroService.WorkflowManagement.HttpApi.Host workflow-management --watchrun

4
starter/18.start-admin.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-http-api-host.bat LY.MicroService.BackendAdmin.HttpApi.Host admin --watchrun

4
starter/70.start-internal-gateway.bat

@ -0,0 +1,4 @@
@echo off
cls
cd ..\aspnet-core\
.\start-internal-gateway.bat --watchrun

9
starter/80.start-host.cmd

@ -0,0 +1,9 @@
@echo off
cls
title start-all
set stime=12
for /f "delims=" %%i in ('dir *.bat /b') do (
echo %%i
start %%i
ping -n %stime% 127.1 >nul
)

6
starter/91.install-node-module.cmd

@ -0,0 +1,6 @@
@echo off
cls
cd ../apps/vue/
title install-module
pnpm install
pause

5
starter/99.start-ui.cmd

@ -0,0 +1,5 @@
@echo off
cls
cd ../apps/vue/
title abp-next-admin-ui
pnpm run dev

8
starter/readme.md

@ -0,0 +1,8 @@
快速启动后端项目:
1.使用 00.auto-config-docker.cmd 自动配置docker环境
2.使用 01.migrate-db.cmd 迁移数据库
3.使用 80.start-host.cmd 启动后端项目
注:请按自己电脑运行速度调整 80.start-host.cmd 文件中的 stime 参数。
快速启动前端项目:
1.使用 91.install-node-module.cmd 安装npm依赖
2.使用 99.start-all.cmd 启动项目
Loading…
Cancel
Save