Browse Source

upgrade(abp): upgrade abp framework to 7.1.1

pull/822/head
cKey 3 years ago
parent
commit
d578cfb4d4
  1. 10
      apps/vue/docker/nginx/default.conf
  2. 2
      apps/vue/docker/nginx/nginx.conf
  3. 21
      apps/vue/src/api/abp/abp.ts
  4. 11
      apps/vue/src/api/abp/api-definition/index.ts
  5. 0
      apps/vue/src/api/abp/api-definition/model/index.ts
  6. 10
      apps/vue/src/api/abp/application-configuration/index.ts
  7. 11
      apps/vue/src/api/abp/localization/index.ts
  8. 243
      apps/vue/src/api/abp/model/appModel.ts
  9. 33
      apps/vue/src/hooks/abp/useAuthorization.ts
  10. 25
      apps/vue/src/store/modules/abp.ts
  11. 2
      apps/vue/src/utils/http/abp/abp.ts
  12. 75
      apps/vue/types/abp.d.ts
  13. 140
      apps/vue/types/abp.dto.d.ts
  14. 1
      apps/vue/types/vue-router.d.ts
  15. 4
      aspnet-core/Directory.Build.props
  16. 60
      aspnet-core/LINGYUN.MicroService.All.sln
  17. 28
      aspnet-core/LINGYUN.MicroService.Workflow.sln
  18. 2
      aspnet-core/common.props
  19. 2
      aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj
  20. 23
      aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/UI/Vben/Templates/VbenTableViewScript.tpl
  21. 14
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Emailing/LINGYUN/Abp/Notifications/Emailing/EmailingNotificationPublishProvider.cs
  22. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/README.md
  23. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/FodyWeavers.xml
  24. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/FodyWeavers.xsd
  25. 16
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN.Abp.Elsa.Notifications.csproj
  26. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaNotificationsModule.cs
  27. 126
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaWorkflowNotificationHandler.cs
  28. 67
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/README.md
  29. 16
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/README.md
  30. 31
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/Notifications/AbpWorkflowBuilderNotificationsExtensions.cs
  31. 59
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/Notifications/AbpWorkflowExecutionContextNotificationsExtensions.cs
  32. 29
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/README.md
  33. 8
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Application.Contracts/Class1.cs
  34. 18
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Application.Contracts/LINGYUN.Abp.RulesManagement.Application.Contracts.csproj
  35. 8
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Application/Class1.cs
  36. 18
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Application/LINGYUN.Abp.RulesManagement.Application.csproj
  37. 19
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN.Abp.RulesManagement.Domain.Shared.csproj
  38. 28
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/AbpRulesManagementDomainSharedModule.cs
  39. 11
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleConsts.cs
  40. 18
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleEto.cs
  41. 9
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleGroupConsts.cs
  42. 18
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleGroupEto.cs
  43. 8
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleParamConsts.cs
  44. 9
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/Localization/RulesResource.cs
  45. 20
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN.Abp.RulesManagement.Domain.csproj
  46. 31
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/AbpRulesManagementDomainModule.cs
  47. 163
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRule.cs
  48. 34
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleDataSeeder.cs
  49. 131
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleFinder.cs
  50. 103
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleGroup.cs
  51. 35
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleInGroup.cs
  52. 39
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleInject.cs
  53. 44
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleParam.cs
  54. 35
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntitySubRule.cs
  55. 9
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/IEntityRuleDataSeeder.cs
  56. 40
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/IEntityRuleGroupRepository.cs
  57. 35
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/IEntityRuleRepository.cs
  58. 13
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/RulesManagementDbProperties.cs
  59. 22
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/RulesManagementMapperProfile.cs
  60. 18
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN.Abp.RulesManagement.EntityFrameworkCore.csproj
  61. 21
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/AbpRulesManagementEntityFrameworkCoreModule.cs
  62. 98
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/EfCoreEntityRuleGroupRepository.cs
  63. 76
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/EfCoreEntityRuleRepository.cs
  64. 13
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/IRulesManagementDbContext.cs
  65. 25
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/RulesManagementDbContext.cs
  66. 81
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/RulesManagementDbContextModelBuilderExtensions.cs
  67. 32
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/RulesManagementEfCoreQueryableExtensions.cs
  68. 15
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/RulesManagementModelBuilderConfigurationOptions.cs
  69. 8
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.HttpApi.Client/Class1.cs
  70. 18
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.HttpApi.Client/LINGYUN.Abp.RulesManagement.HttpApi.Client.csproj
  71. 8
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.HttpApi/Class1.cs
  72. 18
      aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.HttpApi/LINGYUN.Abp.RulesManagement.HttpApi.csproj
  73. 3
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/FodyWeavers.xml
  74. 30
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/FodyWeavers.xsd
  75. 19
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj
  76. 12
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/LINGYUN/Abp/RulesEngineManagement/RulesEngineManagementApplicationContractsModule.cs
  77. 3
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/FodyWeavers.xml
  78. 30
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/FodyWeavers.xsd
  79. 20
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/LINGYUN.Abp.RulesEngineManagement.Application.csproj
  80. 13
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/LINGYUN/Abp/RulesEngineManagement/RulesEngineManagementApplicationModule.cs
  81. 3
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/FodyWeavers.xml
  82. 30
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/FodyWeavers.xsd
  83. 16
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj
  84. 5
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/ActionRecordConsts.cs
  85. 6
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/ActionType.cs
  86. 6
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/ParamRecordConsts.cs
  87. 10
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/RuleRecordConsts.cs
  88. 13
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/RulesEngineManagementDomainSharedModule.cs
  89. 7
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/WorkflowRecordConsts.cs
  90. 3
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/FodyWeavers.xml
  91. 30
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/FodyWeavers.xsd
  92. 20
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN.Abp.RulesEngineManagement.Domain.csproj
  93. 32
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/ActionRecord.cs
  94. 22
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/IRuleRecordRepository.cs
  95. 21
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/IWorkflowRecordRepository.cs
  96. 24
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/ParamRecord.cs
  97. 24
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/RuleActionRecord.cs
  98. 18
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/RuleParamRecord.cs
  99. 69
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/RuleRecord.cs
  100. 12
      aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/RulesEngineManagementDbPropertites.cs

10
apps/vue/docker/nginx/default.conf

@ -3,9 +3,9 @@ server {
server_name localhost;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
@ -36,9 +36,6 @@ server {
location /api/ {
proxy_pass http://127.0.0.1:30000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ^~/wapi/ {
@ -53,9 +50,6 @@ server {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

2
apps/vue/docker/nginx/nginx.conf

@ -19,7 +19,7 @@ http {
underscores_in_headers on;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
'"$server_name" "$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;

21
apps/vue/src/api/abp/abp.ts

@ -1,21 +0,0 @@
import { defHttp } from '/@/utils/http/axios';
import { IApplicationConfiguration } from './model/appModel';
import { ApplicationApiDescriptionModel } from './model/apiDefinition';
enum Api {
ApplicationConfiguration = '/api/abp/application-configuration',
ApiDefinition = '/api/abp/api-definition',
}
export const getApplicationConfiguration = () => {
return defHttp.get<IApplicationConfiguration>({
url: Api.ApplicationConfiguration,
});
};
export const getApiDefinition = (includeTypes = false) => {
return defHttp.get<ApplicationApiDescriptionModel>({
url: Api.ApiDefinition,
params: { includeTypes: includeTypes },
});
};

11
apps/vue/src/api/abp/api-definition/index.ts

@ -0,0 +1,11 @@
import { defHttp } from '/@/utils/http/axios';
import { ApplicationApiDescriptionModel } from './model';
export const GetAsyncByModel = (model?: {
includeTypes?: boolean;
}) => {
return defHttp.get<ApplicationApiDescriptionModel>({
url: '/api/abp/api-definition',
params: model,
});
};

0
apps/vue/src/api/abp/model/apiDefinition.ts → apps/vue/src/api/abp/api-definition/model/index.ts

10
apps/vue/src/api/abp/application-configuration/index.ts

@ -0,0 +1,10 @@
import { defHttp } from '/@/utils/http/axios';
export const GetAsyncByOptions = (options?: {
includeLocalizationResources?: boolean;
}) => {
return defHttp.get<ApplicationConfigurationDto>({
url: '/api/abp/application-configuration',
params: options,
});
};

11
apps/vue/src/api/abp/localization/index.ts

@ -0,0 +1,11 @@
import { defHttp } from '/@/utils/http/axios';
export const GetAsyncByInput = (input: {
cultureName: string;
onlyDynamics?: boolean;
}) => {
return defHttp.get<ApplicationLocalizationDto>({
url: 'api/abp/application-localization"',
params: input,
});
};

243
apps/vue/src/api/abp/model/appModel.ts

@ -1,243 +0,0 @@
import { Available } from '../../model/baseModel';
/** 授权 */
export class Auth {
/** 权限集合 */
policies?: { [key: string]: boolean } = {};
/** 已授权集合 */
grantedPolicies?: { [key: string]: boolean } = {};
}
/** 当前租户 */
export class CurrentTenant {
/** 标识 */
id? = '';
/** 名称 */
name? = '';
/** 是否可用 */
isAvailable = false;
public clear() {
this.id = '';
this.name = '';
this.isAvailable = false;
}
}
/** 当前用户 */
export class CurrentUser {
/** 标识 */
id? = '';
/** 邮件地址 */
email? = '';
/** 邮件已验证 */
emailVerified = false;
/** 手机号 */
phoneNumber? = '';
/** 手机号已验证 */
phoneNumberVerified = false;
/** 名称 */
name? = '';
/** 简称 */
surName? = '';
/** 用户名 */
userName? = '';
/** 所属租户 */
tenantId? = '';
/** 是否已认证 */
isAuthenticated = false;
/** 所属角色列表 */
roles = new Array<string>();
}
/** 功能 */
export class Feature {
/** 功能集合 */
values?: { [key: string]: string } = {};
}
/** 时区转换 */
export class DateTimeFormat {
/** 日历算法 */
calendarAlgorithmType = '';
/** 日期分隔符 */
dateSeparator = '';
/** 日期时间格式 */
dateTimeFormatLong = '';
/** 完整日期时间格式 */
fullDateTimePattern = '';
/** 长时间格式 */
longTimePattern = '';
/** 短日期格式 */
shortDatePattern = '';
/** 短时间格式 */
shortTimePattern = '';
}
/** 当前区域信息 */
export class CurrentCulture {
/** 本地化名称 */
cultureName = '';
/** 显示名称 */
displayName = '';
/** 英文名称 */
englishName = '';
/** 是否从右到左 */
isRightToLeft = false;
/** 名称 */
name = '';
/** 本地名称 */
nativeName = '';
/** 三个字母的ISO名称 */
threeLetterIsoLanguageName = '';
/** 两个字母的ISO名称 */
twoLetterIsoLanguageName = '';
/** 日期时间格式 */
dateTimeFormat = new DateTimeFormat();
}
/** 语言 */
export class Language {
/** 本地化名称 */
cultureName = '';
/** 显示名称 */
displayName = '';
/** 图标 */
flagIcon = '';
/** 用户界面本地化名称 */
uiCultureName = '';
}
/** 本地化 */
export class Localization {
/** 当前区域 */
currentCulture = new CurrentCulture();
/** 默认本地化资源名称 */
defaultResourceName = '';
/** 支持的语言列表 */
languages = new Array<Language>();
/** 本地化资源集合 */
values: { [key: string]: { [key: string]: string } } = {};
/** 语言映射集合 */
languagesMap: { [key: string]: NameValue<string>[] } = {};
/** 语言文档映射集合 */
languageFilesMap: { [key: string]: NameValue<string>[] } = {};
}
/** 多租户配置 */
export class MultiTenancy {
/** 是否启用多租户 */
isEnabled = false;
}
/** 全局设置 */
export class Setting {
/** 设置集合 */
values: { [key: string]: string } = {};
}
/** 实体查询属性扩展 */
export class ExtensionPropertyApiGet extends Available {}
/** 实体创建属性扩展 */
export class ExtensionPropertyApiCreate extends Available {}
/** 实体更新属性扩展 */
export class ExtensionPropertyApiUpdate extends Available {}
/** 实体属性api定义 */
export class ExtensionPropertyApi {
/** 查询时 */
onGet = new ExtensionPropertyApiGet();
/** 创建时 */
onCreate = new ExtensionPropertyApiCreate();
/** 更新时 */
onUpdate = new ExtensionPropertyApiUpdate();
}
export class ExtensionPropertyUiTable extends Available {}
export class ExtensionPropertyUiForm extends Available {}
export class ExtensionPropertyUi {
onTable = new ExtensionPropertyUiTable();
onCreateForm = new ExtensionPropertyUiForm();
onEditForm = new ExtensionPropertyUiForm();
}
export class LocalizableString {
name = '';
resource = '';
}
export class ExtensionPropertyAttribute {
typeSimple = '';
config: { [key: string]: any } = {};
}
export class ExtensionProperty {
type = '';
typeSimple = '';
displayName = new LocalizableString();
api = new ExtensionPropertyApi();
ui = new ExtensionPropertyUi();
attributes = new Array<ExtensionPropertyAttribute>();
configuration: { [key: string]: any } = {};
defaultValue: any = '';
}
export class EntityExtension {
properties: { [key: string]: ExtensionProperty } = {};
configuration: { [key: string]: any } = {};
}
export class ModuleExtension {
entities: { [key: string]: EntityExtension } = {};
configuration: { [key: string]: any } = {};
}
export class ExtensionEnumField {
name = '';
value: any = '';
}
export class ExtensionEnum {
fields = new Array<ExtensionEnumField>();
localizationResource = '';
}
export class ObjectExtension {
modules: { [key: string]: ModuleExtension } = {};
enums: { [key: string]: ExtensionEnum } = {};
}
/** abp框架信息 */
export interface IApplicationConfiguration {
/** 授权 */
auth: Auth;
/** 租户 */
currentTenant: CurrentTenant;
/** 用户 */
currentUser: CurrentUser;
/** 功能 */
features: Feature;
/** 本地化 */
localization: Localization;
/** 租户配置 */
multiTenancy: MultiTenancy;
/** 对象扩展 */
objectExtensions: ObjectExtension;
/** 设置 */
setting: Setting;
}
export class ApplicationConfiguration implements IApplicationConfiguration {
auth = new Auth();
currentTenant = new CurrentTenant();
currentUser = new CurrentUser();
features = new Feature();
localization = new Localization();
multiTenancy = new MultiTenancy();
objectExtensions = new ObjectExtension();
setting = new Setting();
}

33
apps/vue/src/hooks/abp/useAuthorization.ts

@ -0,0 +1,33 @@
import { computed } from 'vue';
import { useAbpStoreWithOut } from '/@/store/modules/abp';
interface PermissionChecker {
isGranted(name: string | string[]): boolean;
authorize(name: string | string[]): void;
}
export function useAuthorization(): PermissionChecker {
const getGrantedPolicies = computed(() => {
const abpStore = useAbpStoreWithOut();
return abpStore.getApplication.auth.grantedPolicies ?? {};
});
function isGranted(name: string | string[]): boolean {
const grantedPolicies = getGrantedPolicies.value;
if (Array.isArray(name)) {
return name.every((name) => grantedPolicies[name]);
}
return grantedPolicies[name]
}
function authorize(name: string | string[]): void {
if (!isGranted(name)) {
throw Error(`Authorization failed! Given policy has not granted: ${name}`);
}
}
return {
isGranted,
authorize,
}
}

25
apps/vue/src/store/modules/abp.ts

@ -6,24 +6,19 @@ import { createLocalStorage } from '/@/utils/cache';
import { i18n } from '/@/locales/setupI18n';
import { getApplicationConfiguration, getApiDefinition } from '/@/api/abp/abp';
import {
ApplicationConfiguration,
Auth,
CurrentUser,
Localization,
} from '/@/api/abp/model/appModel';
import { ApplicationApiDescriptionModel } from '/@/api/abp/model/apiDefinition';
import { GetAsyncByModel as getApiDefinition } from '/@/api/abp/api-definition';
import { ApplicationApiDescriptionModel } from '/@/api/abp/api-definition/model';
import { GetAsyncByOptions as getApplicationConfiguration } from '/@/api/abp/application-configuration';
const ls = createLocalStorage();
const defaultApp = new ApplicationConfiguration();
const defaultApp = {};
const defaultApi = new ApplicationApiDescriptionModel();
const lsApplication = (ls.get(ABP_APP_KEY) || defaultApp) as ApplicationConfiguration;
const lsApplication = (ls.get(ABP_APP_KEY) || defaultApp) as ApplicationConfigurationDto;
const lsApiDefinition = (ls.get(ABP_API_KEY) || defaultApi) as ApplicationApiDescriptionModel;
interface AbpState {
application: ApplicationConfiguration;
application: ApplicationConfigurationDto;
apidefinition: ApplicationApiDescriptionModel;
}
@ -44,10 +39,10 @@ export const useAbpStore = defineStore({
actions: {
resetSession() {
// 清除与用户相关的信息
this.application.auth = new Auth();
this.application.currentUser = new CurrentUser();
this.application.auth = {} as ApplicationAuthConfigurationDto;
this.application.currentUser = {} as CurrentUser;
},
setApplication(application: ApplicationConfiguration) {
setApplication(application: ApplicationConfigurationDto) {
this.application = application;
ls.set(ABP_APP_KEY, application);
},
@ -55,7 +50,7 @@ export const useAbpStore = defineStore({
this.apidefinition = apidefinition;
ls.set(ABP_API_KEY, apidefinition);
},
mergeLocaleMessage(localization: Localization) {
mergeLocaleMessage(localization: ApplicationLocalizationConfigurationDto) {
if (localization.languagesMap['vben-admin-ui']) {
const transferCulture = localization.languagesMap['vben-admin-ui'].filter(
(x) => x.value === localization.currentCulture.cultureName,

2
apps/vue/src/utils/http/abp/abp.ts

@ -6,7 +6,7 @@ import {
ApiVersionInfo,
ControllerApiDescriptionModel,
ModuleApiDescriptionModel,
} from '/@/api/abp/model/apiDefinition';
} from '/@/api/abp/api-definition/model';
import { ParameterBindingSources, UrlBuilder } from '/@/utils/helper/abpApiHelper';
import { useI18n } from '/@/hooks/web/useI18n';

75
apps/vue/types/abp.d.ts

@ -36,3 +36,78 @@ declare interface ValueType {
declare interface SelectionStringValueType extends ValueType {
itemSource: ISelectionStringValueItemSource;
}
declare interface LanguageInfo {
cultureName: string;
uiCultureName: string;
displayName: string;
twoLetterISOLanguageName: string;
flagIcon?: string;
}
declare interface DateTimeFormat {
calendarAlgorithmType: string;
dateTimeFormatLong: string;
shortDatePattern: string;
fullDateTimePattern: string;
dateSeparator: string;
shortTimePattern: string;
longTimePattern: string;
}
declare interface CurrentCulture {
displayName: string;
englishName: string;
threeLetterIsoLanguageName: string;
twoLetterIsoLanguageName: string;
isRightToLeft: boolean;
cultureName: string;
name: string;
nativeName: string;
dateTimeFormat: DateTimeFormat;
}
declare interface WindowsTimeZone {
timeZoneId: string;
}
declare interface IanaTimeZone {
timeZoneName: string;
}
declare interface TimeZone {
iana: IanaTimeZone;
windows: WindowsTimeZone;
}
declare interface Clock {
kind: string;
}
declare interface MultiTenancyInfo {
isEnabled: boolean;
}
declare interface CurrentTenant {
id?: string;
name?: string;
isAvailable: boolean;
}
declare interface CurrentUser {
isAuthenticated: boolean;
id?: string;
tenantId?: string;
impersonatorUserId?: string;
impersonatorTenantId?: string;
impersonatorUserName?: string;
impersonatorTenantName?: string;
userName: string;
name?: string;
surName?: string;
email: string;
emailVerified: boolean;
phoneNumber?: string;
phoneNumberVerified: boolean;
roles: string[];
}

140
apps/vue/types/abp.dto.d.ts

@ -118,3 +118,143 @@ declare interface PagedResultRequestDto extends LimitedResultRequestDto {
}
declare interface ExtensiblePagedResultRequestDto extends PagedResultRequestDto, ExtensibleObject {}
declare interface ApplicationLocalizationResourceDto {
texts: Dictionary<string, string>;
baseResources: string[];
}
declare interface ApplicationLocalizationDto {
resources: Dictionary<string, ApplicationLocalizationResourceDto>;
}
declare interface ApplicationLocalizationConfigurationDto {
values: Dictionary<string, Dictionary<string, string>>;
resources: Dictionary<string, ApplicationLocalizationResourceDto>;
languages: LanguageInfo[];
currentCulture: CurrentCulture;
defaultResourceName: string;
languagesMap: Dictionary<string, NameValue[]>;
languageFilesMap: Dictionary<string, NameValue[]>;
}
declare interface ApplicationAuthConfigurationDto {
grantedPolicies: Dictionary<string, boolean>;
}
declare interface ApplicationSettingConfigurationDto {
values: Dictionary<string, string>;
}
declare interface ApplicationFeatureConfigurationDto {
values: Dictionary<string, string>;
}
declare interface ApplicationGlobalFeatureConfigurationDto {
enabledFeatures: string[];
}
declare interface TimingDto {
timeZone: TimeZone;
}
declare interface LocalizableStringDto {
name: string;
resource?: string;
}
declare interface ExtensionPropertyApiGetDto {
isAvailable: boolean;
}
declare interface ExtensionPropertyApiCreateDto {
isAvailable: boolean;
}
declare interface ExtensionPropertyApiUpdateDto {
isAvailable: boolean;
}
declare interface ExtensionPropertyUiTableDto {
isAvailable: boolean;
}
declare interface ExtensionPropertyUiFormDto {
isAvailable: boolean;
}
declare interface ExtensionPropertyUiLookupDto {
url: string;
resultListPropertyName: string;
displayPropertyName: string;
valuePropertyName: string;
filterParamName: string;
}
declare interface ExtensionPropertyApiDto {
onGet: ExtensionPropertyApiGetDto;
onCreate: ExtensionPropertyApiCreateDto;
onUpdate: ExtensionPropertyApiUpdateDto;
}
declare interface ExtensionPropertyUiDto {
onTable: ExtensionPropertyUiTableDto;
onCreateForm: ExtensionPropertyUiFormDto;
onEditForm: ExtensionPropertyUiFormDto;
lookup: ExtensionPropertyUiLookupDto;
}
declare interface ExtensionPropertyAttributeDto {
typeSimple: string;
config: Dictionary<string, any>;
}
declare interface ExtensionPropertyDto {
type: string;
typeSimple: string;
displayName?: LocalizableStringDto;
api: ExtensionPropertyApiDto;
ui: ExtensionPropertyUiDto;
attributes: ExtensionPropertyAttributeDto[];
configuration: Dictionary<string, any>;
defaultValue: any;
}
declare interface EntityExtensionDto {
properties: Dictionary<string, ExtensionPropertyDto>;
configuration: Dictionary<string, any>;
}
declare interface ModuleExtensionDto {
entities: Dictionary<string, EntityExtensionDto>;
configuration: Dictionary<string, any>;
}
declare interface ExtensionEnumFieldDto {
name: string;
value: any;
}
declare interface ExtensionEnumDto {
fields: ExtensionEnumFieldDto[];
localizationResource: string;
}
declare interface ObjectExtensionsDto {
modules: Dictionary<string, ModuleExtensionDto>;
enums: Dictionary<string, ExtensionEnumDto>;
}
declare interface ApplicationConfigurationDto extends IHasExtraProperties {
localization: ApplicationLocalizationConfigurationDto;
auth: ApplicationAuthConfigurationDto;
setting: ApplicationSettingConfigurationDto;
currentUser: CurrentUser;
features: ApplicationFeatureConfigurationDto;
globalFeatures: ApplicationGlobalFeatureConfigurationDto;
multiTenancy: MultiTenancyInfo;
currentTenant: CurrentTenant;
timing: Timing;
clock: Clock;
objectExtensions: ObjectExtensionsDto;
}

1
apps/vue/types/vue-router.d.ts

@ -20,6 +20,7 @@ declare module 'vue-router' {
// icon on tab
icon?: string;
frameSrc?: string;
frameFormat?: string;
// current page transition
transitionName?: string;
// Whether the route has been dynamically added

4
aspnet-core/Directory.Build.props

@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<VoloAbpPackageVersion>7.1.0</VoloAbpPackageVersion>
<VoloAbpPackageVersion>7.1.1</VoloAbpPackageVersion>
<VoloAbpLeptonXThemePackageVersion>2.0.1</VoloAbpLeptonXThemePackageVersion>
<LINGYUNAbpPackageVersion>7.1.0</LINGYUNAbpPackageVersion>
<LINGYUNAbpPackageVersion>7.1.1</LINGYUNAbpPackageVersion>
<DaprPackageVersion>1.10.0</DaprPackageVersion>
<DistributedLockRedisPackageVersion>1.0.2</DistributedLockRedisPackageVersion>
<DotNetCoreCAPPackageVersion>7.1.0</DotNetCoreCAPPackageVersion>

60
aspnet-core/LINGYUN.MicroService.All.sln

@ -573,19 +573,35 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TextTemplating.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TextTemplating.Razor", "modules\text-templating\LINGYUN.Abp.TextTemplating.Razor\LINGYUN.Abp.TextTemplating.Razor.csproj", "{5F83F8D0-822B-4316-B7DD-85DAFDFAA0E2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.PermissionManagement.Application.Contracts", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.Application.Contracts\LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj", "{35D17AF3-FDCD-4704-969C-E82DBCC0A232}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Application.Contracts", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.Application.Contracts\LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj", "{35D17AF3-FDCD-4704-969C-E82DBCC0A232}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.PermissionManagement.Application", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.Application\LINGYUN.Abp.PermissionManagement.Application.csproj", "{984F481B-79FF-4825-917B-944F151694BC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Application", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.Application\LINGYUN.Abp.PermissionManagement.Application.csproj", "{984F481B-79FF-4825-917B-944F151694BC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.PermissionManagement.HttpApi", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.HttpApi\LINGYUN.Abp.PermissionManagement.HttpApi.csproj", "{B12BECC4-8A58-4DBD-A5CD-144A507972BB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.HttpApi", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.HttpApi\LINGYUN.Abp.PermissionManagement.HttpApi.csproj", "{B12BECC4-8A58-4DBD-A5CD-144A507972BB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "feature-management", "feature-management", "{12896A3F-5F7E-4192-8A58-E1D2527109D1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.FeatureManagement.Application.Contracts", "modules\feature-management\LINGYUN.Abp.FeatureManagement.Application.Contracts\LINGYUN.Abp.FeatureManagement.Application.Contracts.csproj", "{F7A8000A-D8DA-4A1F-B0B2-9A52183F2012}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.FeatureManagement.Application.Contracts", "modules\feature-management\LINGYUN.Abp.FeatureManagement.Application.Contracts\LINGYUN.Abp.FeatureManagement.Application.Contracts.csproj", "{F7A8000A-D8DA-4A1F-B0B2-9A52183F2012}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.FeatureManagement.Application", "modules\feature-management\LINGYUN.Abp.FeatureManagement.Application\LINGYUN.Abp.FeatureManagement.Application.csproj", "{4E8DA436-8FAF-4028-8A0C-E4EEB3615972}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.FeatureManagement.Application", "modules\feature-management\LINGYUN.Abp.FeatureManagement.Application\LINGYUN.Abp.FeatureManagement.Application.csproj", "{4E8DA436-8FAF-4028-8A0C-E4EEB3615972}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.FeatureManagement.HttpApi", "modules\feature-management\LINGYUN.Abp.FeatureManagement.HttpApi\LINGYUN.Abp.FeatureManagement.HttpApi.csproj", "{405694F8-0051-4DAE-A991-919FAC36C7DA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.FeatureManagement.HttpApi", "modules\feature-management\LINGYUN.Abp.FeatureManagement.HttpApi\LINGYUN.Abp.FeatureManagement.HttpApi.csproj", "{405694F8-0051-4DAE-A991-919FAC36C7DA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rules-management", "rules-management", "{5F0BB690-0FBB-455A-AE9A-8BA914AA78F6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rules-engine", "rules-engine", "{F7103498-8B5B-4698-AACE-9E949F732E77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.Domain.Shared", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Domain.Shared\LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj", "{2EAA690B-1395-4952-95A0-A52F929028C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.Domain", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Domain\LINGYUN.Abp.RulesEngineManagement.Domain.csproj", "{722FE012-8F23-4558-9E8F-A37C02902058}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.Application.Contracts", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Application.Contracts\LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj", "{79D3C6D6-6433-471D-B354-477E07CB08EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.Application", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Application\LINGYUN.Abp.RulesEngineManagement.Application.csproj", "{5A3B9F4D-E6CC-410F-B307-0E69CCA213F5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore\LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore.csproj", "{4CDCD854-6E06-4076-AE94-53C1C1D7F6FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.HttpApi", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.HttpApi\LINGYUN.Abp.RulesEngineManagement.HttpApi.csproj", "{97062425-3379-4F8D-BFA2-D445C56C0801}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -1497,6 +1513,30 @@ Global
{405694F8-0051-4DAE-A991-919FAC36C7DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{405694F8-0051-4DAE-A991-919FAC36C7DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{405694F8-0051-4DAE-A991-919FAC36C7DA}.Release|Any CPU.Build.0 = Release|Any CPU
{2EAA690B-1395-4952-95A0-A52F929028C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EAA690B-1395-4952-95A0-A52F929028C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EAA690B-1395-4952-95A0-A52F929028C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2EAA690B-1395-4952-95A0-A52F929028C4}.Release|Any CPU.Build.0 = Release|Any CPU
{722FE012-8F23-4558-9E8F-A37C02902058}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{722FE012-8F23-4558-9E8F-A37C02902058}.Debug|Any CPU.Build.0 = Debug|Any CPU
{722FE012-8F23-4558-9E8F-A37C02902058}.Release|Any CPU.ActiveCfg = Release|Any CPU
{722FE012-8F23-4558-9E8F-A37C02902058}.Release|Any CPU.Build.0 = Release|Any CPU
{79D3C6D6-6433-471D-B354-477E07CB08EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79D3C6D6-6433-471D-B354-477E07CB08EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79D3C6D6-6433-471D-B354-477E07CB08EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79D3C6D6-6433-471D-B354-477E07CB08EE}.Release|Any CPU.Build.0 = Release|Any CPU
{5A3B9F4D-E6CC-410F-B307-0E69CCA213F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A3B9F4D-E6CC-410F-B307-0E69CCA213F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A3B9F4D-E6CC-410F-B307-0E69CCA213F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A3B9F4D-E6CC-410F-B307-0E69CCA213F5}.Release|Any CPU.Build.0 = Release|Any CPU
{4CDCD854-6E06-4076-AE94-53C1C1D7F6FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CDCD854-6E06-4076-AE94-53C1C1D7F6FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CDCD854-6E06-4076-AE94-53C1C1D7F6FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CDCD854-6E06-4076-AE94-53C1C1D7F6FA}.Release|Any CPU.Build.0 = Release|Any CPU
{97062425-3379-4F8D-BFA2-D445C56C0801}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97062425-3379-4F8D-BFA2-D445C56C0801}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97062425-3379-4F8D-BFA2-D445C56C0801}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97062425-3379-4F8D-BFA2-D445C56C0801}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1780,6 +1820,14 @@ Global
{F7A8000A-D8DA-4A1F-B0B2-9A52183F2012} = {12896A3F-5F7E-4192-8A58-E1D2527109D1}
{4E8DA436-8FAF-4028-8A0C-E4EEB3615972} = {12896A3F-5F7E-4192-8A58-E1D2527109D1}
{405694F8-0051-4DAE-A991-919FAC36C7DA} = {12896A3F-5F7E-4192-8A58-E1D2527109D1}
{5F0BB690-0FBB-455A-AE9A-8BA914AA78F6} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{F7103498-8B5B-4698-AACE-9E949F732E77} = {5F0BB690-0FBB-455A-AE9A-8BA914AA78F6}
{2EAA690B-1395-4952-95A0-A52F929028C4} = {F7103498-8B5B-4698-AACE-9E949F732E77}
{722FE012-8F23-4558-9E8F-A37C02902058} = {F7103498-8B5B-4698-AACE-9E949F732E77}
{79D3C6D6-6433-471D-B354-477E07CB08EE} = {F7103498-8B5B-4698-AACE-9E949F732E77}
{5A3B9F4D-E6CC-410F-B307-0E69CCA213F5} = {F7103498-8B5B-4698-AACE-9E949F732E77}
{4CDCD854-6E06-4076-AE94-53C1C1D7F6FA} = {F7103498-8B5B-4698-AACE-9E949F732E77}
{97062425-3379-4F8D-BFA2-D445C56C0801} = {F7103498-8B5B-4698-AACE-9E949F732E77}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

28
aspnet-core/LINGYUN.MicroService.Workflow.sln

@ -61,6 +61,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AuditLogging.Elasticsearch", "modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj", "{00AB0A7E-578E-469C-B049-BCAA0233A9DD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.ExceptionHandling", "modules\common\LINGYUN.Abp.ExceptionHandling\LINGYUN.Abp.ExceptionHandling.csproj", "{90B326F6-99DF-4EEC-A480-26C27EE22237}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.ExceptionHandling.Notifications", "modules\common\LINGYUN.Abp.ExceptionHandling.Notifications\LINGYUN.Abp.ExceptionHandling.Notifications.csproj", "{96EBCB1F-DB7B-40BA-B59E-82FC1AE13EA0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.Common", "modules\common\LINGYUN.Abp.Notifications.Common\LINGYUN.Abp.Notifications.Common.csproj", "{6399C2FB-B063-4BB3-B605-88CE5303198B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.Notifications", "modules\elsa\LINGYUN.Abp.Elsa.Notifications\LINGYUN.Abp.Elsa.Notifications.csproj", "{D2F6105D-D667-46DB-8CDA-89B4D3F69067}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -163,6 +171,22 @@ Global
{00AB0A7E-578E-469C-B049-BCAA0233A9DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00AB0A7E-578E-469C-B049-BCAA0233A9DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00AB0A7E-578E-469C-B049-BCAA0233A9DD}.Release|Any CPU.Build.0 = Release|Any CPU
{90B326F6-99DF-4EEC-A480-26C27EE22237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90B326F6-99DF-4EEC-A480-26C27EE22237}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90B326F6-99DF-4EEC-A480-26C27EE22237}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90B326F6-99DF-4EEC-A480-26C27EE22237}.Release|Any CPU.Build.0 = Release|Any CPU
{96EBCB1F-DB7B-40BA-B59E-82FC1AE13EA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96EBCB1F-DB7B-40BA-B59E-82FC1AE13EA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96EBCB1F-DB7B-40BA-B59E-82FC1AE13EA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96EBCB1F-DB7B-40BA-B59E-82FC1AE13EA0}.Release|Any CPU.Build.0 = Release|Any CPU
{6399C2FB-B063-4BB3-B605-88CE5303198B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6399C2FB-B063-4BB3-B605-88CE5303198B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6399C2FB-B063-4BB3-B605-88CE5303198B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6399C2FB-B063-4BB3-B605-88CE5303198B}.Release|Any CPU.Build.0 = Release|Any CPU
{D2F6105D-D667-46DB-8CDA-89B4D3F69067}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2F6105D-D667-46DB-8CDA-89B4D3F69067}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2F6105D-D667-46DB-8CDA-89B4D3F69067}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2F6105D-D667-46DB-8CDA-89B4D3F69067}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -192,6 +216,10 @@ Global
{B3C2AFCC-EE59-4CB4-AB62-B90D60335632} = {035B86BF-DD63-4A78-B8CE-29994860C948}
{A03A98B6-19E9-4CCA-9801-AEFCBAAF5B72} = {D2E33CD0-B6CA-49B7-930C-018257E78D99}
{00AB0A7E-578E-469C-B049-BCAA0233A9DD} = {D2E33CD0-B6CA-49B7-930C-018257E78D99}
{90B326F6-99DF-4EEC-A480-26C27EE22237} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A}
{96EBCB1F-DB7B-40BA-B59E-82FC1AE13EA0} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A}
{6399C2FB-B063-4BB3-B605-88CE5303198B} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A}
{D2F6105D-D667-46DB-8CDA-89B4D3F69067} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6BB7A5DE-DA12-44DC-BC9B-0F6CA524346F}

2
aspnet-core/common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>7.1.0</Version>
<Version>7.1.1</Version>
<Authors>colin</Authors>
<NoWarn>$(NoWarn);CS1591;CS0436;CS8618;NU1803</NoWarn>
<PackageProjectUrl>https://github.com/colinin/abp-next-admin</PackageProjectUrl>

2
aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj

@ -5,7 +5,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<Version>7.0.3</Version>
<Version>7.1.1</Version>
<Copyright>colin</Copyright>
<Description>Use LINGYUN.MicroService.Templates command line</Description>
<PackAsTool>true</PackAsTool>

23
aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/UI/Vben/Templates/VbenTableViewScript.tpl

@ -1,5 +1,5 @@
<template>
<div>
<div :class="getWrapperClass">
<BasicTable @register="registerTable">
<template #toolbar>
{{~ if model.has_create ~}}
@ -52,6 +52,7 @@
</template>
<script lang="ts" setup>
import { computed, useAttrs } from 'vue';
{{~ if model.has_create ~}}
import { Button } from 'ant-design-vue';
{{~ end ~}}
@ -60,6 +61,7 @@
import { getSearchFormProps } from '../datas/ModalData';
{{~ if model.has_create || model.has_update ~}}
import { useModal } from '/@/components/Modal';
import { useDesign } from '/@/hooks/web/useDesign';
{{~ end ~}}
{{~ if model.has_delete ~}}
import { useMessage } from '/@/hooks/web/useMessage';
@ -71,6 +73,17 @@
{{~ end ~}}
import {{model.modal_name}} from './{{model.modal_name}}.vue';
const attrs = useAttrs();
const { prefixCls } = useDesign('{{model.application}}');
const getWrapperClass = computed(() => {
return [
prefixCls,
attrs.class,
{
[`${prefixCls}-container`]: true,
},
];
});
const { L } = useLocalization(['{{model.remote_service}}', 'AbpUi']);
{{~ if model.has_delete ~}}
const { createConfirm, createMessage } = useMessage();
@ -139,3 +152,11 @@
}
{{~ end ~}}
</script>
<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-{{model.application}}';
.@{prefix-cls} {
max-width: 100%;
height: 100%;
}
</style>

14
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Emailing/LINGYUN/Abp/Notifications/Emailing/EmailingNotificationPublishProvider.cs

@ -10,7 +10,6 @@ using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Emailing;
using Volo.Abp.Localization;
using Volo.Abp.TextTemplating;
namespace LINGYUN.Abp.Notifications.Emailing;
@ -30,7 +29,6 @@ public class EmailingNotificationPublishProvider : NotificationPublishProvider
public EmailingNotificationPublishProvider(
IEmailSender emailSender,
ITemplateRenderer templateRenderer,
IStringLocalizerFactory localizerFactory,
IIdentityUserRepository userRepository,
IOptions<AbpLocalizationOptions> localizationOptions)
@ -67,22 +65,14 @@ public class EmailingNotificationPublishProvider : NotificationPublishProvider
else
{
var titleInfo = notification.Data.TryGetData("title").As<LocalizableStringInfo>();
var titleResource = GetResource(titleInfo.ResourceName);
var titleLocalizer = await LocalizerFactory.CreateByResourceNameAsync(titleResource.ResourceName);
var titleLocalizer = await LocalizerFactory.CreateByResourceNameAsync(titleInfo.ResourceName);
var title = titleLocalizer[titleInfo.Name, titleInfo.Values].Value;
var messageInfo = notification.Data.TryGetData("message").As<LocalizableStringInfo>();
var messageResource = GetResource(messageInfo.ResourceName);
var messageLocalizer = await LocalizerFactory.CreateByResourceNameAsync(messageResource.ResourceName);
var messageLocalizer = await LocalizerFactory.CreateByResourceNameAsync(messageInfo.ResourceName);
var message = messageLocalizer[messageInfo.Name, messageInfo.Values].Value;
await EmailSender.SendAsync(emailAddress, title, message);
}
}
private LocalizationResourceBase GetResource(string resourceName)
{
return LocalizationOptions.Resources.Values
.First(x => x.ResourceName.Equals(resourceName));
}
}

30
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/README.md

@ -0,0 +1,30 @@
# LINGYUN.Abp.Elsa.Activities
常用Activity集成
## 配置使用
```csharp
[DependsOn(
typeof(AbpElsaActivitiesModule)
)]
public class YouProjectModule : AbpModule
{
}
```
## appsettings.json
```json
{
"Elsa": {
"BlobStoring": true,
"Emailing": true,
"Notification": true,
"Sms": true,
"IM": true,
"PublishWebhook": true
}
}
```

3
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

16
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN.Abp.Elsa.Notifications.csproj

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\common\LINGYUN.Abp.Notifications\LINGYUN.Abp.Notifications.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Elsa\LINGYUN.Abp.Elsa.csproj" />
</ItemGroup>
</Project>

17
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaNotificationsModule.cs

@ -0,0 +1,17 @@
using Elsa;
using LINGYUN.Abp.Notifications;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Elsa.Notifications;
[DependsOn(
typeof(AbpElsaModule),
typeof(AbpNotificationsModule))]
public class AbpElsaNotificationsModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services
.AddNotificationHandlersFrom<AbpElsaWorkflowNotificationHandler>();
}
}

126
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaWorkflowNotificationHandler.cs

@ -0,0 +1,126 @@
using Elsa.Events;
using Elsa.Models;
using Elsa.Services.Models;
using LINGYUN.Abp.Notifications;
using MediatR;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.Elsa.Notifications;
public class AbpElsaWorkflowNotificationHandler :
INotificationHandler<WorkflowFaulted>,
INotificationHandler<WorkflowCancelled>,
INotificationHandler<WorkflowCompleted>,
INotificationHandler<WorkflowSuspended>
{
public async Task Handle(WorkflowFaulted notification, CancellationToken cancellationToken)
{
await SendNotifierIfExistsAsync(
notification.WorkflowExecutionContext.GetFaultedNotification(),
notification.WorkflowExecutionContext,
severity: NotificationSeverity.Error);
}
public async Task Handle(WorkflowCancelled notification, CancellationToken cancellationToken)
{
await SendNotifierIfExistsAsync(
notification.WorkflowExecutionContext.GetCancelledNotification(),
notification.WorkflowExecutionContext,
severity: NotificationSeverity.Warn);
}
public async Task Handle(WorkflowCompleted notification, CancellationToken cancellationToken)
{
await SendNotifierIfExistsAsync(
notification.WorkflowExecutionContext.GetCompletedNotification(),
notification.WorkflowExecutionContext,
severity: NotificationSeverity.Success);
}
public async Task Handle(WorkflowSuspended notification, CancellationToken cancellationToken)
{
await SendNotifierIfExistsAsync(
notification.WorkflowExecutionContext.GetSuspendedNotification(),
notification.WorkflowExecutionContext,
severity: NotificationSeverity.Warn);
}
private async Task SendNotifierIfExistsAsync(
string notificationName,
WorkflowExecutionContext executionContext,
NotificationSeverity severity = NotificationSeverity.Info,
CancellationToken cancellationToken = default)
{
try
{
if (notificationName.IsNullOrWhiteSpace())
{
return;
}
var workflowInstance = executionContext.WorkflowInstance;
var workflowBlueprint = executionContext.WorkflowBlueprint;
var serviceProvider = executionContext.ServiceProvider;
var currentTenant = serviceProvider.GetRequiredService<ICurrentTenant>();
var notificationSender = serviceProvider.GetRequiredService<INotificationSender>();
var notificationData = new Dictionary<string, object>
{
{ nameof(IActivityBlueprint.Id), workflowBlueprint.Id },
{ nameof(WorkflowExecutionContext.Status), executionContext.Status },
};
if (!workflowBlueprint.Name.IsNullOrWhiteSpace())
{
notificationData.TryAdd(nameof(IActivityBlueprint.Name), workflowBlueprint.Name);
}
if (!workflowBlueprint.DisplayName.IsNullOrWhiteSpace())
{
notificationData.TryAdd(nameof(IActivityBlueprint.DisplayName), workflowBlueprint.DisplayName);
}
if (!workflowBlueprint.Description.IsNullOrWhiteSpace())
{
notificationData.TryAdd(nameof(IActivityBlueprint.Description), workflowBlueprint.Description);
}
if (!workflowBlueprint.Type.IsNullOrWhiteSpace())
{
notificationData.TryAdd(nameof(IActivityBlueprint.Type), workflowBlueprint.Type);
}
if (executionContext.Exception != null)
{
notificationData.TryAdd(nameof(Exception), executionContext.Exception.Message);
}
var transientData = executionContext.GetNotificationData();
foreach (var data in transientData)
{
notificationData.TryAdd(data.Key, data.Value);
}
var notificationTemplate = new NotificationTemplate(
notificationName,
CultureInfo.CurrentCulture.Name,
data: notificationData);
await notificationSender.SendNofiterAsync(
notificationName,
notificationTemplate,
tenantId: currentTenant.Id ?? workflowInstance.GetTenantId(),
severity: severity);
}
catch (Exception ex)
{
executionContext
.ServiceProvider
.GetService<ILogger<AbpElsaWorkflowNotificationHandler>>()
?.LogWarning("Failed to send a workflow notification, because: {Message}", ex.Message);
}
}
}

67
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/README.md

@ -0,0 +1,67 @@
# LINGYUN.Abp.Elsa.Notifications
工作流通知集成, 当工作流触发后, 发布相应事件通知
## 可用状态
* Faulted: 工作流执行出现错误
* Cancelled: 工作流取消
* Completed: 工作流执行完毕
* Suspended: 工作流暂停
## 配置使用
```csharp
[DependsOn(
typeof(AbpElsaNotificationsModule)
)]
public class YouProjectModule : AbpModule
{
}
```
```csharp
// 定义通知
public class DemoNotificationDefinitionProvider : NotificationDefinitionProvider
{
public override void Define(INotificationDefinitionContext context)
{
var demoGroup = context.AddGroup("Group");
// 由于通知的多样性, 需要使用模板消息来传递数据
demoGroup.AddNotification("Faulted")
.WithTemplate(template => { });
demoGroup.AddNotification("Cancelled")
.WithTemplate(template => { });
demoGroup.AddNotification("Suspended")
.WithTemplate(template => { });
demoGroup.AddNotification("Completed")
.WithTemplate(template => { });
}
}
```
```csharp
// 定义工作流
public class DemoWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.WithFaultedNotification("Faulted")
.WithCancelledNotification("Cancelled")
.WithSuspendedNotification("Suspended")
.WithCompletedNotification("Completed")
.SetVariable("demo", context =>
{
// 可传递自定义参数, 将作为瞬时变量写入到发布的通知数据中
context.WithNotificationData("demo", "demo");
})
.WriteLine("Start a workflow.")
.WriteLine("Workflow finished.");
}
}
```

16
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/README.md

@ -0,0 +1,16 @@
# LINGYUN.Abp.Elsa.Server
Elsa.Server.Api集成, 处理elsa默认端点
## 配置使用
```csharp
[DependsOn(
typeof(AbpElsaServerModule)
)]
public class YouProjectModule : AbpModule
{
}
```

31
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/Notifications/AbpWorkflowBuilderNotificationsExtensions.cs

@ -0,0 +1,31 @@
using Elsa.Builders;
namespace LINGYUN.Abp.Elsa.Notifications;
public static class AbpWorkflowBuilderNotificationsExtensions
{
internal const string NotificationPrefix = "_Abp_Elsa_Notification_";
public const string FaultedNotificationKey = NotificationPrefix + "Faulted_";
public const string CompletedNotificationKey = NotificationPrefix + "Completed_";
public const string CancelledNotificationKey = NotificationPrefix + "Cancelled_";
public const string SuspendedNotificationKey = NotificationPrefix + "Suspended_";
public static IWorkflowBuilder WithFaultedNotification(this IWorkflowBuilder builder, string notification)
{
return builder.WithCustomAttribute(FaultedNotificationKey, notification);
}
public static IWorkflowBuilder WithCompletedNotification(this IWorkflowBuilder builder, string notification)
{
return builder.WithCustomAttribute(CompletedNotificationKey, notification);
}
public static IWorkflowBuilder WithCancelledNotification(this IWorkflowBuilder builder, string notification)
{
return builder.WithCustomAttribute(CancelledNotificationKey, notification);
}
public static IWorkflowBuilder WithSuspendedNotification(this IWorkflowBuilder builder, string notification)
{
return builder.WithCustomAttribute(SuspendedNotificationKey, notification);
}
}

59
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/Notifications/AbpWorkflowExecutionContextNotificationsExtensions.cs

@ -0,0 +1,59 @@
using Elsa.Services.Models;
using System.Collections.Generic;
namespace LINGYUN.Abp.Elsa.Notifications;
public static class AbpWorkflowExecutionContextNotificationsExtensions
{
private const string NotificationDataKey = AbpWorkflowBuilderNotificationsExtensions.NotificationPrefix + "Data_";
public static void WithNotificationData(this ActivityExecutionContext context, string key, object data)
{
context.WorkflowExecutionContext.SetTransientVariable(key, data);
}
public static void WithNotificationData(this WorkflowExecutionContext context, string key, object data)
{
var notificationData = context.GetNotificationData();
notificationData.TryAdd(key, data);
context.SetTransientVariable(NotificationDataKey, notificationData);
}
public static Dictionary<string, object> GetNotificationData(this ActivityExecutionContext context)
{
return context.WorkflowExecutionContext.GetNotificationData();
}
public static Dictionary<string, object> GetNotificationData(this WorkflowExecutionContext context)
{
var notificationData = context.GetTransientVariable<Dictionary<string, object>>(NotificationDataKey);
notificationData ??= new Dictionary<string, object>();
return notificationData;
}
public static string? GetFaultedNotification(this WorkflowExecutionContext context)
{
return context.WorkflowBlueprint.CustomAttributes
.Get<string>(AbpWorkflowBuilderNotificationsExtensions.FaultedNotificationKey);
}
public static string? GetCompletedNotification(this WorkflowExecutionContext context)
{
return context.WorkflowBlueprint.CustomAttributes
.Get<string>(AbpWorkflowBuilderNotificationsExtensions.CompletedNotificationKey);
}
public static string? GetSuspendedNotification(this WorkflowExecutionContext context)
{
return context.WorkflowBlueprint.CustomAttributes
.Get<string>(AbpWorkflowBuilderNotificationsExtensions.SuspendedNotificationKey);
}
public static string? GetCancelledNotification(this WorkflowExecutionContext context)
{
return context.WorkflowBlueprint.CustomAttributes
.Get<string>(AbpWorkflowBuilderNotificationsExtensions.CancelledNotificationKey);
}
}

29
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/README.md

@ -0,0 +1,29 @@
# LINGYUN.Abp.Elsa
[elsa-core](https://github.com/elsa-workflows/elsa-core) 工作流的abp集成
## 特性
* 提供默认**AbpActivity**与多租户集成
* 定义**AbpTenantAccessor**与多租户集成
* 定义**AbpElsaIdGenerator**通过**IGuidGenerator**接口生成工作流标识
* 定义**abp**相关JavaScript扩展
## 配置使用
```csharp
[DependsOn(
typeof(AbpElsaModule)
)]
public class YouProjectModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<ElsaOptionsBuilder>(elsa =>
{
// 自定义elsa相关配置
});
}
}
```

8
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Application.Contracts/Class1.cs

@ -1,8 +0,0 @@
using System;
namespace LINGYUN.Abp.RulesManagement
{
public class Class1
{
}
}

18
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Application.Contracts/LINGYUN.Abp.RulesManagement.Application.Contracts.csproj

@ -1,18 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="4.4.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="LINGYUN\Abp\RulesManagement\" />
</ItemGroup>
</Project>

8
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Application/Class1.cs

@ -1,8 +0,0 @@
using System;
namespace LINGYUN.Abp.RulesManagement.Application
{
public class Class1
{
}
}

18
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Application/LINGYUN.Abp.RulesManagement.Application.csproj

@ -1,18 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.4.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="LINGYUN\Abp\RulesManagement\" />
</ItemGroup>
</Project>

19
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN.Abp.RulesManagement.Domain.Shared.csproj

@ -1,19 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Auditing" Version="4.4.0" />
<PackageReference Include="Volo.Abp.Validation" Version="4.4.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="LINGYUN\Abp\RulesManagement\Localization\Resources\" />
</ItemGroup>
</Project>

28
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/AbpRulesManagementDomainSharedModule.cs

@ -1,28 +0,0 @@
using LINGYUN.Abp.RulesManagement.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Validation;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.RulesManagement
{
[DependsOn(
typeof(AbpValidationModule))]
public class AbpRulesManagementDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpRulesManagementDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<RulesResource>()
.AddVirtualJson("/LINGYUN/Abp/RulesManagement/Localization/Resources");
});
}
}
}

11
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleConsts.cs

@ -1,11 +0,0 @@
namespace LINGYUN.Abp.RulesManagement
{
public static class EntityRuleConsts
{
public static int MaxNameLength { get; set; } = 64;
public static int MaxDisplayNameLength { get; set; } = 256;
public static int MaxOperatorLength { get; set; } = 64;
public static int MaxErrorMessageLength { get; set; } = 256;
public static int MaxExpressionLength { get; set; } = 1024;
}
}

18
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleEto.cs

@ -1,18 +0,0 @@
using System;
using Volo.Abp.Auditing;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesManagement
{
public class EntityRuleEto : IMultiTenant, ICreationAuditedObject, IModificationAuditedObject
{
public Guid Id { get; set; }
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string DisplayName { get; set; }
public Guid? LastModifierId { get; set; }
public DateTime? LastModificationTime { get; set; }
public DateTime CreationTime { get; set; }
public Guid? CreatorId { get; set; }
}
}

9
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleGroupConsts.cs

@ -1,9 +0,0 @@
namespace LINGYUN.Abp.RulesManagement
{
public static class EntityRuleGroupConsts
{
public static int MaxNameLength { get; set; } = 64;
public static int MaxDisplayNameLength { get; set; } = 256;
public static int MaxEntiyFullTypeNameLength { get; set; } = 256;
}
}

18
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleGroupEto.cs

@ -1,18 +0,0 @@
using System;
using Volo.Abp.Auditing;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesManagement
{
public class EntityRuleGroupEto : IMultiTenant, ICreationAuditedObject, IModificationAuditedObject
{
public Guid Id { get; set; }
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string DisplayName { get; set; }
public Guid? LastModifierId { get; set; }
public DateTime? LastModificationTime { get; set; }
public DateTime CreationTime { get; set; }
public Guid? CreatorId { get; set; }
}
}

8
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/EntityRuleParamConsts.cs

@ -1,8 +0,0 @@
namespace LINGYUN.Abp.RulesManagement
{
public static class EntityRuleParamConsts
{
public static int MaxNameLength { get; set; } = 64;
public static int MaxExpressionLength { get; set; } = 1024;
}
}

9
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain.Shared/LINGYUN/Abp/RulesManagement/Localization/RulesResource.cs

@ -1,9 +0,0 @@
using Volo.Abp.Localization;
namespace LINGYUN.Abp.RulesManagement.Localization
{
[LocalizationResourceName("AbpRulesManagement")]
public class RulesResource
{
}
}

20
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN.Abp.RulesManagement.Domain.csproj

@ -1,20 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="4.4.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\common\LINGYUN.Abp.Rules\LINGYUN.Abp.Rules.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.RulesManagement.Domain.Shared\LINGYUN.Abp.RulesManagement.Domain.Shared.csproj" />
</ItemGroup>
</Project>

31
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/AbpRulesManagementDomainModule.cs

@ -1,31 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Domain;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.RulesManagement
{
[DependsOn(
typeof(AbpDddDomainModule),
typeof(AbpAutoMapperModule),
typeof(AbpRulesManagementDomainSharedModule))]
public class AbpRulesManagementDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<AbpRulesManagementDomainModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<RulesManagementMapperProfile>(validate: true);
});
Configure<AbpDistributedEntityEventOptions>(options =>
{
options.EtoMappings.Add<EntityRule, EntityRuleEto>(typeof(AbpRulesManagementDomainModule));
options.EtoMappings.Add<EntityRuleInGroup, EntityRuleGroupEto>(typeof(AbpRulesManagementDomainModule));
});
}
}
}

163
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRule.cs

@ -1,163 +0,0 @@
using JetBrains.Annotations;
using LINGYUN.Abp.Rules;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesManagement
{
public class EntityRule : FullAuditedAggregateRoot<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
/// <summary>
/// 规则名称
/// </summary>
public virtual string Name { get; protected set; }
/// <summary>
/// 显示名称
/// </summary>
public virtual string DisplayName { get; protected set; }
/// <summary>
/// 操作类型
/// </summary>
public virtual string Operator { get; protected set; }
/// <summary>
/// 错误提示
/// </summary>
public virtual string ErrorMessage { get; protected set; }
/// <summary>
/// 错误类型
/// </summary>
public virtual ErrorType ErrorType { get; protected set; }
/// <summary>
/// 表达式类型
/// </summary>
public virtual ExpressionType? ExpressionType { get; set; }
/// <summary>
/// 所属规则
/// </summary>
public virtual Guid? ParentId { get; protected set; }
public virtual ICollection<EntitySubRule> SubRules { get; protected set; }
public virtual ICollection<EntityRuleInject> InjectRules { get; protected set; }
public virtual ICollection<EntityRuleParam> Params { get; protected set; }
public virtual string Expression { get; protected set; }
protected EntityRule()
{
}
public EntityRule(
[NotNull] Guid id,
[NotNull] string name,
[CanBeNull] string operation,
[CanBeNull] string displayName,
[CanBeNull] Guid? parentId = null,
[CanBeNull] Guid? tenantId = null)
{
Check.NotNull(id, nameof(id));
Check.NotNullOrWhiteSpace(name, nameof(name), EntityRuleConsts.MaxNameLength);
Id = id;
Name = name;
Operator = operation;
DisplayName = displayName;
ParentId = parentId;
TenantId = tenantId;
ExpressionType = Abp.Rules.ExpressionType.LambdaExpression;
Params = new Collection<EntityRuleParam>();
SubRules = new Collection<EntitySubRule>();
InjectRules = new Collection<EntityRuleInject>();
ExtraProperties = new Dictionary<string, object>();
}
public virtual void SetErrorInfomation(string errorMessage, ErrorType errorType = ErrorType.Warning)
{
ErrorType = errorType;
ErrorMessage = errorMessage;
}
public virtual void AddParamter([NotNull] IGuidGenerator guidGenerator, [NotNull] string name, [NotNull] string expression)
{
Check.NotNull(guidGenerator, nameof(guidGenerator));
if (Params.Any(p => p.Name == name))
{
return;
}
Params.Add(new EntityRuleParam(guidGenerator.Create(), Id, name, expression, TenantId));
}
public virtual void RemoveParamter([NotNull] string name)
{
Check.NotNullOrWhiteSpace(name, nameof(name));
Params.RemoveAll(p => p.Name == name);
}
public virtual void AddInjectRule([NotNull] EntityRule rule)
{
Check.NotNull(rule, nameof(rule));
if (IsInjectRule(rule.Id))
{
return;
}
InjectRules.Add(new EntityRuleInject(rule.Id, Id, TenantId));
}
public virtual void RemoveInjectRule([NotNull] Guid ruleId)
{
Check.NotNull(ruleId, nameof(ruleId));
if (IsInjectRule(ruleId))
{
return;
}
InjectRules.RemoveAll(rule => rule.RuleId == ruleId);
}
public virtual bool IsInjectRule([NotNull] Guid ruleId)
{
Check.NotNull(ruleId, nameof(ruleId));
return InjectRules.Any(rule => rule.RuleId == ruleId);
}
public virtual void AddSubRule([NotNull] EntityRule rule)
{
Check.NotNull(rule, nameof(rule));
if (IsInRule(rule.Id))
{
return;
}
SubRules.Add(new EntitySubRule(Id, rule.Id, TenantId));
}
public virtual void RemoveSubRule([NotNull] Guid ruleId)
{
Check.NotNull(ruleId, nameof(ruleId));
if (!IsInRule(ruleId))
{
return;
}
SubRules.RemoveAll(r => r.SubId == ruleId);
}
public virtual bool IsInRule([NotNull] Guid ruleId)
{
Check.NotNull(ruleId, nameof(ruleId));
return SubRules.Any(r => r.SubId == ruleId);
}
}
}

34
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleDataSeeder.cs

@ -1,34 +0,0 @@
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesManagement
{
public class EntityRuleDataSeeder : IEntityRuleDataSeeder, ITransientDependency
{
protected IGuidGenerator GuidGenerator { get; }
protected ICurrentTenant CurrentTenant { get; }
protected IEntityRuleGroupRepository Repository { get; }
public EntityRuleDataSeeder(
IGuidGenerator guidGenerator,
ICurrentTenant currentTenant,
IEntityRuleGroupRepository repository)
{
GuidGenerator = guidGenerator;
CurrentTenant = currentTenant;
Repository = repository;
}
public async virtual Task SeedAsync(EntityRuleInGroup group)
{
var findGroup = await Repository.GetByNameAsync(group.Name);
if (findGroup != null)
{
return;
}
await Repository.InsertAsync(group);
}
}
}

131
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleFinder.cs

@ -1,131 +0,0 @@
using LINGYUN.Abp.Rules;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Services;
using Volo.Abp.ObjectMapping;
namespace LINGYUN.Abp.RulesManagement
{
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)]
[ExposeServices(typeof(IRuleFinder))]
public class EntityRuleFinder : DomainService, IRuleFinder
{
private IObjectMapper _objectMapper;
protected IObjectMapper ObjectMapper => LazyGetRequiredService(ref _objectMapper);
private IEntityRuleGroupRepository _ruleGroupRepository;
protected IEntityRuleGroupRepository RuleGroupRepository => LazyGetRequiredService(ref _ruleGroupRepository);
private IEntityRuleRepository _rruleRepository;
protected IEntityRuleRepository RuleRepository => LazyGetRequiredService(ref _rruleRepository);
public async virtual Task<List<RuleGroup>> GetRuleGroupsAsync(Type entityType)
{
var entityFullTypeName = entityType.FullName;
if (entityType.IsGenericType)
{
entityFullTypeName = entityType.GetGenericTypeDefinition().FullName;
}
else if (entityType.IsArray)
{
entityFullTypeName = entityType.GetElementType().FullName;
}
var entityRuleGroups = await RuleGroupRepository.GetListByTypeAsync(entityFullTypeName, includeDetails: true);
var ruleGroups = ObjectMapper.Map<List<EntityRuleGroup>, List<RuleGroup>>(entityRuleGroups);
foreach(var group in ruleGroups)
{
var entityRuleGroup = entityRuleGroups.Find(g => g.Name.Equals(group.Name));
if (entityRuleGroup != null)
{
foreach(var ruleInGroup in entityRuleGroup.Rules)
{
await AddRuleAsync(group, ruleInGroup.RuleId);
}
foreach(var ruleInject in entityRuleGroup.InjectRules)
{
await AddToInjectRuleAsync(group, ruleInject.RuleId);
}
}
}
return ruleGroups;
}
protected async virtual Task AddRuleAsync(RuleGroup ruleGroup, Guid ruleId)
{
var entityRule = await RuleRepository.FindAsync(ruleId);
if (entityRule == null)
{
return;
}
var rule = ObjectMapper.Map<EntityRule, Rule>(entityRule);
ruleGroup.WithRule(rule);
foreach (var subEntityRule in entityRule.SubRules)
{
await AddSubRuleAsync(rule, subEntityRule.SubId);
}
foreach (var ruleInject in entityRule.InjectRules)
{
// 如果依赖于某个规则,需要把此规则添加到集合
await AddRuleAsync(ruleGroup, ruleInject.InjectId);
// 添加依赖规则
await AddToInjectRuleAsync(ruleGroup, ruleInject.InjectId);
}
}
protected async virtual Task AddSubRuleAsync(Rule rule, Guid subRuleId)
{
var entityRule = await RuleRepository.FindAsync(subRuleId);
if (entityRule == null)
{
return;
}
var subRule = ObjectMapper.Map<EntityRule, Rule>(entityRule);
rule.CreateChildren(subRule);
foreach (var subEntityRule in entityRule.SubRules)
{
await AddSubRuleAsync(subRule, subEntityRule.SubId);
}
}
protected async virtual Task AddToInjectRuleAsync(RuleGroup group, Guid ruleId)
{
var entityRule = await RuleRepository.FindAsync(ruleId);
if (entityRule == null)
{
return;
}
group.WithInjectRule(entityRule.Name);
foreach (var injectRule in entityRule.InjectRules)
{
await AddToInjectRuleAsync(group, injectRule.InjectId);
}
}
protected async virtual Task AddToInjectRuleAsync(Rule rule, Guid ruleId)
{
var entityRule = await RuleRepository.FindAsync(ruleId);
if (entityRule == null)
{
return;
}
var injectRule = ObjectMapper.Map<EntityRule, Rule>(entityRule);
rule.CreateChildren(injectRule);
rule.InjectRule(entityRule.Name);
foreach (var injectSubRule in entityRule.InjectRules)
{
await AddToInjectRuleAsync(injectRule, injectSubRule.InjectId);
}
}
}
}

103
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleGroup.cs

@ -1,103 +0,0 @@
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesManagement
{
public class EntityRuleGroup : FullAuditedAggregateRoot<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual string Name { get; protected set; }
public virtual string DisplayName { get; protected set; }
public virtual string EntityFullTypeName { get; protected set; }
public virtual ICollection<EntityRuleInGroup> Rules { get; protected set; }
public virtual ICollection<EntityRuleInject> InjectRules { get; protected set; }
protected EntityRuleGroup()
{
}
public EntityRuleGroup(
[NotNull] Guid id,
[NotNull] string name,
[NotNull] string entiyFullTypeName,
[CanBeNull] string displayName,
[CanBeNull] Guid? tenantId = null)
{
Check.NotNull(id, nameof(id));
Check.NotNullOrWhiteSpace(name, nameof(name), EntityRuleGroupConsts.MaxNameLength);
Check.NotNullOrWhiteSpace(entiyFullTypeName, nameof(entiyFullTypeName), EntityRuleGroupConsts.MaxEntiyFullTypeNameLength);
Id = id;
Name = name;
DisplayName = displayName;
TenantId = tenantId;
Rules = new Collection<EntityRuleInGroup>();
InjectRules = new Collection<EntityRuleInject>();
ExtraProperties = new Dictionary<string, object>();
}
public virtual void AddInjectRule([NotNull] EntityRule rule)
{
Check.NotNull(rule, nameof(rule));
if (IsInjectRule(rule.Id))
{
return;
}
InjectRules.Add(new EntityRuleInject(rule.Id, Id, TenantId));
}
public virtual void RemoveInjectRule([NotNull] Guid ruleId)
{
Check.NotNull(ruleId, nameof(ruleId));
if (IsInjectRule(ruleId))
{
return;
}
InjectRules.RemoveAll(rule => rule.RuleId == ruleId);
}
public virtual bool IsInjectRule([NotNull] Guid ruleId)
{
Check.NotNull(ruleId, nameof(ruleId));
return InjectRules.Any(rule => rule.RuleId == ruleId);
}
public virtual void AddRule([NotNull] EntityRule rule)
{
Check.NotNull(rule, nameof(rule));
if (IsInRule(rule.Id))
{
return;
}
Rules.Add(new EntityRuleInGroup(rule.Id, Id, TenantId));
}
public virtual void RemoveRule([NotNull] Guid ruleId)
{
Check.NotNull(ruleId, nameof(ruleId));
if (!IsInRule(ruleId))
{
return;
}
Rules.RemoveAll(r => r.RuleId == ruleId);
}
public virtual bool IsInRule([NotNull] Guid ruleId)
{
Check.NotNull(ruleId, nameof(ruleId));
return Rules.Any(r => r.RuleId == ruleId);
}
}
}

35
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleInGroup.cs

@ -1,35 +0,0 @@
using JetBrains.Annotations;
using System;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesManagement
{
public class EntityRuleInGroup : Entity, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid RuleId { get; protected set; }
public virtual Guid GroupId { get; protected set; }
protected EntityRuleInGroup()
{
}
public EntityRuleInGroup(
[NotNull] Guid ruleId,
[NotNull] Guid groupId,
[CanBeNull] Guid? tenantId = null)
{
Check.NotNull(ruleId, nameof(ruleId));
Check.NotNull(groupId, nameof(groupId));
RuleId = ruleId;
GroupId = groupId;
TenantId = tenantId;
}
public override object[] GetKeys()
{
return new object[] { RuleId, GroupId };
}
}
}

39
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleInject.cs

@ -1,39 +0,0 @@
using JetBrains.Annotations;
using System;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesManagement
{
public class EntityRuleInject : Entity, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
/// <summary>
/// 规则标识
/// </summary>
public virtual Guid RuleId { get; protected set; }
/// <summary>
/// 依赖的规则标识
/// </summary>
public virtual Guid InjectId { get; protected set; }
protected EntityRuleInject() { }
public EntityRuleInject(
[NotNull] Guid ruleId,
[NotNull] Guid injectId,
[CanBeNull] Guid? tenantId = null)
{
Check.NotNull(ruleId, nameof(ruleId));
Check.NotNull(injectId, nameof(injectId));
RuleId = ruleId;
InjectId = injectId;
TenantId = tenantId;
}
public override object[] GetKeys()
{
return new object[] { RuleId , InjectId };
}
}
}

44
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntityRuleParam.cs

@ -1,44 +0,0 @@
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesManagement
{
public class EntityRuleParam : Entity<Guid>, IMultiTenant, IHasExtraProperties
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid RuleId { get; protected set; }
public virtual string Name { get; protected set; }
public virtual string Expression { get; protected set; }
public virtual Dictionary<string, object> ExtraProperties { get; protected set; }
protected EntityRuleParam()
{
}
public EntityRuleParam(
[NotNull] Guid id,
[NotNull] Guid ruleId,
[NotNull] string name,
[NotNull] string expression,
[CanBeNull] Guid? tenantId = null)
{
Check.NotNull(id, nameof(id));
Check.NotNull(ruleId, nameof(ruleId));
Check.NotNullOrWhiteSpace(name, nameof(name), EntityRuleParamConsts.MaxNameLength);
Check.NotNullOrWhiteSpace(expression, nameof(expression), EntityRuleParamConsts.MaxExpressionLength);
Id = id;
RuleId = ruleId;
Name = name;
Expression = expression;
TenantId = tenantId;
ExtraProperties = new Dictionary<string, object>();
}
}
}

35
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/EntitySubRule.cs

@ -1,35 +0,0 @@
using JetBrains.Annotations;
using System;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesManagement
{
public class EntitySubRule : Entity, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid RuleId { get; protected set; }
public virtual Guid SubId { get; protected set; }
protected EntitySubRule()
{
}
public EntitySubRule(
[NotNull] Guid ruleId,
[NotNull] Guid subId,
[CanBeNull] Guid? tenantId = null)
{
Check.NotNull(ruleId, nameof(ruleId));
Check.NotNull(subId, nameof(subId));
RuleId = ruleId;
SubId = subId;
TenantId = tenantId;
}
public override object[] GetKeys()
{
return new object[] { RuleId, SubId };
}
}
}

9
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/IEntityRuleDataSeeder.cs

@ -1,9 +0,0 @@
using System.Threading.Tasks;
namespace LINGYUN.Abp.RulesManagement
{
public interface IEntityRuleDataSeeder
{
Task SeedAsync(EntityRuleInGroup group);
}
}

40
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/IEntityRuleGroupRepository.cs

@ -1,40 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
namespace LINGYUN.Abp.RulesManagement
{
public interface IEntityRuleGroupRepository : IBasicRepository<EntityRuleGroup, Guid>
{
Task<EntityRuleGroup> GetByNameAsync(
string name,
bool includeDetails = false,
CancellationToken cancellationToken = default
);
Task<List<EntityRuleGroup>> GetListByTypeAsync(
string entityFullTypeName,
string sorting = null,
bool includeDetails = false,
CancellationToken cancellationToken = default);
Task<List<EntityRule>> GetRulesAsync(
Guid groupId,
bool includeDetails = false,
CancellationToken cancellationToken = default);
Task<long> GetCountAsync(
string filter = null,
CancellationToken cancellationToken = default);
Task<List<EntityRuleGroup>> GetListAsync(
string filter = null,
string sorting = null,
int skipCount = 1,
int maxResultCount = 10,
bool includeDetails = false,
CancellationToken cancellationToken = default);
}
}

35
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/IEntityRuleRepository.cs

@ -1,35 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
namespace LINGYUN.Abp.RulesManagement
{
public interface IEntityRuleRepository : IBasicRepository<EntityRule, Guid>
{
Task<List<string>> GetInjectRuleNamesAsync(
Guid ruleId,
bool includeDetails = false,
CancellationToken cancellationToken = default
);
Task<List<EntityRule>> GetInjectRulesAsync(
Guid ruleId,
bool includeDetails = false,
CancellationToken cancellationToken = default
);
Task<long> GetCountAsync(
string filter = null,
CancellationToken cancellationToken = default);
Task<List<EntityRule>> GetListAsync(
string filter = null,
string sorting = null,
int skipCount = 1,
int maxResultCount = 10,
bool includeDetails = false,
CancellationToken cancellationToken = default);
}
}

13
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/RulesManagementDbProperties.cs

@ -1,13 +0,0 @@
using Volo.Abp.Data;
namespace LINGYUN.Abp.RulesManagement
{
public static class RulesManagementDbProperties
{
public static string DbTablePrefix { get; set; } = "App";
public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema;
public const string ConnectionStringName = "AppRulesManagement";
}
}

22
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.Domain/LINGYUN/Abp/RulesManagement/RulesManagementMapperProfile.cs

@ -1,22 +0,0 @@
using AutoMapper;
using LINGYUN.Abp.Rules;
namespace LINGYUN.Abp.RulesManagement
{
public class RulesManagementMapperProfile : Profile
{
public RulesManagementMapperProfile()
{
CreateMap<EntityRuleParam, RuleParam>();
CreateMap<EntityRule, Rule>()
.ForMember(rule => rule.InjectRules, map => map.Ignore())
.ForMember(rule => rule.Rules, map => map.Ignore());
CreateMap<EntityRuleGroup, RuleGroup>()
.ForMember(rule => rule.InjectRules, map => map.Ignore())
.ForMember(rule => rule.Rules, map => map.Ignore());
CreateMap<EntityRule, EntityRuleEto>();
CreateMap<EntityRuleGroup, EntityRuleGroupEto>();
}
}
}

18
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN.Abp.RulesManagement.EntityFrameworkCore.csproj

@ -1,18 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="4.4.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="LINGYUN\Abp\RulesManagement\" />
</ItemGroup>
</Project>

21
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/AbpRulesManagementEntityFrameworkCoreModule.cs

@ -1,21 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.RulesManagement.EntityFrameworkCore
{
[DependsOn(
typeof(AbpRulesManagementDomainModule),
typeof(AbpEntityFrameworkCoreModule))]
public class AbpRulesManagementEntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<RulesManagementDbContext>(options =>
{
options.AddRepository<EntityRule, EfCoreEntityRuleRepository>();
options.AddRepository<EntityRuleInGroup, EfCoreEntityRuleGroupRepository>();
});
}
}
}

98
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/EfCoreEntityRuleGroupRepository.cs

@ -1,98 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.RulesManagement.EntityFrameworkCore
{
public class EfCoreEntityRuleGroupRepository : EfCoreRepository<IRulesManagementDbContext, EntityRuleGroup, Guid>, IEntityRuleGroupRepository
{
public EfCoreEntityRuleGroupRepository(
IDbContextProvider<IRulesManagementDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public async virtual Task<EntityRuleGroup> GetByNameAsync(
string name,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
return await this
.Where(ug => ug.Name.Equals(name))
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
}
public async virtual Task<List<EntityRule>> GetRulesAsync(
Guid groupId,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
var query = from ruleGroup in DbContext.Set<EntityRuleInGroup>()
join rule in DbContext.EntityRules.IncludeDetails(includeDetails) on ruleGroup.RuleId equals rule.Id
where ruleGroup.GroupId == groupId
select rule;
return await query.ToListAsync(GetCancellationToken(cancellationToken));
}
public async virtual Task<long> GetCountAsync(
string filter = null,
CancellationToken cancellationToken = default)
{
return await this.WhereIf(
!filter.IsNullOrWhiteSpace(),
rg =>
rg.Name.Contains(filter) ||
rg.DisplayName.Contains(filter) ||
rg.EntityFullTypeName.Contains(filter)
)
.LongCountAsync(GetCancellationToken(cancellationToken));
}
public async virtual Task<List<EntityRuleGroup>> GetListByTypeAsync(
string entityFullTypeName,
string sorting = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
return await DbSet
.IncludeDetails(includeDetails)
.Where(ug => ug.EntityFullTypeName.Equals(entityFullTypeName))
.OrderBy(sorting ?? nameof(EntityRuleGroup.CreationTime))
.ToListAsync(GetCancellationToken(cancellationToken));
}
public async virtual Task<List<EntityRuleGroup>> GetListAsync(
string filter = null,
string sorting = null,
int skipCount = 1,
int maxResultCount = 10,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
return await DbSet
.IncludeDetails(includeDetails)
.WhereIf(
!filter.IsNullOrWhiteSpace(),
rg =>
rg.Name.Contains(filter) ||
rg.DisplayName.Contains(filter) ||
rg.EntityFullTypeName.Contains(filter)
)
.OrderBy(sorting ?? nameof(EntityRuleGroup.CreationTime))
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}
public override IQueryable<EntityRuleGroup> WithDetails()
{
return GetQueryable().IncludeDetails();
}
}
}

76
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/EfCoreEntityRuleRepository.cs

@ -1,76 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.RulesManagement.EntityFrameworkCore
{
public class EfCoreEntityRuleRepository : EfCoreRepository<IRulesManagementDbContext, EntityRule, Guid>, IEntityRuleRepository
{
public EfCoreEntityRuleRepository(
IDbContextProvider<IRulesManagementDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public async virtual Task<List<EntityRule>> GetInjectRulesAsync(
Guid ruleId,
bool includeDetails = false,
CancellationToken cancellationToken = default
)
{
var query = from injectRule in DbContext.Set<EntityRuleInject>()
join rule in DbContext.EntityRules.IncludeDetails(includeDetails) on injectRule.InjectId equals rule.Id
where injectRule.RuleId == ruleId
select rule;
return await query.ToListAsync(GetCancellationToken(cancellationToken));
}
public async virtual Task<long> GetCountAsync(
string filter = null,
CancellationToken cancellationToken = default)
{
return await this
.WhereIf(
!filter.IsNullOrWhiteSpace(),
rg =>
rg.Name.Contains(filter) ||
rg.DisplayName.Contains(filter) ||
rg.Operator.Contains(filter)
)
.LongCountAsync(GetCancellationToken(cancellationToken));
}
public async virtual Task<List<EntityRule>> GetListAsync(
string filter = null,
string sorting = null,
int skipCount = 1,
int maxResultCount = 10,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
return await this
.WhereIf(
!filter.IsNullOrWhiteSpace(),
rg =>
rg.Name.Contains(filter) ||
rg.DisplayName.Contains(filter) ||
rg.Operator.Contains(filter)
)
.OrderBy(sorting ?? nameof(EntityRule.CreationTime))
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}
public override IQueryable<EntityRule> WithDetails()
{
return GetQueryable().IncludeDetails();
}
}
}

13
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/IRulesManagementDbContext.cs

@ -1,13 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.RulesManagement.EntityFrameworkCore
{
[ConnectionStringName(RulesManagementDbProperties.ConnectionStringName)]
public interface IRulesManagementDbContext : IEfCoreDbContext
{
DbSet<EntityRule> EntityRules { get; set; }
DbSet<EntityRuleGroup> EntityRuleGroups { get; set; }
}
}

25
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/RulesManagementDbContext.cs

@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.RulesManagement.EntityFrameworkCore
{
[ConnectionStringName(RulesManagementDbProperties.ConnectionStringName)]
public class RulesManagementDbContext : AbpDbContext<RulesManagementDbContext>, IRulesManagementDbContext
{
public DbSet<EntityRule> EntityRules { get; set; }
public DbSet<EntityRuleGroup> EntityRuleGroups { get; set; }
public RulesManagementDbContext(
DbContextOptions<RulesManagementDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ConfigureRulesManagement();
}
}
}

81
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/RulesManagementDbContextModelBuilderExtensions.cs

@ -1,81 +0,0 @@
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using System;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace LINGYUN.Abp.RulesManagement.EntityFrameworkCore
{
public static class RulesManagementDbContextModelBuilderExtensions
{
public static void ConfigureRulesManagement(
[NotNull] this ModelBuilder builder,
[CanBeNull] Action<RulesManagementModelBuilderConfigurationOptions> optionsAction = null)
{
Check.NotNull(builder, nameof(builder));
var options = new RulesManagementModelBuilderConfigurationOptions(
RulesManagementDbProperties.DbTablePrefix,
RulesManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<EntityRuleParam>(b =>
{
b.ToTable(options.TablePrefix + "EntityRuleParams", options.Schema);
b.ConfigureMultiTenant();
b.ConfigureExtraProperties();
b.Property(x => x.Id).ValueGeneratedNever();
b.Property(rp => rp.Name).HasMaxLength(EntityRuleParamConsts.MaxNameLength).IsRequired();
b.Property(rp => rp.Expression).HasMaxLength(EntityRuleParamConsts.MaxExpressionLength).IsRequired();
b.HasIndex(rp => rp.Name);
});
builder.Entity<EntityRule>(b =>
{
b.ToTable(options.TablePrefix + "EntityRules", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Id).ValueGeneratedNever();
b.Property(r => r.Name).HasMaxLength(EntityRuleConsts.MaxNameLength).IsRequired();
b.Property(r => r.Expression).HasMaxLength(EntityRuleConsts.MaxExpressionLength).IsRequired();
b.Property(r => r.Operator).HasMaxLength(EntityRuleConsts.MaxOperatorLength);
b.Property(r => r.DisplayName).HasMaxLength(EntityRuleConsts.MaxDisplayNameLength);
b.Property(r => r.ErrorMessage).HasMaxLength(EntityRuleConsts.MaxErrorMessageLength);
b.HasMany(r => r.SubRules).WithOne().HasForeignKey(r => r.RuleId).IsRequired();
b.HasMany(r => r.InjectRules).WithOne().HasForeignKey(r => r.InjectId).IsRequired();
b.HasMany(r => r.Params).WithOne().HasForeignKey(r => r.RuleId).IsRequired();
b.HasIndex(r => r.Name);
});
builder.Entity<EntityRuleGroup>(b =>
{
b.ToTable(options.TablePrefix + "EntityRuleGroups", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Id).ValueGeneratedNever();
b.Property(rg => rg.Name).HasMaxLength(EntityRuleGroupConsts.MaxNameLength).IsRequired();
b.Property(rg => rg.EntityFullTypeName).HasMaxLength(EntityRuleGroupConsts.MaxEntiyFullTypeNameLength).IsRequired();
b.Property(rg => rg.DisplayName).HasMaxLength(EntityRuleGroupConsts.MaxDisplayNameLength);
b.HasMany(rg => rg.Rules).WithOne().HasForeignKey(rg => rg.GroupId).IsRequired();
b.HasMany(rg => rg.InjectRules).WithOne().HasForeignKey(rg => rg.InjectId).IsRequired();
b.HasIndex(uc => uc.Name);
});
}
}
}

32
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/RulesManagementEfCoreQueryableExtensions.cs

@ -1,32 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System.Linq;
namespace LINGYUN.Abp.RulesManagement.EntityFrameworkCore
{
public static class RulesManagementEfCoreQueryableExtensions
{
public static IQueryable<EntityRuleGroup> IncludeDetails(this IQueryable<EntityRuleGroup> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable
.Include(x => x.Rules)
.Include(x => x.InjectRules);
}
public static IQueryable<EntityRule> IncludeDetails(this IQueryable<EntityRule> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable
.Include(x => x.InjectRules)
.Include(x => x.Params);
}
}
}

15
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.EntityFrameworkCore/LINGYUN/Abp/RulesManagement/EntityFrameworkCore/RulesManagementModelBuilderConfigurationOptions.cs

@ -1,15 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace LINGYUN.Abp.RulesManagement.EntityFrameworkCore
{
public class RulesManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public RulesManagementModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(tablePrefix, schema)
{
}
}
}

8
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.HttpApi.Client/Class1.cs

@ -1,8 +0,0 @@
using System;
namespace LINGYUN.Abp.RulesManagement.HttpApi.Client
{
public class Class1
{
}
}

18
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.HttpApi.Client/LINGYUN.Abp.RulesManagement.HttpApi.Client.csproj

@ -1,18 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="4.4.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="LINGYUN\Abp\RulesManagement\" />
</ItemGroup>
</Project>

8
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.HttpApi/Class1.cs

@ -1,8 +0,0 @@
using System;
namespace LINGYUN.Abp.RulesManagement.HttpApi
{
public class Class1
{
}
}

18
aspnet-core/modules/rules-management/LINGYUN.Abp.RulesManagement.HttpApi/LINGYUN.Abp.RulesManagement.HttpApi.csproj

@ -1,18 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.4.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="LINGYUN\Abp\RulesManagement\" />
</ItemGroup>
</Project>

3
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

19
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.RulesEngineManagement.Domain.Shared\LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj" />
</ItemGroup>
</Project>

12
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/LINGYUN/Abp/RulesEngineManagement/RulesEngineManagementApplicationContractsModule.cs

@ -0,0 +1,12 @@
using Volo.Abp.Application;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.RulesEngineManagement;
[DependsOn(
typeof(RulesEngineManagementDomainSharedModule),
typeof(AbpDddApplicationContractsModule))]
public class RulesEngineManagementApplicationContractsModule : AbpModule
{
}

3
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

20
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/LINGYUN.Abp.RulesEngineManagement.Application.csproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.RulesEngineManagement.Application.Contracts\LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.RulesEngineManagement.Domain\LINGYUN.Abp.RulesEngineManagement.Domain.csproj" />
</ItemGroup>
</Project>

13
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/LINGYUN/Abp/RulesEngineManagement/RulesEngineManagementApplicationModule.cs

@ -0,0 +1,13 @@
using Volo.Abp.Application;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.RulesEngineManagement;
[DependsOn(
typeof(RulesEngineManagementApplicationContractsModule),
typeof(RulesEngineManagementDomainModule),
typeof(AbpDddApplicationModule))]
public class RulesEngineManagementApplicationModule : AbpModule
{
}

3
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

16
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Features" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.Validation" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
</Project>

5
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/ActionRecordConsts.cs

@ -0,0 +1,5 @@
namespace LINGYUN.Abp.RulesEngineManagement;
public static class ActionRecordConsts
{
public static int MaxNameLength { get; set; } = 64;
}

6
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/ActionType.cs

@ -0,0 +1,6 @@
namespace LINGYUN.Abp.RulesEngineManagement;
public enum ActionType : byte
{
Success = 0,
Failure = 1,
}

6
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/ParamRecordConsts.cs

@ -0,0 +1,6 @@
namespace LINGYUN.Abp.RulesEngineManagement;
public static class ParamRecordConsts
{
public static int MaxNameLength { get; set; } = 64;
public static int MaxExpressionLength { get; set; } = int.MaxValue;
}

10
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/RuleRecordConsts.cs

@ -0,0 +1,10 @@
namespace LINGYUN.Abp.RulesEngineManagement;
public static class RuleRecordConsts
{
public static int MaxNameLength { get; set; } = 64;
public static int MaxOperatorLength { get; set; } = 30;
public static int MaxErrorMessageLength { get; set; } = 255;
public static int MaxInjectWorkflowsLength { get; set; } = (MaxNameLength + 1) * 5;
public static int MaxExpressionLength { get; set; } = int.MaxValue;
public static int MaxSuccessEventLength { get; set; } = 128;
}

13
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/RulesEngineManagementDomainSharedModule.cs

@ -0,0 +1,13 @@
using Volo.Abp.Features;
using Volo.Abp.Modularity;
using Volo.Abp.Validation;
namespace LINGYUN.Abp.RulesEngineManagement;
[DependsOn(
typeof(AbpFeaturesModule),
typeof(AbpValidationModule))]
public class RulesEngineManagementDomainSharedModule : AbpModule
{
}

7
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN/Abp/RulesEngineManagement/WorkflowRecordConsts.cs

@ -0,0 +1,7 @@
namespace LINGYUN.Abp.RulesEngineManagement;
public static class WorkflowRecordConsts
{
public static int MaxNameLength { get; set; } = 64;
public static int MaxTypeFullNameLength { get; set; } = 255;
public static int MaxInjectWorkflowsLength { get; set; } = (MaxNameLength + 1) * 5;
}

3
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

20
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN.Abp.RulesEngineManagement.Domain.csproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\rules\LINGYUN.Abp.Rules.RulesEngine\LINGYUN.Abp.Rules.RulesEngine.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.RulesEngineManagement.Domain.Shared\LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj" />
</ItemGroup>
</Project>

32
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/ActionRecord.cs

@ -0,0 +1,32 @@
using System;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesEngineManagement;
public class ActionRecord : Entity<Guid>, IMultiTenant, IHasExtraProperties
{
public virtual Guid? TenantId { get; protected set; }
public virtual string Name { get; protected set; }
public virtual ExtraPropertyDictionary ExtraProperties { get; protected set; }
protected ActionRecord()
{
ExtraProperties = new ExtraPropertyDictionary();
this.SetDefaultsForExtraProperties();
}
public ActionRecord(
Guid id,
string name,
Guid? tenantId = null)
: base(id)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name), ActionRecordConsts.MaxNameLength);
TenantId = tenantId;
ExtraProperties = new ExtraPropertyDictionary();
this.SetDefaultsForExtraProperties();
}
}

22
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/IRuleRecordRepository.cs

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
namespace LINGYUN.Abp.RulesEngineManagement;
public interface IRuleRecordRepository : IRepository<RuleRecord, Guid>
{
Task<List<RuleRecord>> GetChildrenRulesAsync(
Guid ruleId,
CancellationToken cancellationToken = default);
Task<List<ParamRecord>> GetParamsAsync(
Guid ruleId,
CancellationToken cancellationToken = default);
Task<ActionRecord> GetSuccessActionAsync(
Guid ruleId,
CancellationToken cancellationToken = default);
Task<ActionRecord> GetFailureActionAsync(
Guid ruleId,
CancellationToken cancellationToken = default);
}

21
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/IWorkflowRecordRepository.cs

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
namespace LINGYUN.Abp.RulesEngineManagement;
public interface IWorkflowRecordRepository : IRepository<WorkflowRecord, Guid>
{
Task<WorkflowRecord> FindByNameAsync(
string name,
CancellationToken cancellationToken = default);
Task<List<WorkflowRecord>> GetListAsync(
string typeFullName,
CancellationToken cancellationToken = default);
Task<List<ParamRecord>> GetParamsAsync(
Guid workflowId,
CancellationToken cancellationToken = default);
}

24
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/ParamRecord.cs

@ -0,0 +1,24 @@
using System;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesEngineManagement;
public class ParamRecord : Entity<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual string Name { get; protected set; }
public virtual string Expression { get; protected set; }
protected ParamRecord()
{
}
public ParamRecord(Guid id, string name, string expression, Guid? tenantId = null)
: base(id)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name), ParamRecordConsts.MaxNameLength);
Expression = Check.NotNullOrWhiteSpace(expression, nameof(expression), ParamRecordConsts.MaxExpressionLength);
TenantId = tenantId;
}
}

24
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/RuleActionRecord.cs

@ -0,0 +1,24 @@
using System;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesEngineManagement;
public class RuleActionRecord : Entity<int>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid ActionId { get; protected set; }
public virtual Guid RuleId { get; protected set; }
public virtual ActionType ActionType { get; protected set; }
protected RuleActionRecord() { }
public RuleActionRecord(
Guid ruleId,
Guid actionId,
ActionType actionType,
Guid? tenantId = null)
{
RuleId = ruleId;
ActionId = actionId;
ActionType = actionType;
TenantId = tenantId;
}
}

18
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/RuleParamRecord.cs

@ -0,0 +1,18 @@
using System;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesEngineManagement;
public class RuleParamRecord : Entity<int>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid RuleId { get; protected set; }
public virtual Guid ParamId { get; protected set; }
protected RuleParamRecord() { }
public RuleParamRecord(Guid ruleId, Guid paramId, Guid? tenantId = null)
{
TenantId = tenantId;
RuleId = ruleId;
ParamId = paramId;
}
}

69
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/RuleRecord.cs

@ -0,0 +1,69 @@
using RulesEngine.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.RulesEngineManagement;
public class RuleRecord : AuditedAggregateRoot<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? ParentId { get; protected set; }
public virtual bool Enabled { get; set; }
public virtual string Name { get; protected set; }
public virtual string Operator { get; protected set; }
public virtual string ErrorMessage { get; protected set; }
public virtual RuleExpressionType RuleExpressionType { get; set; }
public virtual string InjectWorkflows { get; set; }
public virtual string Expression { get; protected set; }
public virtual string SuccessEvent { get; set; }
public virtual ICollection<RuleParamRecord> LocalParams { get; protected set; }
public virtual RuleActionRecord OnSuccess { get; protected set; }
public virtual RuleActionRecord OnFailure { get; protected set; }
protected RuleRecord()
{
ExtraProperties = new ExtraPropertyDictionary();
this.SetDefaultsForExtraProperties();
}
public RuleRecord(
Guid id,
string name,
string errorMessage,
string expression,
string @operator = null,
Guid? parentId = null,
Guid? tenantId = null)
: base(id)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name), RuleRecordConsts.MaxNameLength);
ErrorMessage = Check.NotNullOrWhiteSpace(errorMessage, nameof(errorMessage), RuleRecordConsts.MaxErrorMessageLength);
Expression = Check.NotNullOrWhiteSpace(expression, nameof(expression), RuleRecordConsts.MaxExpressionLength);
Operator = Check.Length(@operator, nameof(@operator), RuleRecordConsts.MaxOperatorLength);
ParentId = parentId;
TenantId = tenantId;
Enabled = true;
RuleExpressionType = RuleExpressionType.LambdaExpression;
LocalParams = new Collection<RuleParamRecord>();
ExtraProperties = new ExtraPropertyDictionary();
this.SetDefaultsForExtraProperties();
}
public void SetSuccessAction(ActionRecord action)
{
OnSuccess = new RuleActionRecord(Id, action.Id, ActionType.Success, TenantId);
}
public void SetFailureAction(ActionRecord action)
{
OnFailure = new RuleActionRecord(Id, action.Id, ActionType.Failure, TenantId);
}
}

12
aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN/Abp/RulesEngineManagement/RulesEngineManagementDbPropertites.cs

@ -0,0 +1,12 @@
using Volo.Abp.Data;
namespace LINGYUN.Abp.RulesEngineManagement;
public static class RulesEngineManagementDbPropertites
{
public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix + "RulesEngine";
public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema;
public const string ConnectionStringName = "RulesEngineManagement";
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save