From cdaf981a4cc6e174e15d3fb7c7acdf0e67c893d9 Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Thu, 25 Apr 2024 13:43:26 +0800 Subject: [PATCH 01/15] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Events/EntityChangedEvent.cs | 15 +++ .../Events/EntityCreatedDomainEvent.cs | 12 ++ .../Events/EntityDeletedDomainEvent.cs | 12 ++ .../Events/EntityModifiedDomainEvent.cs | 12 ++ .../UserFriendlyExceptionTest.cs | 4 +- .../MasaException.cs | 10 +- .../UserFriendlyException.cs | 5 + .../Consts/CacheKeyConsts.cs | 9 -- .../Consts/IdentityClaimConsts.cs | 15 --- .../Consts/PropertyConsts.cs | 9 -- .../Enum/AuthenticationTypes.cs | 9 -- .../Enum/GenderTypes.cs | 10 -- .../Enum/PasswordTypes.cs | 10 -- .../Enum/RegisterFieldTypes.cs | 15 --- .../Enum/SendEmailTypes.cs | 15 --- .../Enum/SendMsgCodeTypes.cs | 14 -- .../Enum/StaffTypes.cs | 10 -- .../Enum/SubjectTypes.cs | 12 -- .../Enum/TeamTypes.cs | 10 -- .../Enum/ThirdPartyIdpLoginResultTypes.cs | 10 -- .../Enum/ThirdPartyIdpTypes.cs | 13 -- .../Enum/UserRegisterTypes.cs | 12 -- ...dingBlocks.StackSdks.Auth.Contracts.csproj | 14 -- .../MasaUser.cs | 27 ---- .../Model/AddThirdPartyUserModel.cs | 17 --- .../Model/AddUserModel.cs | 34 ----- .../Model/AddressValueModel.cs | 33 ----- .../Model/AppModel.cs | 19 --- .../Model/BindUserRolesModel.cs | 11 -- .../Model/CollectMenuModel.cs | 11 -- .../Model/CustomLoginModel.cs | 17 --- .../Model/DisableUserModel.cs | 14 -- .../Model/GetImpersonateInputModel.cs | 11 -- .../Model/GetImpersonateOutputModel.cs | 13 -- .../Model/GetSystemDataModel.cs | 11 -- .../Model/GetThirdPartyUserByUserIdModel.cs | 13 -- .../Model/GetThirdPartyUserModel.cs | 13 -- .../Model/ImpersonateInputModel.cs | 11 -- .../Model/ImpersonateOutputModel.cs | 9 -- .../Model/LdapOptionsModel.cs | 34 ----- .../Model/LoginByLdapModel.cs | 19 --- .../Model/LoginByPasswordModel.cs | 19 --- .../Model/LoginByPhoneNumberFromSsoModel.cs | 19 --- .../Model/LoginByPhoneNumberModel.cs | 15 --- .../Model/LoginByThirdPartyIdpModel.cs | 21 --- .../Model/LoginByThirdPartyIdpResultModel.cs | 13 -- .../Model/MenuModel.cs | 21 --- .../Model/NavModel.cs | 17 --- .../Model/ProjectModel.cs | 15 --- .../Model/RegisterByEmailModel.cs | 16 --- .../Model/RegisterByPhoneModel.cs | 13 -- .../Model/RegisterFieldModel.cs | 13 -- .../Model/RegisterModel.cs | 21 --- .../Model/RegisterThirdPartyUserModel.cs | 13 -- .../RegisterThirdPartyUserResultModel.cs | 11 -- .../Model/RemoveUserModel.cs | 14 -- .../Model/RemoveUserRolesModel.cs | 11 -- .../Model/ResetPasswordByEmailModel.cs | 11 -- .../Model/ResetPasswordByPhoneModel.cs | 11 -- .../Model/ResetPasswordModel.cs | 11 -- .../Model/RoleModel.cs | 13 -- .../Model/SendEmailModel.cs | 23 ---- .../Model/SendMsgCodeModel.cs | 26 ---- .../Model/StaffDetailModel.cs | 16 --- .../Model/StaffModel.cs | 86 ------------ .../Model/SubjectModel.cs | 45 ------- .../Model/SubjectPermissionRelationModel.cs | 27 ---- .../Model/TeamDetailModel.cs | 51 ------- .../Model/TeamModel.cs | 19 --- .../Model/TeamPersonnelModel.cs | 20 --- .../Model/ThirdPartyIdentityModel.cs | 78 ----------- .../Model/ThirdPartyIdpModel.cs | 35 ----- .../Model/TokenModel.cs | 15 --- .../Model/UnbindUserRolesModel.cs | 11 -- .../Model/UpdateCurrentTeamModel.cs | 11 -- .../Model/UpdateStaffAvatarModel.cs | 21 --- .../Model/UpdateStaffBasicInfoModel.cs | 19 --- .../Model/UpdateUserAvatarModel.cs | 21 --- .../Model/UpdateUserBasicInfoModel.cs | 25 ---- .../Model/UpdateUserEmailModel.cs | 22 ---- .../Model/UpdateUserPasswordModel.cs | 13 -- .../Model/UpdateUserPhoneNumberModel.cs | 24 ---- .../Model/UpsertThirdPartyUserModel.cs | 15 --- .../Model/UpsertUserModel.cs | 12 -- .../Model/UserClaimValuesModel.cs | 11 -- .../Model/UserModel.cs | 93 ------------- .../Model/UserPortraitModel.cs | 17 --- .../Model/UserSelectModel.cs | 39 ------ .../Model/UserSimpleModel.cs | 20 --- .../Model/UserVisitedModel.cs | 11 -- .../Model/ValidateAccountModel.cs | 15 --- .../Model/VerifyMsgCodeModel.cs | 15 --- .../UserStatusException.cs | 24 ---- .../_Imports.cs | 7 - .../IAuthClient.cs | 22 ---- .../ISsoClient.cs | 10 -- .../Masa.BuildingBlocks.StackSdks.Auth.csproj | 12 -- .../Service/ICustomLoginService.cs | 9 -- .../Service/ILoginService.cs | 15 --- .../Service/IPermissionService.cs | 29 ---- .../Service/IProjectService.cs | 9 -- .../Service/ISubjectService.cs | 10 -- .../Service/ITeamService.cs | 14 -- .../Service/IThirdPartyIdpService.cs | 13 -- .../Service/IUserService.cs | 124 ------------------ .../_Imports.cs | 5 - .../Enum/ConfigFormats.cs | 13 -- ...ldingBlocks.StackSdks.Dcc.Contracts.csproj | 9 -- .../Model/LabelModel.cs | 19 --- .../Model/PublishReleaseModel.cs | 36 ----- .../_imports.cs | 4 - .../IDccClient.cs | 9 -- .../Masa.BuildingBlocks.StackSdks.Dcc.csproj | 13 -- .../Service/ILabelService.cs | 9 -- .../_Imports.cs | 5 - .../ITscClient.cs | 11 -- .../Masa.BuildingBlocks.StackSdks.Tsc.csproj | 12 -- .../Model/Log/LogLatestRequest.cs | 15 --- .../Model/Metric/LableValuesRequest.cs | 27 ---- .../Model/Metric/ValuesRequest.cs | 20 --- .../Service/ILogService.cs | 13 -- .../Service/IMetricService.cs | 13 -- .../_Imports.cs | 9 -- .../Enum/AlarmCheckFrequencyType.cs | 10 -- .../Enum/AlarmRuleType.cs | 10 -- .../Enum/AlertSeverity.cs | 13 -- .../Enum/LogAggregationType.cs | 11 -- .../Enum/MetricAggregationType.cs | 11 -- .../Enum/MetricComparisonOperator.cs | 14 -- .../Enum/SilenceCycleType.cs | 10 -- .../Enum/TimeType.cs | 11 -- .../IAlertClient.cs | 9 -- ...Masa.BuildingBlocks.StackSdks.Alert.csproj | 8 -- .../Model/AlarmRuleItemModel.cs | 21 --- .../Model/AlarmRuleModel.cs | 39 ------ .../Model/AlarmRuleUpsertModel.cs | 33 ----- .../Model/CheckFrequencyModel.cs | 13 -- .../Model/LogMonitorItemModel.cs | 17 --- .../Model/MetricAggregationModel.cs | 17 --- .../Model/MetricMonitorItemModel.cs | 19 --- .../Model/NotificationConfigModel.cs | 17 --- .../Model/SilenceCycleModel.cs | 13 -- .../Model/TimeIntervalModel.cs | 11 -- .../Service/IAlarmHistoryService.cs | 11 -- .../Service/IAlarmRuleService.cs | 17 --- .../_Imports.cs | 6 - .../IMasaStackConfig.cs | 37 ------ .../IMultiEnvironmentMasaStackConfig.cs | 10 -- ...asa.BuildingBlocks.StackSdks.Config.csproj | 8 -- .../MasaStackConfigConstant.cs | 22 ---- .../MasaStackConfigExtensions.cs | 26 ---- .../Models/DbModel.cs | 22 ---- .../Models/ElasticModel.cs | 11 -- .../Models/RedisModel.cs | 15 --- .../_Imports.cs | 7 - .../DccConsts.cs | 9 -- .../EnvironmentProvider.cs | 19 --- .../IsolationConsts.cs | 9 -- ....BuildingBlocks.StackSdks.Isolation.csproj | 12 -- .../Models/IEnvironmentModel.cs | 10 -- .../Models/OssOptions.cs | 21 --- .../_Imports.cs | 3 - .../Enum/ChannelTypes.cs | 12 -- .../Enum/MessageTaskReceiverTypes.cs | 13 -- .../Enum/MessageTaskSelectReceiverTypes.cs | 10 -- .../Enum/MessageTaskSources.cs | 10 -- .../Enum/MessageTaskStatuses.cs | 14 -- .../Enum/MessageTemplateAuditStatuses.cs | 11 -- .../Enum/MessageTemplateStates.cs | 10 -- .../Enum/MessageTypes.cs | 10 -- .../Enum/ReceiverGroupItemTypes.cs | 12 -- .../Enum/SendTargets.cs | 10 -- .../Enum/WebsiteMessageFilterType.cs | 10 -- .../IMcClient.cs | 17 --- .../ExtraPropertyDictionary.cs | 18 --- .../Masa.BuildingBlocks.StackSdks.Mc.csproj | 12 -- .../Model/AuditEntityModel.cs | 15 --- .../Model/BindClientIdModel.cs | 11 -- .../Model/ChannelModel.cs | 17 --- .../Model/CreateChannelModel.cs | 21 --- .../Model/EntityModel.cs | 9 -- .../Model/ExternalReceiverModel.cs | 11 -- .../Model/GetChannelModel.cs | 13 -- .../Model/GetMessageTaskModel.cs | 36 ----- .../Model/GetMessageTemplateModel.cs | 23 ---- .../Model/GetNoticeListModel.cs | 9 -- .../Model/GetReceiverGroupModel.cs | 9 -- .../Model/GetUnreadModel.cs | 11 -- .../Model/GetWebsiteMessageModel.cs | 24 ---- .../Model/InternalReceiverModel.cs | 13 -- .../Model/MessageInfoModel.cs | 17 --- .../Model/MessageInfoUpsertModel.cs | 19 --- .../Model/MessageTaskModel.cs | 47 ------- .../Model/MessageTaskReceiverModel.cs | 21 --- .../Model/MessageTaskTimeTypes.cs | 10 -- .../Model/MessageTaskUpsertModel.cs | 43 ------ .../Model/MessageTemplateItemModel.cs | 15 --- .../Model/MessageTemplateModel.cs | 52 -------- .../Model/PaginatedListModel.cs | 25 ---- .../Model/ReadAllWebsiteMessageModel.cs | 12 -- .../Model/ReadWebsiteMessageModel.cs | 9 -- .../Model/ReceiverGroupItemModel.cs | 21 --- .../Model/ReceiverGroupModel.cs | 15 --- .../SendOrdinaryMessageByExternalModel.cs | 27 ---- .../SendOrdinaryMessageByInternalModel.cs | 27 ---- .../Model/SendRuleModel.cs | 13 -- .../SendTemplateMessageByExternalModel.cs | 29 ---- .../SendTemplateMessageByInternalModel.cs | 29 ---- .../Model/WebsiteMessageByTagModel.cs | 19 --- .../Model/WebsiteMessageChannelModel.cs | 9 -- .../Model/WebsiteMessageModel.cs | 33 ----- .../Service/IChannelService.cs | 13 -- .../Service/IMessageTaskService.cs | 31 ----- .../Service/IMessageTemplateService.cs | 11 -- .../Service/IReceiverGroupService.cs | 11 -- .../Service/IWebsiteMessageService.cs | 31 ----- .../_Imports.cs | 8 -- .../AllowedEventAttribute.cs | 9 -- .../DisabledRouteAttribute.cs | 9 -- .../IDisabledDeterminer.cs | 18 --- ...BuildingBlocks.StackSdks.Middleware.csproj | 8 -- .../_Imports.cs | 0 .../Enum/AppTypes.cs | 16 --- .../Enum/ServiceTypes.cs | 13 -- .../IPmClient.cs | 15 --- .../Masa.BuildingBlocks.StackSdks.Pm.csproj | 8 -- .../Model/AppDetailModel.cs | 27 ---- .../Model/AppModel.cs | 42 ------ .../Model/ClusterDetailModel.cs | 15 --- .../Model/ClusterModel.cs | 13 -- .../Model/EnvironmentClusterModel.cs | 23 ---- .../Model/EnvironmentDetailModel.cs | 17 --- .../Model/EnvironmentModel.cs | 13 -- .../Model/ModelBase.cs | 20 --- .../Model/ProjectAppsModel.cs | 28 ---- .../Model/ProjectDetailModel.cs | 21 --- .../Model/ProjectModel.cs | 25 ---- .../Model/ProjectTypeModel.cs | 11 -- .../Service/IAppService.cs | 19 --- .../Service/IClusterService.cs | 15 --- .../Service/IEnvironmentService.cs | 11 -- .../Service/IProjectService.cs | 21 --- .../_Imports.cs | 7 - .../Enum/HttpMethods.cs | 13 -- .../Enum/HttpVerifyTypes.cs | 12 -- .../Enum/JobTypes.cs | 11 -- .../Enum/LoggerTypes.cs | 10 -- .../Enum/RunTimeoutStrategyTypes.cs | 10 -- .../Enum/ScheduleBlockStrategyTypes.cs | 12 -- .../Enum/ScheduleExpiredStrategyTypes.cs | 11 -- .../Enum/TaskRunResultStatus.cs | 12 -- .../Enum/WriterTypes.cs | 11 -- .../ISchedulerClient.cs | 11 -- .../ISchedulerJob.cs | 15 --- ....BuildingBlocks.StackSdks.Scheduler.csproj | 10 -- .../Model/JobContext.cs | 19 --- .../Model/LoggerBody.cs | 15 --- .../Model/SchedulerJobAppConfig.cs | 17 --- ...SchedulerJobDaprServiceInvocationConfig.cs | 15 --- .../Model/SchedulerJobHttpConfig.cs | 21 --- .../Model/SchedulerJobModel.cs | 70 ---------- .../Request/AddSchedulerJobRequest.cs | 52 -------- .../Request/ChangeEnabledStatusRequest.cs | 9 -- .../GetSchedulerJobByIdentityRequest.cs | 11 -- .../NotifySchedulerTaskRunResultRequest.cs | 11 -- .../Request/SchedulerJobRequestBase.cs | 17 --- .../Request/SchedulerTaskRequestBase.cs | 16 --- .../Request/StartSchedulerTaskRequest.cs | 9 -- .../Service/ISchedulerJobService.cs | 21 --- .../Service/ISchedulerTaskService.cs | 13 -- .../_Imports.cs | 8 -- .../Extensions/DictionaryExtenistions.cs | 35 ----- ...ldingBlocks.StackSdks.Tsc.Contracts.csproj | 17 --- .../Model/Aggregate/AggregateTypes.cs | 14 -- .../Aggregate/SimpleAggregateRequestDto.cs | 25 ---- .../Model/BaseRequestDto.cs | 29 ---- .../Model/ConditionTypes.cs | 20 --- .../Model/FieldConditionDto.cs | 13 -- .../Model/FieldOrderDto.cs | 11 -- .../Model/Log/LogResponseDto.cs | 25 ---- .../Model/MappingResponseDto.cs | 11 -- .../Model/Trace/TraceDatabaseResponseDto.cs | 80 ----------- .../Model/Trace/TraceDtoKind.cs | 13 -- .../Model/Trace/TraceExceptionResponseDto.cs | 19 --- .../Model/Trace/TraceHttpResponseDto.cs | 83 ------------ .../Model/Trace/TraceNetResponseDto.cs | 35 ----- .../Model/Trace/TraceRequestAttrDto.cs | 21 --- .../Model/Trace/TraceResponseDto.cs | 111 ---------------- .../Service/ILogService.cs | 18 --- .../Service/ITraceService.cs | 22 ---- .../_Imports.cs | 10 -- .../DefaultMasaDbContext.cs | 42 ++++++ .../Masa.Contrib.Ddd.Domain/DomainEventBus.cs | 3 +- .../Internal/Dispatch/LocalEventBusWrapper.cs | 7 +- .../Internal/Options/DispatcherOptions.cs | 17 +++ .../Application/Events/RegisterUserEvent.cs | 17 ++- .../Application/UserHandler.cs | 16 ++- .../Domain/Aggregate/User.cs | 7 +- .../TestDispatcher.cs | 35 ++++- 299 files changed, 204 insertions(+), 5276 deletions(-) create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityChangedEvent.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityCreatedDomainEvent.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityDeletedDomainEvent.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityModifiedDomainEvent.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/CacheKeyConsts.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/IdentityClaimConsts.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/PropertyConsts.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/AuthenticationTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/PasswordTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/RegisterFieldTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SendEmailTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SendMsgCodeTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/ThirdPartyIdpLoginResultTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/ThirdPartyIdpTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/UserRegisterTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/MasaUser.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddThirdPartyUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/BindUserRolesModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CustomLoginModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetImpersonateInputModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetImpersonateOutputModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetSystemDataModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetThirdPartyUserByUserIdModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetThirdPartyUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ImpersonateInputModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ImpersonateOutputModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LdapOptionsModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByLdapModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPasswordModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPhoneNumberFromSsoModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPhoneNumberModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByThirdPartyIdpModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByThirdPartyIdpResultModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterByEmailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterByPhoneModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterFieldModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterThirdPartyUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterThirdPartyUserResultModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RemoveUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RemoveUserRolesModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordByEmailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordByPhoneModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SendEmailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SendMsgCodeModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectPermissionRelationModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ThirdPartyIdentityModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ThirdPartyIdpModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TokenModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UnbindUserRolesModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateCurrentTeamModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateStaffAvatarModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateStaffBasicInfoModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserAvatarModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserEmailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPhoneNumberModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertThirdPartyUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserClaimValuesModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSelectModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ValidateAccountModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/VerifyMsgCodeModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/UserStatusException.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/ISsoClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ICustomLoginService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ILoginService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IThirdPartyIdpService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Enum/ConfigFormats.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Masa.BuildingBlocks.StackSdks.Dcc.Contracts.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Model/LabelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Model/PublishReleaseModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/_imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlarmCheckFrequencyType.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlarmRuleType.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlertSeverity.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/LogAggregationType.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/MetricAggregationType.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/MetricComparisonOperator.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/SilenceCycleType.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/TimeType.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/IAlertClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Masa.BuildingBlocks.StackSdks.Alert.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleItemModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleUpsertModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/CheckFrequencyModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/LogMonitorItemModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/MetricAggregationModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/MetricMonitorItemModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/NotificationConfigModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/SilenceCycleModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/TimeIntervalModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmHistoryService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmRuleService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/IMasaStackConfig.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/IMultiEnvironmentMasaStackConfig.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Masa.BuildingBlocks.StackSdks.Config.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/MasaStackConfigConstant.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/MasaStackConfigExtensions.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/DbModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/ElasticModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/RedisModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/DccConsts.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/EnvironmentProvider.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/IsolationConsts.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Masa.BuildingBlocks.StackSdks.Isolation.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Models/IEnvironmentModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Models/OssOptions.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/BindClientIdModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/CreateChannelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ExternalReceiverModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTaskModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetUnreadModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/InternalReceiverModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskTimeTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskUpsertModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageByExternalModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageByInternalModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageByExternalModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageByInternalModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageByTagModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/AllowedEventAttribute.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/DisabledRouteAttribute.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/IDisabledDeterminer.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/Masa.BuildingBlocks.StackSdks.Middleware.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ModelBase.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/LoggerTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/TaskRunResultStatus.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/WriterTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/LoggerBody.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/GetSchedulerJobByIdentityRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/NotifySchedulerTaskRunResultRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/SchedulerJobRequestBase.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/SchedulerTaskRequestBase.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Extensions/DictionaryExtenistions.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Masa.BuildingBlocks.StackSdks.Tsc.Contracts.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Aggregate/AggregateTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Aggregate/SimpleAggregateRequestDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/BaseRequestDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/ConditionTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/FieldConditionDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/FieldOrderDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Log/LogResponseDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/MappingResponseDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceDatabaseResponseDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceDtoKind.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceExceptionResponseDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceHttpResponseDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceNetResponseDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceRequestAttrDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceResponseDto.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Service/ILogService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Service/ITraceService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/_Imports.cs diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityChangedEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityChangedEvent.cs new file mode 100644 index 000000000..b3fab230d --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityChangedEvent.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events +{ + public abstract record class EntityChangedEvent : DomainCommand + { + public TEntity Entity { get; set; } + + public EntityChangedEvent(TEntity entity) + { + Entity = entity; + } + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityCreatedDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityCreatedDomainEvent.cs new file mode 100644 index 000000000..1a285403d --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityCreatedDomainEvent.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events +{ + public record class EntityCreatedDomainEvent : EntityChangedEvent + { + public EntityCreatedDomainEvent(TEntity entity) : base(entity) + { + } + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityDeletedDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityDeletedDomainEvent.cs new file mode 100644 index 000000000..8bad514eb --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityDeletedDomainEvent.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events +{ + public record class EntityDeletedDomainEvent : EntityChangedEvent + { + public EntityDeletedDomainEvent(TEntity entity) : base(entity) + { + } + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityModifiedDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityModifiedDomainEvent.cs new file mode 100644 index 000000000..c281f8f7c --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/EntityModifiedDomainEvent.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events +{ + public record class EntityModifiedDomainEvent : EntityChangedEvent + { + public EntityModifiedDomainEvent(TEntity entity) : base(entity) + { + } + } +} diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/UserFriendlyExceptionTest.cs b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/UserFriendlyExceptionTest.cs index a8b8795e6..3539e551d 100644 --- a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/UserFriendlyExceptionTest.cs +++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions.Tests/UserFriendlyExceptionTest.cs @@ -1,6 +1,8 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Microsoft.Extensions.Logging; + namespace Masa.BuildingBlocks.Exceptions.Tests; [TestClass] diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaException.cs b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaException.cs index 956adae81..b3bf383d5 100644 --- a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaException.cs +++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaException.cs @@ -1,4 +1,4 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. // ReSharper disable once CheckNamespace @@ -99,6 +99,14 @@ public MasaException(Exception? innerException, string errorCode, LogLevel? logL _logLevel = logLevel; } + public MasaException(string message, Exception? innerException, string errorCode, LogLevel? logLevel = null, params object[] parameters) + : base(message, innerException) + { + _errorCode = errorCode; + _parameters = parameters; + _logLevel = logLevel; + } + public MasaException(string message, Exception? innerException, LogLevel? logLevel = null) : base(message, innerException) { diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs index 88c13c01f..71c11e73c 100644 --- a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs +++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs @@ -33,6 +33,11 @@ public UserFriendlyException( { } + public UserFriendlyException(string errorCode, string message, LogLevel? logLevel, params object[] parameters) + : base(message, null, errorCode, logLevel, parameters) + { + } + public UserFriendlyException( Exception? innerException, string errorCode, diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/CacheKeyConsts.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/CacheKeyConsts.cs deleted file mode 100644 index 99bcdac51..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/CacheKeyConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Consts; - -public static class CacheKeyConsts -{ - public const string ALL_THIRD_PARTY_IDP = "get_all_thirdparty_idp"; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/IdentityClaimConsts.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/IdentityClaimConsts.cs deleted file mode 100644 index 1589c741a..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/IdentityClaimConsts.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Consts; - -public static class IdentityClaimConsts -{ - public const string ACCOUNT = "account"; - public const string ROLES = "roles"; - public const string ENVIRONMENT = "environment"; - public const string CURRENT_TEAM = "current_team"; - public const string STAFF = "staff_id"; - public const string PHONE_NUMBER = "phone_number"; - public const string EMAIL = "email"; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/PropertyConsts.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/PropertyConsts.cs deleted file mode 100644 index edc544b28..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Consts/PropertyConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Consts; - -public static class PropertyConsts -{ - public const string REDIRECT_TO_LOGIN = "RedirectToLogin"; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/AuthenticationTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/AuthenticationTypes.cs deleted file mode 100644 index 15e9c6c38..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/AuthenticationTypes.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum AuthenticationTypes -{ - OAuth = 1 -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs deleted file mode 100644 index 09dc7e961..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum GenderTypes -{ - Male = 1, - Female, -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/PasswordTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/PasswordTypes.cs deleted file mode 100644 index f5346c756..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/PasswordTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum PasswordTypes -{ - MD5 = 1, - HashPassword, -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/RegisterFieldTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/RegisterFieldTypes.cs deleted file mode 100644 index f0d7a19fa..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/RegisterFieldTypes.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum RegisterFieldTypes -{ - Account = 1, - Password = 2, - Name = 3, - DisplayName = 4, - IdCard = 5, - PhoneNumber = 6, - Email = 7 -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SendEmailTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SendEmailTypes.cs deleted file mode 100644 index a74de72a3..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SendEmailTypes.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum SendEmailTypes -{ - Undefined = 0, - VerifiyEmail = 1, - UpdateEmail = 2, - Verifiy = 3, - Register = 4, - Bind = 5, - ForgotPassword = 6, -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SendMsgCodeTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SendMsgCodeTypes.cs deleted file mode 100644 index fa9a32226..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SendMsgCodeTypes.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum SendMsgCodeTypes -{ - VerifiyPhoneNumber = 1, - UpdatePhoneNumber = 2, - Login = 3, - Register = 4, - Bind = 5, - ForgotPassword = 6 -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs deleted file mode 100644 index 7207b7a5f..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum StaffTypes -{ - Internal = 1, - External -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs deleted file mode 100644 index 9a51a0fda..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum SubjectTypes -{ - User = 1, - Department, - Role, - Team, -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs deleted file mode 100644 index 19036a980..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum TeamTypes -{ - [Description("Ordinary")] - Ordinary = 1 -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/ThirdPartyIdpLoginResultTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/ThirdPartyIdpLoginResultTypes.cs deleted file mode 100644 index b54715fc3..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/ThirdPartyIdpLoginResultTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum ThirdPartyIdpLoginResultTypes -{ - Success = 1, - NotRegister -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/ThirdPartyIdpTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/ThirdPartyIdpTypes.cs deleted file mode 100644 index ababec6d6..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/ThirdPartyIdpTypes.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum ThirdPartyIdpTypes -{ - Customize = 1, - WeChat = 2, - GitHub = 3, - Ldap = 4, - Apple = 5 -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/UserRegisterTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/UserRegisterTypes.cs deleted file mode 100644 index 80122e923..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/UserRegisterTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum UserRegisterTypes -{ - Undefined, - Account, - PhoneNumber, - Email -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj deleted file mode 100644 index d6a42c431..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - enable - enable - - - - - - - - - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/MasaUser.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/MasaUser.cs deleted file mode 100644 index f1c5c35a3..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/MasaUser.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts; - -public class MasaUser : IIdentityUser -{ - public string Id { get; set; } - - public string? UserName { get; set; } - - public string? Account { get; set; } - - public string[] Roles { get; set; } - - public string PhoneNumber { get; set; } - - public string Email { get; set; } - - public bool IsSuperAdmin => Account?.ToLower() == "admin"; - - public bool IsStaff => StaffId != Guid.Empty; - - public Guid CurrentTeamId { get; set; } - - public Guid StaffId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddThirdPartyUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddThirdPartyUserModel.cs deleted file mode 100644 index aa98c9b56..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddThirdPartyUserModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class AddThirdPartyUserModel -{ - public string ThridPartyIdentity { get; set; } = ""; - - public object ExtendedData { get; set; } - - public string Scheme { get; set; } - - public AddUserModel User { get; set; } - - public Dictionary ClaimData { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs deleted file mode 100644 index 19d7c94dd..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class AddUserModel -{ - public string? Account { get; set; } - - public string? Name { get; set; } - - public string? Avatar { get; set; } - - public string? DisplayName { get; set; } - - public string? IdCard { get; set; } - - public string? Department { get; set; } - - public string? Position { get; set; } - - public string? CompanyName { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } - - public string? Password { get; set; } - - public GenderTypes Gender { get; set; } - - public PasswordTypes PasswordType { get; set; } = PasswordTypes.MD5; -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs deleted file mode 100644 index 1b94a7c70..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class AddressValueModel -{ - public string Address { get; set; } - - public string? ProvinceCode { get; set; } - - public string? CityCode { get; set; } - - public string? DistrictCode { get; set; } - - public AddressValueModel() - { - Address = ""; - } - - public AddressValueModel(string address, string? provinceCode, string? cityCode, string? districtCode) - { - Address = address; - ProvinceCode = provinceCode; - CityCode = cityCode; - DistrictCode = districtCode; - } - - public override string ToString() - { - return Address; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs deleted file mode 100644 index 6d15c2b6a..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class AppModel -{ - public int Id { get; set; } - - public string Name { get; set; } = string.Empty; - - public string Identity { get; set; } = string.Empty; - - public string Tag { get; set; } = string.Empty; - - public int ProjectId { get; set; } - - public List Navs { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/BindUserRolesModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/BindUserRolesModel.cs deleted file mode 100644 index 8922f77af..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/BindUserRolesModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class BindUserRolesModel -{ - public Guid Id { get; set; } - - public IEnumerable RoleCodes { get; set; } = new List(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs deleted file mode 100644 index 486dcac30..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class CollectMenuModel -{ - public Guid Value { get; set; } - - public string Text { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CustomLoginModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CustomLoginModel.cs deleted file mode 100644 index 23e96d5e9..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CustomLoginModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class CustomLoginModel -{ - public string Name { get; set; } = ""; - - public string Title { get; set; } = ""; - - public string ClientId { get; set; } = ""; - - public List ThirdPartyIdps { get; set; } = new(); - - public List RegisterFields { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs deleted file mode 100644 index 188ab7033..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class DisableUserModel -{ - public string Account { get; set; } - - public DisableUserModel(string account) - { - Account = account; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetImpersonateInputModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetImpersonateInputModel.cs deleted file mode 100644 index 142ecab41..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetImpersonateInputModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class GetImpersonateInputModel : IEnvironmentModel -{ - public string ImpersonationToken { get; set; } = ""; - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetImpersonateOutputModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetImpersonateOutputModel.cs deleted file mode 100644 index 9627196f7..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetImpersonateOutputModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class GetImpersonateOutputModel -{ - public Guid ImpersonatorUserId { get; set; } - - public Guid TargetUserId { get; set; } - - public bool IsBackToImpersonator { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetSystemDataModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetSystemDataModel.cs deleted file mode 100644 index 4ae7ee23a..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetSystemDataModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class GetSystemDataModel -{ - public string SystemId { get; set; } - - public List UserIds { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetThirdPartyUserByUserIdModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetThirdPartyUserByUserIdModel.cs deleted file mode 100644 index 90d1de901..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetThirdPartyUserByUserIdModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class GetThirdPartyUserByUserIdModel : IEnvironmentModel -{ - public string Scheme { get; set; } - - public Guid UserId { get; set; } - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetThirdPartyUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetThirdPartyUserModel.cs deleted file mode 100644 index ba34b4072..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/GetThirdPartyUserModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class GetThirdPartyUserModel : IEnvironmentModel -{ - public string ThridPartyIdentity { get; set; } - - public ThirdPartyIdpTypes ThirdPartyIdpType { get; set; } - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ImpersonateInputModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ImpersonateInputModel.cs deleted file mode 100644 index 213fbfd60..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ImpersonateInputModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class ImpersonateInputModel : IEnvironmentModel -{ - public Guid UserId { get; set; } - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ImpersonateOutputModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ImpersonateOutputModel.cs deleted file mode 100644 index a3ee16126..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ImpersonateOutputModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class ImpersonateOutputModel -{ - public string ImpersonationToken { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LdapOptionsModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LdapOptionsModel.cs deleted file mode 100644 index 78913af9d..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LdapOptionsModel.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class LdapOptionsModel -{ - public string ServerAddress { get; set; } - - public int ServerPort { get; set; } - - public int ServerPortSsl { get; set; } - - public string BaseDn { get; set; } - - public string UserSearchBaseDn { get; set; } - - public string GroupSearchBaseDn { get; set; } - - public string RootUserDn { get; set; } - - public string RootUserPassword { get; set; } - - public LdapOptionsModel(string serverAddress, int serverPort, string baseDn, string userSearchBaseDn, string groupSearchBaseDn, string rootUserDn, string rootUserPassword) - { - ServerAddress = serverAddress; - ServerPort = serverPort; - BaseDn = baseDn; - UserSearchBaseDn = userSearchBaseDn; - GroupSearchBaseDn = groupSearchBaseDn; - RootUserDn = rootUserDn; - RootUserPassword = rootUserPassword; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByLdapModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByLdapModel.cs deleted file mode 100644 index e4fef7dc5..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByLdapModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class LoginByLdapModel : IEnvironmentModel -{ - public string ClientId { get; set; } = ""; - - public string ClientSecret { get; set; } = ""; - - public List Scope { get; set; } = new() { "openid", "profile" }; - - public string UserName { get; set; } - - public string Scheme { get; set; } = "Ldap"; - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPasswordModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPasswordModel.cs deleted file mode 100644 index 895e8dde2..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPasswordModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class LoginByPasswordModel : IEnvironmentModel -{ - public string ClientId { get; set; } = ""; - - public string ClientSecret { get; set; } = ""; - - public List Scope { get; set; } = new() { "openid", "profile" }; - - public string Account { get; set; } - - public string Password { get; set; } - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPhoneNumberFromSsoModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPhoneNumberFromSsoModel.cs deleted file mode 100644 index 44261324e..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPhoneNumberFromSsoModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class LoginByPhoneNumberFromSsoModel : IEnvironmentModel -{ - public string ClientId { get; set; } = ""; - - public string ClientSecret { get; set; } = ""; - - public List Scope { get; set; } = new() { "openid", "profile" }; - - public string PhoneNumber { get; set; } = ""; - - public string Code { get; set; } = ""; - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPhoneNumberModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPhoneNumberModel.cs deleted file mode 100644 index 5f89512b0..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByPhoneNumberModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class LoginByPhoneNumberModel : IEnvironmentModel -{ - public string PhoneNumber { get; set; } = ""; - - public string Code { get; set; } = ""; - - public bool RegisterLogin { get; set; } - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByThirdPartyIdpModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByThirdPartyIdpModel.cs deleted file mode 100644 index b21052fef..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByThirdPartyIdpModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class LoginByThirdPartyIdpModel : IEnvironmentModel -{ - public string ClientId { get; set; } = ""; - - public string ClientSecret { get; set; } = ""; - - public List Scope { get; set; } = new() { "openid", "profile" }; - - public string Scheme { get; set; } - - public string? Code { get; set; } - - public string? IdToken { get; set; } - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByThirdPartyIdpResultModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByThirdPartyIdpResultModel.cs deleted file mode 100644 index 0d7ee72d5..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/LoginByThirdPartyIdpResultModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class LoginByThirdPartyIdpResultModel -{ - public TokenModel? Token { get; set; } - - public ThirdPartyIdentityModel? ThirdPartyIdentity { get; set; } - - public ThirdPartyIdpLoginResultTypes ThirdPartyIdpLoginResultType { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs deleted file mode 100644 index 3ba310e00..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class MenuModel -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - public string Code { get; set; } - - public string Icon { get; set; } - - public string Url { get; set; } - - public string MatchPattern { get; set; } - - public List Children { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs deleted file mode 100644 index 911fca3c1..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class NavModel -{ - public string Code { get; set; } = string.Empty; - - public string Name { get; set; } = string.Empty; - - public string Icon { get; set; } = string.Empty; - - public string Url { get; set; } = string.Empty; - - public List Children { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs deleted file mode 100644 index 08dda6f4f..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class ProjectModel -{ - public int Id { get; set; } - - public string Name { get; set; } = string.Empty; - - public string Identity { get; set; } = string.Empty; - - public List Apps { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterByEmailModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterByEmailModel.cs deleted file mode 100644 index 30ee1c89d..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterByEmailModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class RegisterByEmailModel : RegisterByPhoneModel -{ - public RegisterByEmailModel() - { - UserRegisterType = UserRegisterTypes.Email; - } - - public string Email { get; set; } - - public string EmailCode { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterByPhoneModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterByPhoneModel.cs deleted file mode 100644 index e66fda010..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterByPhoneModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class RegisterByPhoneModel : RegisterModel -{ - public UserRegisterTypes UserRegisterType { get; set; } = UserRegisterTypes.PhoneNumber; - - public string PhoneNumber { get; set; } - - public string SmsCode { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterFieldModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterFieldModel.cs deleted file mode 100644 index 9b1ddcb54..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterFieldModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class RegisterFieldModel -{ - public RegisterFieldTypes RegisterFieldType { get; set; } - - public int Sort { get; set; } - - public bool Required { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterModel.cs deleted file mode 100644 index 20d87514a..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public abstract class RegisterModel : IEnvironmentModel -{ - public string? Account { get; set; } - - public string Password { get; set; } - - public string? Avatar { get; set; } - - public string? DisplayName { get; set; } - - public string? Name { get; set; } - - public string? IdCard { get; set; } - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterThirdPartyUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterThirdPartyUserModel.cs deleted file mode 100644 index 7e56ca1c6..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterThirdPartyUserModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class RegisterThirdPartyUserModel : RegisterByEmailModel -{ - public string ThridPartyIdentity { get; set; } = ""; - - public object ExtendedData { get; set; } - - public string Scheme { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterThirdPartyUserResultModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterThirdPartyUserResultModel.cs deleted file mode 100644 index 3f47b7f03..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RegisterThirdPartyUserResultModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class RegisterThirdPartyUserResultModel -{ - public TokenModel? Token { get; set; } - - public UserModel? User { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RemoveUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RemoveUserModel.cs deleted file mode 100644 index e9a3ca311..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RemoveUserModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class RemoveUserModel -{ - public Guid Id { get; set; } - - public RemoveUserModel(Guid id) - { - Id = id; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RemoveUserRolesModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RemoveUserRolesModel.cs deleted file mode 100644 index eb3143250..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RemoveUserRolesModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class RemoveUserRolesModel -{ - public Guid Id { get; set; } - - public List RoleCodes { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordByEmailModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordByEmailModel.cs deleted file mode 100644 index 6b14254c6..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordByEmailModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class ResetPasswordByEmailModel : ResetPasswordModel -{ - public string Email { get; set; } - - public string Code { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordByPhoneModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordByPhoneModel.cs deleted file mode 100644 index 798e534fc..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordByPhoneModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class ResetPasswordByPhoneModel : ResetPasswordModel -{ - public string PhoneNumber { get; set; } - - public string Code { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordModel.cs deleted file mode 100644 index d6422b47a..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ResetPasswordModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public abstract class ResetPasswordModel -{ - public string Password { get; set; } - - public string ConfirmPassword { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs deleted file mode 100644 index 7f1372f72..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class RoleModel -{ - public Guid Id { get; set; } - - public string Code { get; set; } - - public string Name { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SendEmailModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SendEmailModel.cs deleted file mode 100644 index 43f7015f8..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SendEmailModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class SendEmailModel : IEnvironmentModel -{ - public string Email { get; set; } = ""; - - public SendEmailTypes SendEmailType { get; set; } = SendEmailTypes.Undefined; - - public string Environment { get; set; } - - public SendEmailModel() - { - } - - public SendEmailModel(string email, SendEmailTypes sendEmailType) - { - Email = email; - SendEmailType = sendEmailType; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SendMsgCodeModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SendMsgCodeModel.cs deleted file mode 100644 index f022908f5..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SendMsgCodeModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class SendMsgCodeModel : IEnvironmentModel -{ - public Guid UserId { get; set; } - - public string PhoneNumber { get; set; } = ""; - - public SendMsgCodeTypes SendMsgCodeType { get; set; } = SendMsgCodeTypes.VerifiyPhoneNumber; - - public string Environment { get; set; } - - public SendMsgCodeModel() - { - } - - public SendMsgCodeModel(Guid userId, string phoneNumber, SendMsgCodeTypes sendMsgCodeType) - { - UserId = userId; - PhoneNumber = phoneNumber; - SendMsgCodeType = sendMsgCodeType; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs deleted file mode 100644 index 84203a467..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class StaffDetailModel: StaffModel -{ - public List Roles { get; set; } - - public List Teams { get; set; } - - public DateTime CreationTime { get; set; } - - public DateTime ModificationTime { get; set; } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs deleted file mode 100644 index 3994db927..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class StaffModel -{ - public Guid Id { get; set; } - - public Guid UserId { get; set; } - - public Guid? CurrentTeamId { get; set; } - - public string Department { get; set; } = ""; - - public string Position { get; set; } = ""; - - public string JobNumber { get; set; } = ""; - - public StaffTypes StaffType { get; set; } - - public string Name { get; set; } = ""; - - public string DisplayName { get; set; } = ""; - - public string Avatar { get; set; } = ""; - - public string IdCard { get; set; } = ""; - - public string Account { get; set; } = ""; - - public string CompanyName { get; set; } = ""; - - public string PhoneNumber { get; set; } = ""; - - public string Email { get; set; } = ""; - - public AddressValueModel Address { get; set; } = new(); - - public GenderTypes Gender { get; set; } - - public bool Enabled { get; set; } - - public StaffModel() - { - } - - public StaffModel( - Guid id, - Guid userId, - string department, - string position, - string jobNumber, - StaffTypes staffType, - string name, - string displayName, - string avatar, - string idCard, - string account, - string companyName, - string phoneNumber, - string email, - AddressValueModel address, - GenderTypes gender, - bool enabled) - { - Id = id; - UserId = userId; - Department = department; - Position = position; - JobNumber = jobNumber; - StaffType = staffType; - Name = name; - DisplayName = displayName; - Avatar = avatar; - IdCard = idCard; - Account = account; - CompanyName = companyName; - PhoneNumber = phoneNumber; - Email = email; - Address = address; - Gender = gender; - Enabled = enabled; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs deleted file mode 100644 index e51deba92..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class SubjectModel -{ - public Guid SubjectId { get; set; } - - public string? Name { get; set; } - - public string? DisplayName { get; set; } - - public string? Avatar { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } - - public SubjectTypes SubjectType { get; set; } - - public SubjectModel() - { - DisplayName = ""; - } - - public SubjectModel( - Guid subjectId, - string? name, - string? displayName, - string? avatar, - string? phoneNumber, - string? email, - SubjectTypes subjectType) - { - SubjectId = subjectId; - Name = name; - DisplayName = displayName; - Avatar = avatar; - PhoneNumber = phoneNumber; - Email = email; - SubjectType = subjectType; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectPermissionRelationModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectPermissionRelationModel.cs deleted file mode 100644 index 2c254e935..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectPermissionRelationModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class SubjectPermissionRelationModel -{ - public Guid PermissionId { get; set; } - - public bool Effect { get; set; } - - public SubjectPermissionRelationModel(Guid permissionId, bool effect) - { - PermissionId = permissionId; - Effect = effect; - } - - public override bool Equals(object? obj) - { - return obj is SubjectPermissionRelationModel spr && spr.PermissionId == PermissionId; - } - - public override int GetHashCode() - { - return 1; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs deleted file mode 100644 index 00de46cec..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class TeamDetailModel -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - public string Avatar { get; set; } - - public string Description { get; set; } - - public TeamTypes TeamType { get; set; } - - public List Admins { get; set; } = new(); - - public List Members { get; set; } = new(); - - public List AdminRoles { get; set; } = new(); - - public List MemberRoles { get; set; } = new(); - - public TeamDetailModel() - { - Name = ""; - Avatar = ""; - Description = ""; - } - - public TeamDetailModel( - Guid id, - string name, - string avatar, - string description, - TeamTypes teamType, - List admins, - List members) - { - Id = id; - Name = name; - Avatar = avatar; - Description = description; - TeamType = teamType; - Admins = admins; - Members = members; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs deleted file mode 100644 index 328b85b02..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class TeamModel -{ - public Guid Id { get; set; } - - public string Name { get; set; } = ""; - - public string Avatar { get; set; } = ""; - - public string Description { get; set; } = ""; - - public string Role { get; set; } = ""; - - public int MemberCount { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs deleted file mode 100644 index c955b46a6..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class TeamPersonnelModel -{ - public string Name { get; set; } - - public string? DisplayName { get; set; } - - public string Avatar { get; set; } - - public string Account { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ThirdPartyIdentityModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ThirdPartyIdentityModel.cs deleted file mode 100644 index ac562c632..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ThirdPartyIdentityModel.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class ThirdPartyIdentityModel -{ - /// - /// Unique identifier, usually the user ID - /// - public string Subject { get; set; } - - /// - /// actual name - /// - public string? Name { get; set; } - - public string? NickName { get; set; } - - public string? MiddleName { get; set; } - - public string? FamilyName { get; set; } - - public string? GivenName { get; set; } - - public string? PreferredUserName { get; set; } - - /// - /// Basic information - /// - public string? Profile { get; set; } - - /// - /// avatar - /// - public string? Picture { get; set; } - - public string? WebSite { get; set; } - - public string? Email { get; set; } - - public string? Gender { get; set; } - - public string? BirthDate { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Address { get; set; } - - /// - /// detailed address - /// - public string? Formatted { get; set; } - - public string? StreetAddress { get; set; } - - /// - /// city - /// - public string? Locality { get; set; } - - /// - /// Province - /// - public string? Region { get; set; } - - public string? PostalCode { get; set; } - - public string? Country { get; set; } - - public string? Account { get; set; } - - public string? Company { get; set; } - - public DateTime? UpdatedAt { get; set; } - - public string Issuer { get; set; } = ""; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ThirdPartyIdpModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ThirdPartyIdpModel.cs deleted file mode 100644 index 315bdd103..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ThirdPartyIdpModel.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class ThirdPartyIdpModel -{ - public string ClientId { get; set; } - - public string ClientSecret { get; set; } - - public string Url { get; set; } - - public AuthenticationTypes VerifyType { get; set; } - - public string Name { get; set; } - - public string DisplayName { get; set; } - - public string Icon { get; set; } - - public ThirdPartyIdpTypes ThirdPartyIdpType { get; set; } - - public string CallbackPath { get; set; } = ""; - - public string AuthorizationEndpoint { get; set; } = ""; - - public string TokenEndpoint { get; set; } = ""; - - public string UserInformationEndpoint { get; set; } = ""; - - public bool MapAll { get; set; } - - public Dictionary JsonKeyMap { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TokenModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TokenModel.cs deleted file mode 100644 index 331581805..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TokenModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class TokenModel -{ - public string AccessToken { get; set; } - - public string IdentityToken { get; set; } - - public string RefreshToken { get; set; } - - public int ExpiresIn { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UnbindUserRolesModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UnbindUserRolesModel.cs deleted file mode 100644 index b864a0176..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UnbindUserRolesModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UnbindUserRolesModel -{ - public Guid Id { get; set; } - - public IEnumerable RoleCodes { get; set; } = new List(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateCurrentTeamModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateCurrentTeamModel.cs deleted file mode 100644 index d7d951147..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateCurrentTeamModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateCurrentTeamModel -{ - public Guid UserId { get; set; } - - public Guid TeamId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateStaffAvatarModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateStaffAvatarModel.cs deleted file mode 100644 index f280d0fbe..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateStaffAvatarModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateStaffAvatarModel -{ - public Guid UserId { get; set; } - - public string Avatar { get; set; } = ""; - - public UpdateStaffAvatarModel() - { - } - - public UpdateStaffAvatarModel(Guid userId, string avatar) - { - UserId = userId; - Avatar = avatar; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateStaffBasicInfoModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateStaffBasicInfoModel.cs deleted file mode 100644 index fde4f3153..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateStaffBasicInfoModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateStaffBasicInfoModel -{ - public Guid UserId { get; set; } - - public string Name { get; set; } = ""; - - public string DisplayName { get; set; } = ""; - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } - - public GenderTypes Gender { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserAvatarModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserAvatarModel.cs deleted file mode 100644 index 84c375889..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserAvatarModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateUserAvatarModel -{ - public Guid Id { get; set; } - - public string Avatar { get; set; } = ""; - - public UpdateUserAvatarModel() - { - } - - public UpdateUserAvatarModel(Guid id, string avatar) - { - Id = id; - Avatar = avatar; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs deleted file mode 100644 index 2e688fe09..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateUserBasicInfoModel -{ - public Guid Id { get; set; } - - public string Name { get; set; } = ""; - - public string DisplayName { get; set; } = ""; - - public string? Avatar { get; set; } - - public GenderTypes Gender { get; set; } - - public string? CompanyName { get; set; } - - public string? Department { get; set; } - - public string? Position { get; set; } - - public AddressValueModel Address { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserEmailModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserEmailModel.cs deleted file mode 100644 index 11fa19223..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserEmailModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateUserEmailModel -{ - public Guid Id { get; set; } - - public string Email { get; set; } = ""; - - public UpdateUserEmailModel() - { - - } - - public UpdateUserEmailModel(Guid id, string email) - { - Id = id; - Email = email; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs deleted file mode 100644 index 533894541..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateUserPasswordModel -{ - public Guid Id { get; set; } - - public string? OldPassword { get; set; } - - public string NewPassword { get; set; } = ""; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPhoneNumberModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPhoneNumberModel.cs deleted file mode 100644 index 0fe942e53..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPhoneNumberModel.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateUserPhoneNumberModel -{ - public Guid Id { get; set; } - - public string PhoneNumber { get; set; } = ""; - - public string VerificationCode { get; set; } = ""; - - public UpdateUserPhoneNumberModel() - { - } - - public UpdateUserPhoneNumberModel(Guid id, string phoneNumber, string verificationCode) - { - Id = id; - PhoneNumber = phoneNumber; - VerificationCode = verificationCode; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertThirdPartyUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertThirdPartyUserModel.cs deleted file mode 100644 index f70085239..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertThirdPartyUserModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpsertThirdPartyUserModel : UpsertUserModel -{ - public string ThridPartyIdentity { get; set; } = ""; - - public object ExtendedData { get; set; } - - public string Scheme { get; set; } - - public Dictionary ClaimData { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs deleted file mode 100644 index 981d526ce..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpsertUserModel : AddUserModel -{ - public Guid Id { get; set; } - - public List RoleCodes { get; set; } = new(); -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserClaimValuesModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserClaimValuesModel.cs deleted file mode 100644 index ee42d73f3..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserClaimValuesModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserClaimValuesModel -{ - public Guid UserId { get; set; } - - public Dictionary ClaimValues { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs deleted file mode 100644 index 6523e2661..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserModel -{ - public Guid Id { get; set; } - - public string? Name { get; set; } - - public string DisplayName { get; set; } - - public string? StaffDisplayName { get; set; } - - public string Account { get; set; } - - public GenderTypes Gender { get; set; } - - public string Avatar { get; set; } - - public string? IdCard { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } - - public string? CompanyName { get; set; } - - public string? Department { get; set; } - - public string? Position { get; set; } - - public bool Enabled { get; set; } = true; - - public bool IsDeleted { get; set; } - - public AddressValueModel Address { get; set; } = new(); - - public List Roles { get; set; } = new(); - - public List Permissions { get; set; } = new(); - - public Guid? StaffId { get; set; } - - //only for staff - public Guid? CurrentTeamId { get; set; } - - public DateTime CreationTime { get; set; } - - public string RealDisplayName => StaffDisplayName.IsNullOrEmpty() ? DisplayName : StaffDisplayName; - - public Dictionary ClaimData { get; set; } = new(); - - public UserModel() - { - Avatar = ""; - Account = ""; - } - - public UserModel( - Guid id, - string? name, - string displayName, - string staffDisplayName, - string account, - GenderTypes gender, - string avatar, - string? idCard, - string? phoneNumber, - string? email, - string? companyName, - string? department, - string? position, - AddressValueModel address) - { - Id = id; - Name = name; - DisplayName = displayName; - StaffDisplayName = staffDisplayName; - Account = account; - Gender = gender; - Avatar = avatar; - IdCard = idCard; - PhoneNumber = phoneNumber; - Email = email; - CompanyName = companyName; - Department = department; - Position = position; - Address = address; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs deleted file mode 100644 index df76bc966..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserPortraitModel -{ - public Guid Id { get; set; } - - public string Account { get; set; } - - public string Name { get; set; } - - public string DisplayName { get; set; } - - public string Avatar { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSelectModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSelectModel.cs deleted file mode 100644 index d75d0a521..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSelectModel.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserSelectModel -{ - public Guid Id { get; set; } - - public string? Name { get; set; } - - public string DisplayName { get; set; } - - public string Account { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } - - public string Avatar { get; set; } - - public UserSelectModel() - { - DisplayName = ""; - Account = ""; - Avatar = ""; - } - - public UserSelectModel(Guid id, string name, string displayName, string account, string phoneNumber, string email, string avatar) - { - Id = id; - Name = name; - DisplayName = displayName; - Account = account; - PhoneNumber = phoneNumber; - Email = email; - Avatar = avatar; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs deleted file mode 100644 index 14cbe1c49..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserSimpleModel -{ - public Guid Id { get; set; } - - public string Account { get; set; } - - public string? DisplayName { get; set; } - - public UserSimpleModel(Guid id, string account, string? displayName) - { - Id = id; - Account = account; - DisplayName = displayName; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs deleted file mode 100644 index 6e3e02a8f..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserVisitedModel -{ - public string Name { get; set; } = string.Empty; - - public string Url { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ValidateAccountModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ValidateAccountModel.cs deleted file mode 100644 index ec6149e23..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ValidateAccountModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class ValidateAccountModel : IEnvironmentModel -{ - public string Account { get; set; } - - public string Password { get; set; } - - public bool LdapLogin { get; set; } - - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/VerifyMsgCodeModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/VerifyMsgCodeModel.cs deleted file mode 100644 index bd6974b1f..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/VerifyMsgCodeModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class VerifyMsgCodeModel -{ - public Guid UserId { get; set; } - - public string Code { get; set; } - - public string? PhoneNumber { get; set; } - - public SendMsgCodeTypes SendMsgCodeType { get; set; } = SendMsgCodeTypes.VerifiyPhoneNumber; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/UserStatusException.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/UserStatusException.cs deleted file mode 100644 index c232f8097..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/UserStatusException.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using System.Runtime.Serialization; - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts; - -[Serializable] -public class UserStatusException : UserFriendlyException -{ - public UserStatusException(string message) : base(message) - { - } - - public UserStatusException(string errorCode, params object[] parameters) - : base(errorCode, null, parameters) - { - } - - protected UserStatusException(SerializationInfo serializationInfo, StreamingContext context) - : base(serializationInfo, context) - { - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs deleted file mode 100644 index 2230b76fe..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Identity; -global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; -global using Masa.BuildingBlocks.StackSdks.Isolation.Models; -global using System.ComponentModel; diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs deleted file mode 100644 index 8db93ff86..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth; - -public interface IAuthClient -{ - IUserService UserService { get; } - - ISubjectService SubjectService { get; } - - ITeamService TeamService { get; } - - IPermissionService PermissionService { get; } - - IProjectService ProjectService { get; } - - ICustomLoginService CustomLoginService { get; } - - IThirdPartyIdpService ThirdPartyIdpService { get; } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/ISsoClient.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/ISsoClient.cs deleted file mode 100644 index 4485c4399..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/ISsoClient.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth; - -public interface ISsoClient -{ - ILoginService LoginService { get; } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj deleted file mode 100644 index d79733893..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ICustomLoginService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ICustomLoginService.cs deleted file mode 100644 index 245c5fd86..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ICustomLoginService.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface ICustomLoginService -{ - Task GetCustomLoginByClientIdAsync(string environment, string clientId); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ILoginService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ILoginService.cs deleted file mode 100644 index ba5e5e8f2..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ILoginService.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface ILoginService -{ - Task LoginByPasswordAsync(LoginByPasswordModel login); - - Task LoginByPhoneNumberAsync(LoginByPhoneNumberFromSsoModel login); - - Task LoginByThirdPartyIdpAsync(LoginByThirdPartyIdpModel login); - - Task LoginByLdapAsync(LoginByLdapModel login); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs deleted file mode 100644 index 8ccb4d687..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface IPermissionService -{ - /// - /// Get menus for the appid with current user - /// - /// - /// - Task> GetMenusAsync(string appId); - - /// - /// Get element permissions for the appid with current user - /// - /// - /// - Task> GetElementPermissionsAsync(string appId); - - Task AuthorizedAsync(string appId, string code); - - Task AddFavoriteMenuAsync(Guid menuId); - - Task RemoveFavoriteMenuAsync(Guid menuId); - - Task> GetFavoriteMenuListAsync(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs deleted file mode 100644 index 3b1157237..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface IProjectService -{ - Task> GetGlobalNavigations(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs deleted file mode 100644 index 3eb636495..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface ISubjectService -{ - Task> GetListAsync(string filter); -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs deleted file mode 100644 index 6d6370d08..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface ITeamService -{ - Task GetDetailAsync(Guid id); - - Task> GetAllAsync(string environment); - - Task> GetUserTeamsAsync(); -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IThirdPartyIdpService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IThirdPartyIdpService.cs deleted file mode 100644 index b20ee8904..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IThirdPartyIdpService.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface IThirdPartyIdpService -{ - Task> GetAllAsync(); - - Task> GetAllFromCacheAsync(); - - Task GetLdapOptionsAsync(string scheme); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs deleted file mode 100644 index 8a57a4088..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface IUserService -{ - Task> GetListByTeamAsync(Guid teamId); - - Task> GetListByRoleAsync(Guid roleId); - - Task> GetListByDepartmentAsync(Guid departmentId); - - Task GetTotalByDepartmentAsync(Guid departmentId); - - Task GetTotalByRoleAsync(Guid roleId); - - Task GetTotalByTeamAsync(Guid teamId); - - Task AddAsync(AddUserModel user); - - Task UpsertThirdPartyUserAsync(UpsertThirdPartyUserModel user); - - Task RemoveThirdPartyUserAsync(Guid id); - - Task RemoveThirdPartyUserByThridPartyIdentityAsync(string thridPartyIdentity); - - Task AddThirdPartyUserAsync(AddThirdPartyUserModel user, bool whenExistReturn = true); - - Task GetThirdPartyUserAsync(GetThirdPartyUserModel model); - - Task GetThirdPartyUserByUserIdAsync(GetThirdPartyUserByUserIdModel model); - - Task UpsertAsync(UpsertUserModel user); - - Task ValidateAccountAsync(ValidateAccountModel validateAccountModel); - - Task GetByAccountAsync(string account); - - Task GetByPhoneNumberAsync(string phoneNumber); - - Task GetByEmailAsync(string email); - - Task GetByIdAsync(Guid userId); - - Task GetCurrentUserAsync(); - - Task GetCurrentStaffAsync(); - - Task VisitedAsync(string appId, string url); - - Task> GetVisitedListAsync(); - - Task UpdatePasswordAsync(UpdateUserPasswordModel user); - - Task UpdateUserAvatarAsync(UpdateUserAvatarModel user); - - Task UpdateStaffAvatarAsync(UpdateStaffAvatarModel staff); - - Task SendMsgCodeAsync(SendMsgCodeModel model); - - Task VerifyMsgCodeAsync(VerifyMsgCodeModel model); - - Task UpdatePhoneNumberAsync(UpdateUserPhoneNumberModel user); - - Task UpdateBasicInfoAsync(UpdateUserBasicInfoModel user); - - Task UpdateStaffBasicInfoAsync(UpdateStaffBasicInfoModel staff); - - Task> GetListByIdsAsync(params Guid[] userIds); - - Task UpsertSystemDataAsync(Guid userId, string systemId, T data); - - Task UpsertSystemDataAsync(string systemId, T data); - - Task GetSystemDataAsync(string systemId); - - Task GetSystemDataAsync(Guid userId, string systemId); - - Task> GetSystemListDataAsync(IEnumerable userIds, string systemId); - - Task DisableAsync(DisableUserModel user); - - Task> GetListByAccountAsync(IEnumerable accounts); - - Task LoginByPhoneNumberAsync(LoginByPhoneNumberModel login); - - Task RemoveUserRolesAsync(RemoveUserRolesModel user); - - Task SetCurrentTeamAsync(Guid teamId); - - Task SendEmailAsync(SendEmailModel model); - - Task RegisterByPhoneAsync(RegisterByPhoneModel model); - - Task RegisterByEmailAsync(RegisterByEmailModel model); - - Task HasPasswordAsync(Guid userId = default); - - Task RegisterThirdPartyUserAsync(RegisterThirdPartyUserModel model); - - Task HasPhoneNumberInEnvAsync(string env, string phoneNumber); - - Task ResetPasswordByEmailAsync(ResetPasswordByEmailModel resetPasswordByEmailModel); - - Task ResetPasswordByPhoneAsync(ResetPasswordByPhoneModel resetPasswordByPhoneModel); - - Task RemoveAsync(Guid id); - - Task> SearchAsync(string search); - - Task BindRolesAsync(BindUserRolesModel model); - - Task UnbindRolesAsync(UnbindUserRolesModel model); - - Task> GetClaimValuesAsync(Guid userId); - - Task AddClaimValuesAsync(UserClaimValuesModel userClaimValuesModel); - - Task GetImpersonateAsync(GetImpersonateInputModel model); - - Task ImpersonateAsync(ImpersonateInputModel model); -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs deleted file mode 100644 index a3ed35b1a..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; -global using Masa.BuildingBlocks.StackSdks.Auth.Service; diff --git a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Enum/ConfigFormats.cs b/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Enum/ConfigFormats.cs deleted file mode 100644 index cfe9e4b83..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Enum/ConfigFormats.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Dcc.Contracts.Enum; - -public enum ConfigFormats -{ - Properties = 1, - RAW, - JSON, - YAML, - XML -} diff --git a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Masa.BuildingBlocks.StackSdks.Dcc.Contracts.csproj b/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Masa.BuildingBlocks.StackSdks.Dcc.Contracts.csproj deleted file mode 100644 index dac1d812f..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Masa.BuildingBlocks.StackSdks.Dcc.Contracts.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Model/LabelModel.cs b/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Model/LabelModel.cs deleted file mode 100644 index 2c7b3eb49..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Model/LabelModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Dcc.Contracts.Model; - -public class LabelModel -{ - public int Id { get; set; } - - public string Code { get; set; } = ""; - - public string Name { get; set; } = ""; - - public string TypeCode { get; set; } = ""; - - public string TypeName { get; set; } = ""; - - public string Description { get; set; } = ""; -} diff --git a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Model/PublishReleaseModel.cs b/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Model/PublishReleaseModel.cs deleted file mode 100644 index acb2caa21..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/Model/PublishReleaseModel.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Dcc.Contracts.Model; - -public class PublishReleaseModel -{ - private ConfigFormats _configFormat; - public ConfigFormats ConfigFormat - { - get - { - try - { - if (_configFormat == 0 && !string.IsNullOrWhiteSpace(FormatLabelCode)) - _configFormat = (ConfigFormats)System.Enum.Parse(typeof(ConfigFormats), FormatLabelCode); - } - catch (Exception ex) - { - throw new NotSupportedException("Unsupported configuration type", ex); - } - - return _configFormat; - } - set - { - _configFormat = value; - } - } - - public string? FormatLabelCode { get; set; } - - public bool Encryption { get; set; } - - public string? Content { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/_imports.cs b/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/_imports.cs deleted file mode 100644 index ec67ddc5b..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc.Contracts/_imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Dcc.Contracts.Enum; diff --git a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs b/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs deleted file mode 100644 index e1d7971f0..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Dcc; - -public interface IDccClient -{ - public ILabelService LabelService { get; } -} diff --git a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj b/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj deleted file mode 100644 index d63cea089..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs b/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs deleted file mode 100644 index 0d4c1417a..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Dcc.Service; - -public interface ILabelService -{ - Task> GetListByTypeCodeAsync(string typeCode); -} diff --git a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs b/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs deleted file mode 100644 index ba1afb53c..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Dcc.Contracts.Model; -global using Masa.BuildingBlocks.StackSdks.Dcc.Service; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs deleted file mode 100644 index 20c08dd9a..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc; - -public interface ITscClient -{ - public ILogService LogService { get; } - - public IMetricService MetricService { get; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj deleted file mode 100644 index a48e95eff..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs deleted file mode 100644 index 0e2020489..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; - -public class LogLatestRequest -{ - public string Query { get; set; } - - public DateTime Start { get; set; } - - public DateTime End { get; set; } - - public bool IsDesc { get; set; } = true; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs deleted file mode 100644 index c3ea5cc4b..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; - -public class LableValuesRequest -{ - private readonly string[] _match = new string[1]; - - /// - /// it for the parameter `match` whitch is IEnumerable - /// and in this case only support single mode,for example: - /// Match="up", last `Matches` result is (IEnumerable){"up"} - /// - [JsonIgnore] - public string Match { get { return _match[0]; } set { _match[0] = value; } } - - /// - /// for parameter transform - /// - [JsonPropertyName("match")] - public IEnumerable Matches { get { return _match; } } - - public DateTime Start { get; set; } - - public DateTime End { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs deleted file mode 100644 index ab79dc846..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; - -public class ValuesRequest -{ - public string Match { get; set; } - - /// - /// for parameter `match` child, for example - /// Match = "up", Lables=new string[]{ "instance=\"k8s-hz-001\"" }, last result is 'up{instance="k8s-hz-001"} for `Match`' - /// - [JsonIgnore] - public IEnumerable? Lables { get; set; } - - public DateTime Start { get; set; } - - public DateTime End { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs deleted file mode 100644 index 0975e2943..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Service; - -public interface ILogService -{ - Task> GetMappingAsync(); - - Task GetAggregationAsync(SimpleAggregateRequestDto query); - - Task GetLatestAsync(LogLatestRequest query); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs deleted file mode 100644 index cbd2b3bcf..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Service; - -public interface IMetricService -{ - Task> GetNamesAsync(IEnumerable? match); - - Task>> GetLabelValuesAsync(LableValuesRequest query); - - Task GetValuesAsync(ValuesRequest query); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs deleted file mode 100644 index 6ecfd3ebd..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Log; -global using Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model; -global using Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model.Aggregate; -global using Masa.BuildingBlocks.StackSdks.Tsc.Model; -global using Masa.BuildingBlocks.StackSdks.Tsc.Service; -global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlarmCheckFrequencyType.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlarmCheckFrequencyType.cs deleted file mode 100644 index 55754d2ce..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlarmCheckFrequencyType.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Enum; - -public enum AlarmCheckFrequencyType -{ - FixedInterval = 1, - Cron, -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlarmRuleType.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlarmRuleType.cs deleted file mode 100644 index 841f114b5..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlarmRuleType.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Enum; - -public enum AlarmRuleType -{ - Log = 1, - Metric, -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlertSeverity.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlertSeverity.cs deleted file mode 100644 index e62f95a79..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/AlertSeverity.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Enum; - -public enum AlertSeverity -{ - Serious = 1, - High, - Secondary, - Low, - Report -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/LogAggregationType.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/LogAggregationType.cs deleted file mode 100644 index e8adb0de5..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/LogAggregationType.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Enum; - -public enum LogAggregationType -{ - Count = 1, - Sum, - Avg -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/MetricAggregationType.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/MetricAggregationType.cs deleted file mode 100644 index b0f8ee59f..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/MetricAggregationType.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Enum; - -public enum MetricAggregationType -{ - Count = 1, - Sum, - Avg -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/MetricComparisonOperator.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/MetricComparisonOperator.cs deleted file mode 100644 index 0449f4d91..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/MetricComparisonOperator.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Enum; - -public enum MetricComparisonOperator -{ - GreaterThan = 1, - GreaterOrEqual, - LessThan, - LessOrEqual, - Equal, - NotEqual -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/SilenceCycleType.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/SilenceCycleType.cs deleted file mode 100644 index 61bc8c936..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/SilenceCycleType.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Enum; - -public enum SilenceCycleType -{ - Time = 1, - Cycle -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/TimeType.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/TimeType.cs deleted file mode 100644 index 49e121868..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Enum/TimeType.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Enum; - -public enum TimeType -{ - Minute = 1, - Hour, - Day -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/IAlertClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/IAlertClient.cs deleted file mode 100644 index e6a87efa7..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/IAlertClient.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert; - -public interface IAlertClient -{ - IAlarmRuleService AlarmRuleService { get; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Masa.BuildingBlocks.StackSdks.Alert.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Masa.BuildingBlocks.StackSdks.Alert.csproj deleted file mode 100644 index 61538f600..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Masa.BuildingBlocks.StackSdks.Alert.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleItemModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleItemModel.cs deleted file mode 100644 index 1f106dba4..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleItemModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class AlarmRuleItemModel -{ - public Guid AlarmRuleId { get; set; } - - public string Expression { get; set; } = string.Empty; - - public AlertSeverity AlertSeverity { get; set; } - - public bool IsRecoveryNotification { get; set; } - - public bool IsNotification { get; set; } - - public NotificationConfigModel RecoveryNotificationConfig { get; set; } = new(); - - public NotificationConfigModel NotificationConfig { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleModel.cs deleted file mode 100644 index b863acbad..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleModel.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class AlarmRuleModel -{ - public Guid Id { get; set; } - - public AlarmRuleType Type { get; set; } - - public string DisplayName { get; set; } = string.Empty; - - public string ProjectIdentity { get; set; } = string.Empty; - - public string AppIdentity { get; set; } = string.Empty; - - public string ChartYAxisUnit { get; set; } = string.Empty; - - public CheckFrequencyModel CheckFrequency { get; set; } = new(); - - public string WhereExpression { get; set; } = string.Empty; - - public string QueryStr { get; set; } = string.Empty; - - public int ContinuousTriggerThreshold { get; set; } - - public SilenceCycleModel SilenceCycle { get; set; } = new(); - - public bool IsEnabled { get; set; } - - public List LogMonitorItems { get; set; } = new(); - - public List MetricMonitorItems { get; set; } = new(); - - public List Items { get; set; } = new(); - - public string ModifierName { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleUpsertModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleUpsertModel.cs deleted file mode 100644 index 2e7350812..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/AlarmRuleUpsertModel.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class AlarmRuleUpsertModel -{ - public string DisplayName { get; set; } = string.Empty; - - public AlarmRuleType Type { get; set; } - - public string ProjectIdentity { get; set; } = string.Empty; - - public string AppIdentity { get; set; } = string.Empty; - - public string ChartYAxisUnit { get; set; } = string.Empty; - - public CheckFrequencyModel CheckFrequency { get; set; } = new(); - - public string WhereExpression { get; set; } = string.Empty; - - public int ContinuousTriggerThreshold { get; set; } - - public SilenceCycleModel SilenceCycle { get; set; } = new(); - - public bool IsEnabled { get; set; } - - public List LogMonitorItems { get; set; } = new(); - - public List MetricMonitorItems { get; set; } = new(); - - public List Items { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/CheckFrequencyModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/CheckFrequencyModel.cs deleted file mode 100644 index 9750f6eb7..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/CheckFrequencyModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class CheckFrequencyModel -{ - public AlarmCheckFrequencyType Type { get; set; } - - public TimeIntervalModel FixedInterval { get; set; } = new(); - - public string CronExpression { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/LogMonitorItemModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/LogMonitorItemModel.cs deleted file mode 100644 index 94765a42f..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/LogMonitorItemModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class LogMonitorItemModel -{ - public string Field { get; set; } = string.Empty; - - public LogAggregationType AggregationType { get; set; } - - public string Alias { get; set; } = string.Empty; - - public bool IsOffset { get; set; } - - public int OffsetPeriod { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/MetricAggregationModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/MetricAggregationModel.cs deleted file mode 100644 index df8dbf588..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/MetricAggregationModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class MetricAggregationModel -{ - public string Name { get; set; } = string.Empty; - - public string Tag { get; set; } = string.Empty; - - public MetricComparisonOperator ComparisonOperator { get; set; } = MetricComparisonOperator.Equal; - - public string Value { get; set; } = string.Empty; - - public MetricAggregationType AggregationType { get; set; } = MetricAggregationType.Count; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/MetricMonitorItemModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/MetricMonitorItemModel.cs deleted file mode 100644 index bfac31044..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/MetricMonitorItemModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class MetricMonitorItemModel -{ - public bool IsExpression { get; set; } - - public string Expression { get; set; } = string.Empty; - - public MetricAggregationModel Aggregation { get; set; } = new(); - - public string Alias { get; set; } = string.Empty; - - public bool IsOffset { get; set; } - - public int OffsetPeriod { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/NotificationConfigModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/NotificationConfigModel.cs deleted file mode 100644 index e165e2841..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/NotificationConfigModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class NotificationConfigModel -{ - public string ChannelCode { get; set; } = default!; - - public string TemplateCode { get; set; } = default!; - - public string TemplateName { get; set; } = default!; - - public int ChannelType { get; set; } - - public List Receivers { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/SilenceCycleModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/SilenceCycleModel.cs deleted file mode 100644 index e5cbeecce..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/SilenceCycleModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class SilenceCycleModel -{ - public SilenceCycleType Type { get; set; } - - public TimeIntervalModel TimeInterval { get; set; } = new(); - - public int SilenceCycleValue { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/TimeIntervalModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/TimeIntervalModel.cs deleted file mode 100644 index 7c35b091f..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Model/TimeIntervalModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Model; - -public class TimeIntervalModel -{ - public int IntervalTime { get; set; } - - public TimeType IntervalTimeType { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmHistoryService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmHistoryService.cs deleted file mode 100644 index 7d9ec73d1..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmHistoryService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Service; - -public interface IAlarmHistoryService -{ - Task ChangeHandlerAsync(Guid id, Guid handler); - - Task CompletedAsync(Guid id); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmRuleService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmRuleService.cs deleted file mode 100644 index 331cc3827..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmRuleService.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Alert.Service; - -public interface IAlarmRuleService -{ - Task CreateAsync(AlarmRuleUpsertModel options); - - Task UpdateAsync(Guid id, AlarmRuleUpsertModel options); - - Task DeleteAsync(Guid id); - - Task GetAsync(Guid id); - - Task SetIsEnabledAsync(Guid id, bool isEnabled); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/_Imports.cs deleted file mode 100644 index 1a88fdacb..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Alert.Enum; -global using Masa.BuildingBlocks.StackSdks.Alert.Model; -global using Masa.BuildingBlocks.StackSdks.Alert.Service; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/IMasaStackConfig.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/IMasaStackConfig.cs deleted file mode 100644 index 990209e87..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/IMasaStackConfig.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Config; - -public interface IMasaStackConfig -{ - public RedisModel RedisModel { get; } - - public ElasticModel ElasticModel { get; } - - public bool IsDemo { get; } - - public string Version { get; } - - public string Environment { get; } - - public string Namespace { get; } - - public string Cluster { get; } - - public string OtlpUrl { get; } - - public string DomainName { get; } - - public string AdminPwd { get; } - - public string DccSecret { get; } - - public string SuffixIdentity { get; } - - List GetProjectList(); - - string GetValue(string key); - - Dictionary GetValues(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/IMultiEnvironmentMasaStackConfig.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/IMultiEnvironmentMasaStackConfig.cs deleted file mode 100644 index ee90538e9..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/IMultiEnvironmentMasaStackConfig.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Config -{ - public interface IMultiEnvironmentMasaStackConfig - { - IMasaStackConfig SetEnvironment(string environment); - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Masa.BuildingBlocks.StackSdks.Config.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Masa.BuildingBlocks.StackSdks.Config.csproj deleted file mode 100644 index 61538f600..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Masa.BuildingBlocks.StackSdks.Config.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/MasaStackConfigConstant.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/MasaStackConfigConstant.cs deleted file mode 100644 index e36e0fba2..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/MasaStackConfigConstant.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Config; - -public static class MasaStackConfigConstant -{ - public const string VERSION = "MASA_VERSION"; - public const string ELASTIC = "ELASTIC"; - public const string ENVIRONMENT = "MASA_ENVIRONMENT"; - public const string IS_DEMO = "IS_DEMO"; - public const string REDIS = "REDIS"; - public const string CLUSTER = "MASA_CLUSTER"; - public const string DOMAIN_NAME = "DOMAIN_NAME"; - public const string NAMESPACE = "MASA_NAMESPACE"; - public const string CONNECTIONSTRING = "CONNECTIONSTRING"; - public const string MASA_STACK = "MASA_STACK"; - public const string OTLP_URL = "OTLP_URL"; - public const string ADMIN_PWD = "ADMIN_PWD"; - public const string DCC_SECRET = "DCC_SECRET"; - public const string SUFFIX_IDENTITY = "SUFFIX_IDENTITY"; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/MasaStackConfigExtensions.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/MasaStackConfigExtensions.cs deleted file mode 100644 index 73f452ff7..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/MasaStackConfigExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Config; - -public static class MasaStackConfigExtensions -{ - public static Guid GetDefaultUserId(this IMasaStackConfig masaStackConfig) - { - return CreateGuid(masaStackConfig.Namespace); - } - - public static Guid GetDefaultTeamId(this IMasaStackConfig masaStackConfig) - { - return CreateGuid($"{masaStackConfig.Namespace} team"); - } - - static Guid CreateGuid(string str) - { -#pragma warning disable S4790 - using var md5 = MD5.Create(); -#pragma warning restore S4790 - byte[] hash = md5.ComputeHash(Encoding.Default.GetBytes(str)); - return new Guid(hash); - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/DbModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/DbModel.cs deleted file mode 100644 index 4d8213844..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/DbModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Config.Models; - -public class DbModel -{ - public string Server { get; set; } - - public int Port { get; set; } = 1433; - - public string Database { get; set; } - - public string UserId { get; set; } - - public string Password { get; set; } - - public string ToString(string datebase) - { - return $"Server={Server},{Port};Database={datebase};User Id={UserId};Password={Password};"; - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/ElasticModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/ElasticModel.cs deleted file mode 100644 index 28209a1ec..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/ElasticModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Config.Models; - -public class ElasticModel -{ - public List Nodes { get; set; } - - public string Index { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/RedisModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/RedisModel.cs deleted file mode 100644 index a076fce63..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/Models/RedisModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Config.Models; - -public class RedisModel -{ - public string RedisHost { get; set; } - - public int RedisPort { get; set; } - - public int RedisDb { get; set; } - - public string RedisPassword { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/_Imports.cs deleted file mode 100644 index 8ae368824..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Config/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Config; -global using Masa.BuildingBlocks.StackSdks.Config.Models; -global using System.Security.Cryptography; -global using System.Text; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/DccConsts.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/DccConsts.cs deleted file mode 100644 index 9475cbd6b..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/DccConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Isolation; - -public static class DccConsts -{ - public const string PUBLIC_ID = "public-$Config"; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/EnvironmentProvider.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/EnvironmentProvider.cs deleted file mode 100644 index 092002237..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/EnvironmentProvider.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Isolation; - -public class EnvironmentProvider -{ - readonly List _environments; - - public EnvironmentProvider(List environments) - { - _environments = environments; - } - - public List GetEnvionments() - { - return _environments; - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/IsolationConsts.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/IsolationConsts.cs deleted file mode 100644 index 080975d53..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/IsolationConsts.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Isolation; - -public static class IsolationConsts -{ - public const string ENVIRONMENT = "Environment"; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Masa.BuildingBlocks.StackSdks.Isolation.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Masa.BuildingBlocks.StackSdks.Isolation.csproj deleted file mode 100644 index d2d1c63bb..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Masa.BuildingBlocks.StackSdks.Isolation.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Models/IEnvironmentModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Models/IEnvironmentModel.cs deleted file mode 100644 index 5ec7b569f..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Models/IEnvironmentModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Isolation.Models; - -public interface IEnvironmentModel -{ - public string Environment { get; set; } -} - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Models/OssOptions.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Models/OssOptions.cs deleted file mode 100644 index dd6b3c58b..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/Models/OssOptions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Isolation.Models; - -public class OssOptions -{ - public string AccessId { get; set; } = ""; - - public string AccessSecret { get; set; } = ""; - - public string Bucket { get; set; } = ""; - - public string Endpoint { get; set; } = ""; - - public string RoleArn { get; set; } = ""; - - public string RoleSessionName { get; set; } = ""; - - public string RegionId { get; set; } = ""; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/_Imports.cs deleted file mode 100644 index f5c8cbc4c..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Isolation/_Imports.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs deleted file mode 100644 index ec3cf0c3b..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum ChannelTypes -{ - Sms = 1, - Email, - WebsiteMessage, - App -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs deleted file mode 100644 index babf49792..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTaskReceiverTypes -{ - User = 1, - Organization, - Role, - Team, - Group -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs deleted file mode 100644 index e8c70f610..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTaskSelectReceiverTypes -{ - ManualSelection = 1, - BatchUpload -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs deleted file mode 100644 index 3133a88eb..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTaskSources -{ - Management = 1, - Sdk, -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs deleted file mode 100644 index a02130d88..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTaskStatuses -{ - NotPublished = 1, - InProgress, - Cancel, - Published, - PublishedFailed, - PartialFailed -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs deleted file mode 100644 index 66b7abbd2..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTemplateAuditStatuses -{ - Waited = 1, - Approved, - Failed, -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs deleted file mode 100644 index 412def79e..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTemplateStates -{ - Normal = 1, - Invalid -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs deleted file mode 100644 index 4d49430d7..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTypes -{ - Ordinary = 1, - Template -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs deleted file mode 100644 index da0924f5a..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum ReceiverGroupItemTypes -{ - User = 1, - Organization, - Role, - Team -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs deleted file mode 100644 index bb3015eba..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum SendTargets -{ - Assign = 1, - Broadcast -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs deleted file mode 100644 index a50c75583..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum WebsiteMessageFilterType -{ - Title = 1, - Content, -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs deleted file mode 100644 index 935e624f5..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc; - -public interface IMcClient -{ - IChannelService ChannelService { get; } - - IMessageTaskService MessageTaskService { get; } - - IMessageTemplateService MessageTemplateService { get; } - - IReceiverGroupService ReceiverGroupService { get; } - - IWebsiteMessageService WebsiteMessageService { get; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs deleted file mode 100644 index b8ff3d9be..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System.Collections.Concurrent; - -[Serializable] -public class ExtraPropertyDictionary : ConcurrentDictionary -{ - public ExtraPropertyDictionary() - { - - } - - public ExtraPropertyDictionary(IDictionary dictionary) - : base(dictionary) - { - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj deleted file mode 100644 index 2c3bf4134..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs deleted file mode 100644 index 9b4217c7a..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class AuditEntityModel : EntityModel -{ - public TUserId Creator { get; set; } = default!; - - public DateTime CreationTime { get; set; } - - public TUserId Modifier { get; set; } = default!; - - public DateTime ModificationTime { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/BindClientIdModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/BindClientIdModel.cs deleted file mode 100644 index de4c83f16..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/BindClientIdModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class BindClientIdModel -{ - public string ChannelCode { get; set; } = string.Empty; - - public string ClientId { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs deleted file mode 100644 index f1ba0051e..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ChannelModel : AuditEntityModel -{ - public string DisplayName { get; set; } = string.Empty; - - public string Code { get; set; } = string.Empty; - - public ChannelTypes Type { get; set; } - - public string Description { get; set; } = string.Empty; - - public string Color { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/CreateChannelModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/CreateChannelModel.cs deleted file mode 100644 index 63f9fafe5..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/CreateChannelModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class CreateChannelModel -{ - public string DisplayName { get; set; } = string.Empty; - - public string Code { get; set; } = string.Empty; - - public ChannelTypes Type { get; set; } - - public string Description { get; set; } = string.Empty; - - public bool IsStatic { get; set; } - - public ExtraPropertyDictionary ExtraProperties { get; set; } = new(); - - public string Color { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs deleted file mode 100644 index ebb8df3e6..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class EntityModel -{ - public TKey Id { get; set; } = default!; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ExternalReceiverModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ExternalReceiverModel.cs deleted file mode 100644 index 2fc9d2370..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ExternalReceiverModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ExternalReceiverModel -{ - public string ChannelUserIdentity { get; set; } = string.Empty; - - public ExtraPropertyDictionary Variables { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs deleted file mode 100644 index cf32ef960..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetChannelModel : PaginatedOptions -{ - public string Filter { get; set; } = string.Empty; - - public ChannelTypes? Type { get; set; } - - public string DisplayName { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTaskModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTaskModel.cs deleted file mode 100644 index 4b288db19..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTaskModel.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetMessageTaskModel : PaginatedOptions -{ - public string Filter { get; set; } = string.Empty; - - public Guid ChannelId { get; set; } - - public string ChannelCode { get; set; } = string.Empty; - - public MessageTypes? EntityType { get; set; } - - public bool? IsDraft { get; set; } - - public bool? IsEnabled { get; set; } - - public MessageTaskTimeTypes? TimeType { get; set; } - - public DateTime? StartTime { get; set; } - - public DateTime? EndTime { get; set; } - - public MessageTaskStatuses? Status { get; set; } - - public MessageTaskSources? Source { get; set; } - - public string SystemId { get; set; } = string.Empty; - - public GetMessageTaskModel(int page, int pageSize, Dictionary? sorting = null) : base(page, pageSize, sorting) - { - - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs deleted file mode 100644 index 63382aa97..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetMessageTemplateModel : PaginatedOptions -{ - public string Filter { get; set; } = string.Empty; - - public MessageTemplateStates? Status { get; set; } - - public MessageTemplateAuditStatuses? AuditStatus { get; set; } - - public ChannelTypes? ChannelType { get; set; } - - public Guid ChannelId { get; set; } - - public DateTime? StartTime { get; set; } - - public DateTime? EndTime { get; set; } - - public int TemplateType { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs deleted file mode 100644 index bfed7b35f..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetNoticeListModel -{ - public int PageSize { get; set; } = 5; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs deleted file mode 100644 index 06af3f7c0..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetReceiverGroupModel : PaginatedOptions -{ - public string Filter { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetUnreadModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetUnreadModel.cs deleted file mode 100644 index 1bdf15e05..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetUnreadModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetUnreadModel -{ - public string ChannelCode { get; set; } = string.Empty; - - public string Tag { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs deleted file mode 100644 index 4da1f5883..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetWebsiteMessageModel : PaginatedOptions -{ - public string Filter { get; set; } = string.Empty; - - public WebsiteMessageFilterType? FilterType { get; set; } - - public Guid? ChannelId { get; set; } - - public string ChannelCode { get; set; } = string.Empty; - - public bool? IsRead { get; set; } - - public string Tag { get; set; } = string.Empty; - - public GetWebsiteMessageModel(int page, int pageSize, Dictionary? sorting = null) : base(page, pageSize, sorting) - { - - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/InternalReceiverModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/InternalReceiverModel.cs deleted file mode 100644 index 22821a572..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/InternalReceiverModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class InternalReceiverModel -{ - public Guid SubjectId { get; set; } - - public MessageTaskReceiverTypes Type { get; set; } - - public ExtraPropertyDictionary Variables { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs deleted file mode 100644 index f56dcd142..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageInfoModel -{ - public string Title { get; set; } = string.Empty; - - public string Content { get; set; } = string.Empty; - - public string Markdown { get; set; } = string.Empty; - - public bool IsJump { get; set; } - - public string JumpUrl { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs deleted file mode 100644 index d124c7862..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageInfoUpsertModel -{ - public string Title { get; set; } = string.Empty; - - public string Content { get; set; } = string.Empty; - - public string Markdown { get; set; } = string.Empty; - - public bool IsJump { get; set; } - - public string JumpUrl { get; set; } = string.Empty; - - public ExtraPropertyDictionary ExtraProperties { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs deleted file mode 100644 index b09a3bc5a..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageTaskModel : AuditEntityModel -{ - public string DisplayName { get; set; } = string.Empty; - - public Guid ChannelId { get; set; } - - public ChannelModel Channel { get; set; } = new(); - - public MessageTypes EntityType { get; set; } - - public Guid EntityId { get; set; } - - public bool IsDraft { get; set; } - - public bool IsEnabled { get; set; } - - public SendTargets ReceiverType { get; set; } - - public MessageTaskSelectReceiverTypes SelectReceiverType { get; set; } - - public DateTimeOffset? SendTime { get; set; } - - public string Sign { get; set; } = string.Empty; - - public MessageInfoModel MessageInfo { get; set; } = new(); - - public List Receivers { get; set; } = new(); - - public SendRuleModel SendRules { get; set; } = new(); - - public ExtraPropertyDictionary Variables { get; set; } = new(); - - public string Content { get; set; } = string.Empty; - - public MessageTaskStatuses Status { get; set; } - - public MessageTaskSources Source { get; set; } - - public string ModifierName { get; set; } = string.Empty; - - public ExtraPropertyDictionary ExtraProperties { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs deleted file mode 100644 index 587696efd..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageTaskReceiverModel -{ - public Guid SubjectId { get; set; } - - public string DisplayName { get; set; } = string.Empty; - - public string Avatar { get; set; } = string.Empty; - - public string PhoneNumber { get; set; } = string.Empty; - - public string Email { get; set; } = string.Empty; - - public MessageTaskReceiverTypes Type { get; set; } - - public ExtraPropertyDictionary Variables { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskTimeTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskTimeTypes.cs deleted file mode 100644 index 012c2a05e..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskTimeTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public enum MessageTaskTimeTypes -{ - ModificationTime = 1, - SendTime, -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskUpsertModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskUpsertModel.cs deleted file mode 100644 index 86b282a52..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskUpsertModel.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageTaskUpsertModel -{ - public string DisplayName { get; set; } = string.Empty; - - public Guid ChannelId { get; set; } - - public string ChannelCode { get; set; } = string.Empty; - - public ChannelTypes ChannelType { get; set; } - - public MessageTypes EntityType { get; set; } - - public Guid EntityId { get; set; } - - public bool IsDraft { get; set; } - - public bool IsEnabled { get; set; } - - public SendTargets ReceiverType { get; set; } - - public MessageTaskSelectReceiverTypes SelectReceiverType { get; set; } = MessageTaskSelectReceiverTypes.ManualSelection; - - public string Sign { get; set; } = string.Empty; - - public List Receivers { get; set; } = new(); - - public SendRuleModel SendRules { get; set; } = new(); - - public MessageInfoUpsertModel MessageInfo { get; set; } = new(); - - public ExtraPropertyDictionary Variables { get; set; } = new(); - - private MessageTaskSources Source { get;} = MessageTaskSources.Sdk; - - public Guid OperatorId { get; set; } = Guid.Empty; - - public ExtraPropertyDictionary ExtraProperties { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs deleted file mode 100644 index acec18d51..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageTemplateItemModel -{ - public string Code { get; set; } = string.Empty; - - public string MappingCode { get; set; } = string.Empty; - - public string DisplayText { get; set; } = string.Empty; - - public string Description { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs deleted file mode 100644 index 16b6f4fd9..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageTemplateModel : AuditEntityModel -{ - public Guid ChannelId { get; set; } - - public string DisplayName { get; set; } = string.Empty; - - public string Title { get; set; } = string.Empty; - - public string Code { get; set; } = string.Empty; - - public string Content { get; set; } = string.Empty; - - public string Markdown { get; set; } = string.Empty; - - public string TemplateId { get; set; } = string.Empty; - - public bool IsJump { get; set; } - - public string JumpUrl { get; set; } = string.Empty; - - public string Sign { get; set; } = string.Empty; - - public MessageTemplateStates Status { get; set; } - - public MessageTemplateAuditStatuses AuditStatus { get; set; } - - public DateTimeOffset? AuditTime { get; set; } - - public DateTimeOffset? InvalidTime { get; set; } - - public string AuditReason { get; set; } = string.Empty; - - public int TemplateType { get; set; } - - public string TemplateTypeDisplayName { get; set; } - - public long PerDayLimit { get; set; } - - public bool IsStatic { get; set; } - - public List Items { get; set; } - - public MessageTemplateModel() - { - this.Items = new List(); - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs deleted file mode 100644 index 8793915f2..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class PaginatedListModel -{ - public long Total { get; set; } - - public int TotalPages { get; set; } - - public List Result { get; set; } = default!; - - public PaginatedListModel() - { - Result = new List(); - } - - public PaginatedListModel(long total, int totalPages, List result) - { - Total = total; - TotalPages = totalPages; - Result = result; - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs deleted file mode 100644 index c08461ce6..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ReadAllWebsiteMessageModel : GetWebsiteMessageModel -{ - public ReadAllWebsiteMessageModel(int page, int pageSize, Dictionary? sorting = null) : base(page, pageSize, sorting) - { - - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs deleted file mode 100644 index 69aaa8191..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ReadWebsiteMessageModel -{ - public Guid Id { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs deleted file mode 100644 index ab3a27b65..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ReceiverGroupItemModel -{ - public Guid GroupId { get; set; } - - public ReceiverGroupItemTypes Type { get; set; } - - public Guid SubjectId { get; set; } - - public string DisplayName { get; set; } = string.Empty; - - public string Avatar { get; set; } = string.Empty; - - public string PhoneNumber { get; set; } = string.Empty; - - public string Email { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs deleted file mode 100644 index 9af8a9f07..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ReceiverGroupModel : AuditEntityModel -{ - public string DisplayName { get; set; } = string.Empty; - - public string Description { get; set; } = string.Empty; - - public List Items { get; set; } = new(); - - public string ModifierName { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageByExternalModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageByExternalModel.cs deleted file mode 100644 index be29488fb..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageByExternalModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class SendOrdinaryMessageByExternalModel -{ - public string ChannelCode { get; set; } = string.Empty; - - public ChannelTypes ChannelType { get; set; } - - public SendTargets ReceiverType { get; set; } - - public List Receivers { get; set; } = new(); - - public SendRuleModel SendRules { get; set; } = new(); - - public MessageInfoUpsertModel MessageInfo { get; set; } = new(); - - public ExtraPropertyDictionary Variables { get; set; } = new(); - - public Guid OperatorId { get; set; } = Guid.Empty; - - public string SystemId { get; set; } = string.Empty; - - public ExtraPropertyDictionary ExtraProperties { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageByInternalModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageByInternalModel.cs deleted file mode 100644 index fb84f13e0..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageByInternalModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class SendOrdinaryMessageByInternalModel -{ - public string ChannelCode { get; set; } = string.Empty; - - public ChannelTypes ChannelType { get; set; } - - public SendTargets ReceiverType { get; set; } - - public List Receivers { get; set; } = new(); - - public SendRuleModel SendRules { get; set; } = new(); - - public MessageInfoUpsertModel MessageInfo { get; set; } = new(); - - public ExtraPropertyDictionary Variables { get; set; } = new(); - - public Guid OperatorId { get; set; } = Guid.Empty; - - public string SystemId { get; set; } = string.Empty; - - public ExtraPropertyDictionary ExtraProperties { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs deleted file mode 100644 index 6a02b1a0c..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class SendRuleModel -{ - public bool IsCustom { get; set; } - - public string CronExpression { get; set; } = string.Empty; - - public long SendingCount { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageByExternalModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageByExternalModel.cs deleted file mode 100644 index 309e7a3ac..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageByExternalModel.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class SendTemplateMessageByExternalModel -{ - public string ChannelCode { get; set; } = string.Empty; - - public ChannelTypes ChannelType { get; set; } - - public string TemplateCode { get; set; } = string.Empty; - - public SendTargets ReceiverType { get; set; } - - public string Sign { get; set; } = string.Empty; - - public List Receivers { get; set; } = new(); - - public SendRuleModel SendRules { get; set; } = new(); - - public ExtraPropertyDictionary Variables { get; set; } = new(); - - public Guid OperatorId { get; set; } = Guid.Empty; - - public string SystemId { get; set; } = string.Empty; - - public ExtraPropertyDictionary ExtraProperties { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageByInternalModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageByInternalModel.cs deleted file mode 100644 index 085ce1869..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageByInternalModel.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class SendTemplateMessageByInternalModel -{ - public string ChannelCode { get; set; } = string.Empty; - - public ChannelTypes ChannelType { get; set; } - - public string TemplateCode { get; set; } = string.Empty; - - public SendTargets ReceiverType { get; set; } - - public string Sign { get; set; } = string.Empty; - - public List Receivers { get; set; } = new(); - - public SendRuleModel SendRules { get; set; } = new(); - - public ExtraPropertyDictionary Variables { get; set; } = new(); - - public Guid OperatorId { get; set; } = Guid.Empty; - - public string SystemId { get; set; } = string.Empty; - - public ExtraPropertyDictionary ExtraProperties { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageByTagModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageByTagModel.cs deleted file mode 100644 index a1a9a3116..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageByTagModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class WebsiteMessageTagModel -{ - public string Tag { get; set; } = string.Empty; - - public int Unread { get; set; } - - public Guid ChannelId { get; set; } - - public string Title { get; set; } = string.Empty; - - public DateTimeOffset SendTime { get; set; } - - public Guid UserId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs deleted file mode 100644 index 4d7cf3711..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class WebsiteMessageChannelModel : WebsiteMessageModel -{ - public long NoReading { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs deleted file mode 100644 index ec2391761..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class WebsiteMessageModel : AuditEntityModel -{ - public Guid ChannelId { get; set; } - - public ChannelModel Channel { get; set; } = default!; - - public Guid UserId { get; set; } - - public string Title { get; set; } = string.Empty; - - public string Content { get; set; } = string.Empty; - - public string LinkUrl { get; set; } = string.Empty; - - public DateTimeOffset SendTime { get; set; } - - public bool IsRead { get; set; } - - public DateTimeOffset? ReadTime { get; set; } - - public string Abstract { get; set; } = string.Empty; - - public Guid PrevId { get; set; } - - public Guid NextId { get; set; } - - public ExtraPropertyDictionary ExtraProperties { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs deleted file mode 100644 index 692191478..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IChannelService -{ - Task GetAsync(Guid id); - - Task> GetListAsync(GetChannelModel options); - - Task CreateAsync(CreateChannelModel options); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs deleted file mode 100644 index 7aa9a75b9..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IMessageTaskService -{ - Task GetAsync(Guid id); - - Task SendOrdinaryMessageByInternalAsync(SendOrdinaryMessageByInternalModel options); - - Task SendTemplateMessageByInternalAsync(SendTemplateMessageByInternalModel options); - - Task SendOrdinaryMessageByExternalAsync(SendOrdinaryMessageByExternalModel options); - - Task SendTemplateMessageByExternalAsync(SendTemplateMessageByExternalModel options); - - Task> GetListAsync(GetMessageTaskModel options); - - Task DeleteAsync(Guid id); - - Task UpdateAsync(Guid id, MessageTaskUpsertModel messageTask); - - Task SetIsEnabledAsync(Guid id, bool isEnabled); - - Task WithdrawnAsync(Guid id); - - Task ResendAsync(Guid id); - - Task BindClientIdAsync(BindClientIdModel options); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs deleted file mode 100644 index a72efd7ee..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IMessageTemplateService -{ - Task GetAsync(Guid id); - - Task> GetListAsync(GetMessageTemplateModel options); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs deleted file mode 100644 index 784e10b8d..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IReceiverGroupService -{ - Task GetAsync(Guid id); - - Task> GetListAsync(GetReceiverGroupModel inputDto); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs deleted file mode 100644 index 0f7a91fe8..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IWebsiteMessageService -{ - Task> GetListAsync(GetWebsiteMessageModel options); - - Task GetAsync(Guid id); - - Task> GetChannelListAsync(); - - Task SetAllReadAsync(ReadAllWebsiteMessageModel options); - - Task DeleteAsync(Guid id); - - Task ReadAsync(ReadWebsiteMessageModel options); - - Task CheckAsync(); - - Task> GetNoticeListAsync(GetNoticeListModel options); - - Task SendCheckNotificationAsync(); - - Task SendGetNotificationAsync(List userIds); - - Task> GetListByTagAsync(List tags, string channelCode); - - Task GetUnreadAsync(GetUnreadModel options); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs deleted file mode 100644 index a8e8f37a7..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.BuildingBlocks.StackSdks.Mc.Enum; -global using Masa.BuildingBlocks.StackSdks.Mc.Model; -global using Masa.BuildingBlocks.StackSdks.Mc.Service; -global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/AllowedEventAttribute.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/AllowedEventAttribute.cs deleted file mode 100644 index a1f9ba5bd..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/AllowedEventAttribute.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Middleware; - -[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -public class AllowedEventAttribute : Attribute -{ -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/DisabledRouteAttribute.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/DisabledRouteAttribute.cs deleted file mode 100644 index ccf472559..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/DisabledRouteAttribute.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Middleware; - -[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] -public class DisabledRouteAttribute : Attribute -{ -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/IDisabledDeterminer.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/IDisabledDeterminer.cs deleted file mode 100644 index c7c61aae9..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/IDisabledDeterminer.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Middleware; - -public interface IDisabledDeterminer -{ - bool Determiner(); -} - -public interface IDisabledEventDeterminer : IDisabledDeterminer -{ - bool DisabledCommand { get; } -} - -public interface IDisabledRequestDeterminer : IDisabledDeterminer -{ -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/Masa.BuildingBlocks.StackSdks.Middleware.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/Masa.BuildingBlocks.StackSdks.Middleware.csproj deleted file mode 100644 index 61538f600..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/Masa.BuildingBlocks.StackSdks.Middleware.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Middleware/_Imports.cs deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs deleted file mode 100644 index 61c8a96b2..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Enum; - -public enum AppTypes -{ - [Description("Service")] - Service = 1, - - [Description("UI")] - UI, - - [Description("Job")] - Job -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs deleted file mode 100644 index 6d38f766f..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Enum; - -public enum ServiceTypes -{ - [Description("Dapr")] - Dapr = 1, - - [Description("Web Api")] - WebApi -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs deleted file mode 100644 index 8411b5093..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm; - -public interface IPmClient -{ - public IEnvironmentService EnvironmentService { get; init; } - - public IClusterService ClusterService { get; init; } - - public IProjectService ProjectService { get; init; } - - public IAppService AppService { get; init; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj deleted file mode 100644 index 61538f600..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs deleted file mode 100644 index 61b86a1bf..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class AppDetailModel : ModelBase -{ - public int ProjectId { get; set; } - - public int Id { get; set; } - - public string Name { get; set; } = ""; - - public string Identity { get; set; } = ""; - - public string Description { get; set; } = ""; - - public AppTypes Type { get; set; } - - public ServiceTypes ServiceType { get; set; } - - public string Url { get; set; } = ""; - - public string SwaggerUrl { get; set; } = ""; - - public List EnvironmentClusters { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs deleted file mode 100644 index de0589262..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class AppModel -{ - public int Id { get; set; } - - public string Name { get; set; } - - public string Identity { get; set; } - - public int ProjectId { get; set; } - - public AppTypes Type { get; set; } - - public string Url { get; set; } - - public ServiceTypes ServiceType { get; set; } - - public string SwaggerUrl { get; set; } - - public string Description { get; set; } - - public AppModel() - { - } - - public AppModel(int id, string name, string identity, int projectId, AppTypes type, string url, ServiceTypes serviceType, string swaggerUrl, string description) - { - Id = id; - Name = name; - Identity = identity; - ProjectId = projectId; - Type = type; - Url = url; - ServiceType = serviceType; - SwaggerUrl = swaggerUrl; - Description = description; - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs deleted file mode 100644 index b561b7091..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ClusterDetailModel : ModelBase -{ - public int Id { get; set; } - - public string Name { get; set; } = default!; - - public string Description { get; set; } = ""; - - public List EnvironmentIds { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs deleted file mode 100644 index 6a1b19dbe..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ClusterModel -{ - public int Id { get; set; } - - public string Name { get; set; } = default!; - - public int EnvironmentClusterId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs deleted file mode 100644 index ee1916645..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class EnvironmentClusterModel -{ - public int Id { get; set; } - - public string EnvironmentName { get; set; } = ""; - - public string EnvironmentColor { get; set; } = ""; - - public string ClusterName { get; set; } = ""; - - public string EnvironmentClusterName - { - get - { - return $"{EnvironmentName}/{ClusterName}"; - } - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs deleted file mode 100644 index 5847857c7..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class EnvironmentDetailModel : ModelBase -{ - public int Id { get; set; } - - public string Name { get; set; } = default!; - - public string Description { get; set; } = ""; - - public string Color { get; set; } = ""; - - public List ClusterIds { get; set; } = default!; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs deleted file mode 100644 index c939ab264..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class EnvironmentModel -{ - public int Id { get; set; } - - public string Name { get; set; } = ""; - - public string Color { get; set; } = ""; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ModelBase.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ModelBase.cs deleted file mode 100644 index 8b82947e1..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ModelBase.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -[Obsolete("BaseModel has expired, please use ModelBase")] -public class BaseModel : ModelBase -{ -} - -public class ModelBase -{ - public Guid Creator { get; set; } - - public DateTime CreationTime { get; set; } - - public Guid Modifier { get; set; } - - public DateTime ModificationTime { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs deleted file mode 100644 index 0ce6b7eb6..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ProjectAppsModel -{ - public int Id { get; set; } - - public string Identity { get; set; } - - public string Name { get; set; } - - public string LabelCode { get; set; } - - public Guid TeamId { get; set; } - - public List Apps { get; set; } = new(); - - public ProjectAppsModel(int id, string identity, string name, string labelCode, Guid teamId) - { - Id = id; - Identity = identity; - Name = name; - LabelCode = labelCode; - TeamId = teamId; - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs deleted file mode 100644 index b5e8e7f93..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ProjectDetailModel : ModelBase -{ - public int Id { get; set; } - - public string Identity { get; set; } = ""; - - public string LabelCode { get; set; } - - public string Name { get; set; } = ""; - - public string Description { get; set; } = ""; - - public Guid TeamId { get; set; } - - public List EnvironmentClusterIds { get; set; } = new List(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs deleted file mode 100644 index 2298b0beb..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ProjectModel -{ - public int Id { get; set; } - - public string Identity { get; set; } = ""; - - public string Name { get; set; } = ""; - - public Guid TeamId { get; set; } - - public string Description { get; set; } = ""; - - public string LabelCode { get; set; } = ""; - - public string LabelName { get; set; } = ""; - - public Guid Modifier { get; set; } - - public DateTime ModificationTime { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs deleted file mode 100644 index b8751e6b8..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ProjectTypeModel -{ - public int Id { get; set; } - - public string Name { get; set; } = ""; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs deleted file mode 100644 index 8f1f9ee8a..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Service; - -public interface IAppService -{ - Task> GetListAsync(); - - Task> GetListByProjectIdsAsync(List projectIds); - - Task GetWithEnvironmentClusterAsync(int Id); - - Task GetAsync(int Id); - - Task GetByIdentityAsync(string identity); - - Task> GetListByAppTypes(params AppTypes[] appTypes); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs deleted file mode 100644 index 3232ea5c1..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Service; - -public interface IClusterService -{ - Task> GetListAsync(); - - Task> GetListByEnvIdAsync(int envId); - - Task GetAsync(int Id); - - Task> GetEnvironmentClustersAsync(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs deleted file mode 100644 index 8e5f2b970..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Service; - -public interface IEnvironmentService -{ - Task> GetListAsync(); - - Task GetAsync(int Id); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs deleted file mode 100644 index 4d9d53760..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Service; - -public interface IProjectService -{ - Task> GetProjectAppsAsync(string envName); - - Task> GetListByEnvironmentClusterIdAsync(int envClusterId); - - Task> GetListByTeamIdsAsync(List teamIds, string environment); - - Task GetAsync(int id); - - Task GetByIdentityAsync(string identity); - - Task> GetProjectTypesAsync(); - - Task> GetListAsync(); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs deleted file mode 100644 index 4b1a5eaaa..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Pm.Enum; -global using Masa.BuildingBlocks.StackSdks.Pm.Model; -global using Masa.BuildingBlocks.StackSdks.Pm.Service; -global using System.ComponentModel; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs deleted file mode 100644 index 7263de700..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum HttpMethods -{ - GET = 1, - POST, - HEAD, - PUT, - DELETE -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs deleted file mode 100644 index c7213212b..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum HttpVerifyTypes -{ - StatusCode200 = 1, - CustomStatusCode, - ContentContains, - ContentUnContains, -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs deleted file mode 100644 index e0a928ea7..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum JobTypes -{ - JobApp = 1, - Http, - DaprServiceInvocation -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/LoggerTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/LoggerTypes.cs deleted file mode 100644 index 1002d6dd4..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/LoggerTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum LoggerTypes -{ - SchedulerInternalLog = 1, - JobLog, -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs deleted file mode 100644 index 8df0a446a..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum RunTimeoutStrategyTypes -{ - RunFailedStrategy = 1, - IgnoreTimeout -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs deleted file mode 100644 index d9bd4f523..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum ScheduleBlockStrategyTypes -{ - Serial = 1, - Parallel, - Discard, - Cover -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs deleted file mode 100644 index a406828e8..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum ScheduleExpiredStrategyTypes -{ - ExecuteImmediately = 1, - AutoCompensation, - Ignore -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/TaskRunResultStatus.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/TaskRunResultStatus.cs deleted file mode 100644 index e2c8bf3ac..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/TaskRunResultStatus.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum TaskRunResultStatus -{ - Success = 3, - Failure = 4, - TimeoutSuccess = 6, - Ignore = 9 -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/WriterTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/WriterTypes.cs deleted file mode 100644 index 6e6318486..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/WriterTypes.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum WriterTypes -{ - Server = 1, - Worker, - Job -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs deleted file mode 100644 index 744e46613..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler; - -public interface ISchedulerClient -{ - ISchedulerJobService SchedulerJobService { get; } - - ISchedulerTaskService SchedulerTaskService { get; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs deleted file mode 100644 index e4c69fdea..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler; - -public interface ISchedulerJob -{ - Task InitializeAsync(WebApplicationBuilder builder, Guid jobId, Guid taskId); - - Task BeforeExcuteAsync(JobContext context); - - Task ExcuteAsync(JobContext context); - - Task AfterExcuteAsync(JobContext context); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj deleted file mode 100644 index 62dec6d63..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - enable - enable - - - - - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs deleted file mode 100644 index 89d51ab50..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; - -public class JobContext -{ - public Guid JobId { get; set; } - - public Guid TaskId { get; set; } - - public DateTimeOffset ExecutionTime { get; set; } - - public string ExcuteClassName { get; set; } = string.Empty; - - public List ExcuteParameters { get; set; } = new(); - - public object? ExcuteResult { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/LoggerBody.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/LoggerBody.cs deleted file mode 100644 index 617209422..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/LoggerBody.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; - -public class LoggerBody -{ - public LoggerTypes LoggerType { get; set; } - - public Guid TaskId { get; set; } - - public Guid JobId { get; set; } - - public WriterTypes Writer { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs deleted file mode 100644 index 890aa16d8..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; - -public class SchedulerJobAppConfig -{ - public string JobAppIdentity { get; set; } = string.Empty; - - public string JobEntryAssembly { get; set; } = string.Empty; - - public string JobEntryClassName { get; set; } = string.Empty; - - public string JobParams { get; set; } = string.Empty; - - public string Version { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs deleted file mode 100644 index ab5feef95..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; - -public class SchedulerJobDaprServiceInvocationConfig -{ - public string MethodName { get; set; } = string.Empty; - - public HttpMethods HttpMethod { get; set; } - - public string Data { get; set; } = string.Empty; - - public string DaprServiceIdentity { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs deleted file mode 100644 index bebb18f00..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; - -public class SchedulerJobHttpConfig -{ - public HttpMethods HttpMethod { get; set; } - - public string RequestUrl { get; set; } = string.Empty; - - public List> HttpParameters { get; set; } = new(); - - public List> HttpHeaders { get; set; } = new(); - - public string HttpBody { get; set; } = string.Empty; - - public HttpVerifyTypes HttpVerifyType { get; set; } - - public string VerifyContent { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobModel.cs deleted file mode 100644 index ee0c0b736..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobModel.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model -{ - public class SchedulerJobModel - { - public Guid Id { get; set; } - - public string Name { get; set; } = string.Empty; - - public string Owner { get; set; } = string.Empty; - - public Guid OwnerId { get; set; } - - public bool IsAlertException { get; set; } - - public string CronExpression { get; set; } = string.Empty; - - public string JobIdentity { get; set; } = string.Empty; - - public JobTypes JobType { get; set; } - - public string SpecifiedWorkerHost { get; set; } = string.Empty; - - public ScheduleExpiredStrategyTypes ScheduleExpiredStrategy { get; set; } - - public ScheduleBlockStrategyTypes ScheduleBlockStrategy { get; set; } - - public RunTimeoutStrategyTypes RunTimeoutStrategy { get; set; } - - public int RunTimeoutSecond { get; set; } - - public int FailedRetryInterval { get; set; } - - public int FailedRetryCount { get; set; } - - public string Description { get; set; } = string.Empty; - - public bool Enabled { get; set; } - - public Guid BelongTeamId { get; set; } - - public string BelongProjectIdentity { get; set; } = string.Empty; - - public string Origin { get; set; } = string.Empty; - - public int SortPriority { get; set; } - - public Guid Creator { get; set; } - - public DateTimeOffset UpdateExpiredStrategyTime { get; set; } - - public DateTimeOffset LastScheduleTime { get; set; } = DateTimeOffset.MinValue; - - public DateTimeOffset LastRunStartTime { get; set; } = DateTimeOffset.MinValue; - - public DateTimeOffset LastRunEndTime { get; set; } = DateTimeOffset.MinValue; - - public SchedulerJobAppConfig JobAppConfig { get; set; } = new(); - - public SchedulerJobHttpConfig HttpConfig { get; set; } = new(); - - public SchedulerJobDaprServiceInvocationConfig DaprServiceInvocationConfig { get; set; } = new(); - - public DateTime CreationTime { get; set; } - - public DateTime ModificationTime { get; set; } - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs deleted file mode 100644 index 9c4603439..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class UpsertSchedulerJobRequest -{ - public string ProjectIdentity { get; set; } = string.Empty; - - public string Name { get; set; } = string.Empty; - - public bool IsAlertException { get; set; } - - public JobTypes JobType { get; set; } - - public Guid OperatorId { get; set; } - - public string CronExpression { get; set; } = string.Empty; - - public string JobIdentity { get; set; } = string.Empty; - - public string Description { get; set; } = string.Empty; - - public string NotifyUrl { get; set; } = string.Empty; - - /// - /// Default Ignore - /// - public ScheduleExpiredStrategyTypes ScheduleExpiredStrategy { get; set; } = ScheduleExpiredStrategyTypes.Ignore; - - /// - /// Default Parallel - /// - public ScheduleBlockStrategyTypes ScheduleBlockStrategy { get; set; } = ScheduleBlockStrategyTypes.Serial; - - /// - /// Default IgnoreTimeout - /// - public RunTimeoutStrategyTypes RunTimeoutStrategy { get; set; } = RunTimeoutStrategyTypes.IgnoreTimeout; - - public int RunTimeoutSecond { get; set; } - - public int FailedRetryInterval { get; set; } - - public int FailedRetryCount { get; set; } - - public SchedulerJobAppConfig? JobAppConfig { get; set; } - - public SchedulerJobHttpConfig? HttpConfig { get; set; } - - public SchedulerJobDaprServiceInvocationConfig? DaprServiceInvocationConfig { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs deleted file mode 100644 index 48b359347..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class ChangeEnabledStatusRequest : SchedulerJobRequestBase -{ - public bool Enabled { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/GetSchedulerJobByIdentityRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/GetSchedulerJobByIdentityRequest.cs deleted file mode 100644 index 2381ff179..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/GetSchedulerJobByIdentityRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class GetSchedulerJobByIdentityRequest -{ - public string JobIdentity { get; set; } - - public string ProjectIdentity { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/NotifySchedulerTaskRunResultRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/NotifySchedulerTaskRunResultRequest.cs deleted file mode 100644 index cf9414fd9..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/NotifySchedulerTaskRunResultRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class NotifySchedulerTaskRunResultRequest: SchedulerTaskRequestBase -{ - public TaskRunResultStatus Status { get; set; } - - public string? Message { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/SchedulerJobRequestBase.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/SchedulerJobRequestBase.cs deleted file mode 100644 index 739e8f374..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/SchedulerJobRequestBase.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -[Obsolete("BaseSchedulerJobRequest has expired, please use SchedulerJobRequestBase")] -public class BaseSchedulerJobRequest : SchedulerJobRequestBase -{ - -} - -public class SchedulerJobRequestBase -{ - public Guid JobId { get; set; } - - public Guid OperatorId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/SchedulerTaskRequestBase.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/SchedulerTaskRequestBase.cs deleted file mode 100644 index 2a0d8d93d..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/SchedulerTaskRequestBase.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -[Obsolete("BaseSchedulerTaskRequest has expired, please use SchedulerTaskRequestBase")] -public class BaseSchedulerTaskRequest : SchedulerTaskRequestBase -{ -} - -public class SchedulerTaskRequestBase -{ - public Guid TaskId { get; set; } - - public Guid OperatorId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs deleted file mode 100644 index 5225d9c78..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class StartSchedulerTaskRequest : SchedulerTaskRequestBase -{ - public bool IsManual { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs deleted file mode 100644 index aade692e1..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Service; - -public interface ISchedulerJobService -{ - Task AddAsync(UpsertSchedulerJobRequest job); - - Task UpdateAsync(Guid id, UpsertSchedulerJobRequest job); - - Task StartAsync(SchedulerJobRequestBase request); - - Task RemoveAsync(SchedulerJobRequestBase request); - - Task EnableAsync(SchedulerJobRequestBase request); - - Task DisableAsync(SchedulerJobRequestBase request); - - Task GetSchedulerJobQueryByIdentityAsync(GetSchedulerJobByIdentityRequest request); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs deleted file mode 100644 index 92bed9e86..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Service; - -public interface ISchedulerTaskService -{ - Task StopAsync(SchedulerTaskRequestBase request); - - Task StartAsync(SchedulerTaskRequestBase request); - - Task NotifyRunResultAsync(NotifySchedulerTaskRunResultRequest request); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs deleted file mode 100644 index 0fc889413..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; -global using Masa.BuildingBlocks.StackSdks.Scheduler.Model; -global using Masa.BuildingBlocks.StackSdks.Scheduler.Request; -global using Masa.BuildingBlocks.StackSdks.Scheduler.Service; -global using Microsoft.AspNetCore.Builder; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Extensions/DictionaryExtenistions.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Extensions/DictionaryExtenistions.cs deleted file mode 100644 index eb0fb2d3e..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Extensions/DictionaryExtenistions.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System.Collections.Generic; - -public static class DictionaryExtenistions -{ - private static readonly JsonSerializerOptions _serializerOptions = new() - { - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - NumberHandling = JsonNumberHandling.AllowReadingFromString - }; - - public static Dictionary GroupByKeyPrefix(this Dictionary source, string prefix, Func? convertFunc = null) - { - var result = new Dictionary(); - foreach (var key in source.Keys) - { - if (!key.StartsWith(prefix)) - continue; - var value = source[key]; - var newKey = key[prefix.Length..]; - if (convertFunc != null) - value = convertFunc(source[key]); - result.Add(newKey, (T)value!); - } - return result; - } - - internal static T ConvertTo(this Dictionary dic) - { - var text = JsonSerializer.Serialize(dic, _serializerOptions); - return JsonSerializer.Deserialize(text, _serializerOptions)!; - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Masa.BuildingBlocks.StackSdks.Tsc.Contracts.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Masa.BuildingBlocks.StackSdks.Tsc.Contracts.csproj deleted file mode 100644 index fb10eca9e..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Masa.BuildingBlocks.StackSdks.Tsc.Contracts.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - enable - enable - - - - - - - - - - - - diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Aggregate/AggregateTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Aggregate/AggregateTypes.cs deleted file mode 100644 index 232a5f5b0..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Aggregate/AggregateTypes.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model.Aggregate; - -public enum AggregateTypes -{ - Count=1, - Sum, - Avg, - DistinctCount, - DateHistogram, - GroupBy -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Aggregate/SimpleAggregateRequestDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Aggregate/SimpleAggregateRequestDto.cs deleted file mode 100644 index 88931700b..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Aggregate/SimpleAggregateRequestDto.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model.Aggregate; - -public class SimpleAggregateRequestDto : BaseRequestDto -{ - public string Name { get; set; } - - public string Alias { get; set; } - - public AggregateTypes Type { get; set; } - - public int MaxCount { get; set; } - - /// - /// currently support elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/7.17/search-aggregations-bucket-datehistogram-aggregation.html - /// - public string Interval { get; set; } - - /// - /// only fro type Group by, true return type is IEnumerable>,false is IEnumerable - /// - public bool AllValue { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/BaseRequestDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/BaseRequestDto.cs deleted file mode 100644 index 0ca350cfc..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/BaseRequestDto.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model; - -public class BaseRequestDto : RequestPageBase -{ - public string TraceId { get; set; } - - public string Service { get; set; } - - public string Instance { get; set; } - - public string Endpoint { get; set; } - - public string Keyword { get; set; } - - public DateTime Start { get; set; } - - public DateTime End { get; set; } - - public string RawQuery { get; set; } - - public IEnumerable Conditions { get; set; } - - public FieldOrderDto? Sort { get; set; } - - public virtual void AppendConditions() { } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/ConditionTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/ConditionTypes.cs deleted file mode 100644 index 7bbbec1fa..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/ConditionTypes.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model; - -public enum ConditionTypes -{ - Equal=1, - NotEqual, - Great, - Less, - GreatEqual, - LessEqual, - In, - NotIn, - Regex, - NotRegex, - Exists, - NotExists -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/FieldConditionDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/FieldConditionDto.cs deleted file mode 100644 index 1bf82de0b..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/FieldConditionDto.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model; - -public class FieldConditionDto -{ - public string Name { get; set; } - - public ConditionTypes Type { get; set; } - - public object Value { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/FieldOrderDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/FieldOrderDto.cs deleted file mode 100644 index bdf1955da..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/FieldOrderDto.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model; - -public class FieldOrderDto -{ - public string Name { get; set; } - - public bool IsDesc { get; set; } = true; -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Log/LogResponseDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Log/LogResponseDto.cs deleted file mode 100644 index 4f23bc200..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Log/LogResponseDto.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Log; - -public class LogResponseDto -{ - public virtual DateTime Timestamp { get; set; } - - public virtual string TraceId { get; set; } - - public virtual string SpanId { get; set; } - - public virtual int TraceFlags { get; set; } - - public virtual string SeverityText { get; set; } - - public virtual int SeverityNumber { get; set; } - - public virtual object Body { get; set; } - - public virtual Dictionary Resource { get; set; } - - public virtual Dictionary Attributes { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/MappingResponseDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/MappingResponseDto.cs deleted file mode 100644 index f801a14ec..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/MappingResponseDto.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model; - -public class MappingResponseDto -{ - public string Name { get; set; } - - public string Type { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceDatabaseResponseDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceDatabaseResponseDto.cs deleted file mode 100644 index a2fe169d4..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceDatabaseResponseDto.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Trace; - -public class TraceDatabaseResponseDto -{ - [JsonPropertyName("db.system")] - public virtual string System { get; set; } - - [JsonPropertyName("db.connection_string")] - public virtual string ConnectionString { get; set; } - - [JsonPropertyName("db.user")] - public virtual string User { get; set; } - - [JsonPropertyName("net.peer.ip")] - public virtual string PeerIp { get; set; } - - [JsonPropertyName("net.peer.name")] - public virtual string PeerName { get; set; } - - [JsonPropertyName("net.peer.port")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int PeerPort { get; set; } - - [JsonPropertyName("net.transport")] - public virtual string Transport { get; set; } - - [JsonPropertyName("db.jdbc.driver_classname")] - public virtual string JdbcDriverClassName { get; set; } - - [JsonPropertyName("db.mssql.instance_name")] - public virtual string MssqlInstanceName { get; set; } - - [JsonPropertyName("db.name")] - public virtual string Name { get; set; } - - [JsonPropertyName("db.statement")] - public virtual string Statement { get; set; } - - [JsonPropertyName("db.operation")] - public virtual string Operation { get; set; } - - [JsonPropertyName("db.redis.database_index")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int RedisDatabaseIndex { get; set; } - - [JsonPropertyName("db.mongodb.collection")] - public virtual string MongodbCollection { get; set; } - - [JsonPropertyName("db.sql.table")] - public virtual string SqlTable { get; set; } - - #region Cassandra - - [JsonPropertyName("db.cassandra.page_size")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int CassandraPageSize { get; set; } - - [JsonPropertyName("db.cassandra.consistency_level")] - public virtual string CassandraConsistencyLevel { get; set; } - - [JsonPropertyName("db.cassandra.table")] - public virtual string CassandraTable { get; set; } - - [JsonPropertyName("db.cassandra.idempotence")] - public virtual bool CassandraIdempotence { get; set; } - - [JsonPropertyName("db.cassandra.speculative_execution_count")] - public virtual bool CassandraSpeculativeExecutionCount { get; set; } - - [JsonPropertyName("db.cassandra.coordinator.id")] - public virtual string CassandraCoordinatorId { get; set; } - - [JsonPropertyName("db.cassandra.coordinator.dc")] - public virtual string CassandraCoordinatorDc { get; set; } - - #endregion -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceDtoKind.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceDtoKind.cs deleted file mode 100644 index 7b5d22e38..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceDtoKind.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model.Trace; - -public sealed class TraceDtoKind -{ - private TraceDtoKind() { } - - public const string SPAN_KIND_SERVER = nameof(SPAN_KIND_SERVER); - - public const string SPAN_KIND_CLIENT = nameof(SPAN_KIND_CLIENT); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceExceptionResponseDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceExceptionResponseDto.cs deleted file mode 100644 index 58421a17b..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceExceptionResponseDto.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Trace; - -public class TraceExceptionResponseDto -{ - [JsonPropertyName("exception.type")] - public virtual string Type { get; set; } - - [JsonPropertyName("exception.message")] - public virtual string Message { get; set; } - - [JsonPropertyName("exception.stacktrace")] - public virtual string StackTrace { get; set; } - - [JsonPropertyName("exception.escaped")] - public virtual bool Escaped { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceHttpResponseDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceHttpResponseDto.cs deleted file mode 100644 index cea96ace1..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceHttpResponseDto.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Trace; - -public class TraceHttpResponseDto -{ - public virtual string Name { get; set; } - - public virtual int Status { get; set; } - - [JsonPropertyName("http.method")] - public virtual string Method { get; set; } - - [JsonPropertyName("http.url")] - public virtual string Url { get; set; } - - [JsonPropertyName("http.target")] - public virtual string Target { get; set; } - - [JsonPropertyName("http.host")] - public virtual string Host { get; set; } - - [JsonPropertyName("http.scheme")] - public virtual string Scheme { get; set; } - - [JsonPropertyName("http.status_code")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int StatusCode { get; set; } - - [JsonPropertyName("http.flavor")] - public virtual string Flavor { get; set; } - - [JsonPropertyName("http.user_agent")] - public virtual string UserAgent { get; set; } - - [JsonPropertyName("http.request_content_length")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int RequestContentLength { get; set; } - - [JsonPropertyName("http.request_content_length_uncompressed")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int RequestContentLengthUncompressed { get; set; } - - public Dictionary> RequestHeaders { get; set; } - - [JsonPropertyName("http.response_content_length")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int ResponseContentLength { get; set; } - - [JsonPropertyName("http.response_content_length_uncompressed")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int ResponseContentLengthUncompressed { get; set; } - - public Dictionary> ReponseHeaders { get; set; } - - [JsonPropertyName("http.retry_count")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int RetryCount { get; set; } - - [JsonPropertyName("net.peer.ip")] - public virtual string PeerIp { get; set; } - - [JsonPropertyName("net.peer.port")] - [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] - public virtual int? PeerPort { get; set; } - - [JsonPropertyName("net.peer.name")] - public virtual string PeerName { get; set; } - - #region http server - - [JsonPropertyName("http.server_name")] - public virtual string ServerName { get; set; } - - [JsonPropertyName("http.route")] - public virtual string Route { get; set; } - - [JsonPropertyName("http.client_ip")] - public virtual string ClientIp { get; set; } - - #endregion -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceNetResponseDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceNetResponseDto.cs deleted file mode 100644 index f319dc27b..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceNetResponseDto.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Trace; - -public class TraceNetResponseDto -{ - public virtual string Transport { get; set; } - - public virtual string PeerIp { get; set; } - - public virtual int PeerPort { get; set; } - - public virtual string PeerName { get; set; } - - public virtual string HostIp { get; set; } - - public virtual int HostPort { get; set; } - - public virtual string HostName { get; set; } - - public virtual string HostConnectType { get; set; } - - public virtual string HostConnectSubtype { get; set; } - - public virtual string CarrierName { get; set; } - - public virtual string CarrierMCC { get; set; } - - public virtual string CarrierMNC { get; set; } - - public virtual string CarrierICC { get; set; } - - public virtual string PeerService { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceRequestAttrDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceRequestAttrDto.cs deleted file mode 100644 index 10eb5c4f3..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceRequestAttrDto.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model.Trace; - -public class TraceRequestAttrDto -{ - public string Service { get; set; } - - public string Instance { get; set; } - - public string Endpoint { get; set; } - - public DateTime Start { get; set; } - - public DateTime End { get; set; } - - public string Query { get; set; } - - public int MaxCount { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceResponseDto.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceResponseDto.cs deleted file mode 100644 index fb95217f1..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Model/Trace/TraceResponseDto.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Trace; - -public class TraceResponseDto -{ - private static readonly string[] httpKeys = new string[] { "http.method" }; - private static readonly string[] databaseKeys = new string[] { "db.system" }; - private static readonly string[] exceptionKeys = new string[] { "exception.type", "exception.message" }; - - public virtual DateTime Timestamp { get; set; } - - public virtual DateTime EndTimestamp { get; set; } - - public virtual string TraceId { get; set; } - - public virtual string SpanId { get; set; } - - public virtual string ParentSpanId { get; set; } - - public virtual string Kind { get; set; } - - public virtual int TraceStatus { get; set; } - - public virtual string Name { get; set; } - - public virtual Dictionary Attributes { get; set; } - - public virtual Dictionary Resource { get; set; } - - public virtual long Duration => (long)Math.Floor((EndTimestamp - Timestamp).TotalMilliseconds); - - public virtual bool TryParseHttp(out TraceHttpResponseDto result) - { - result = default!; - if (!IsContainsAnyKey(Attributes, httpKeys)) - return false; - result = Attributes.ConvertTo(); - - result.RequestHeaders = Attributes.GroupByKeyPrefix("http.request.header.", ReadHeaderValues); - result.ReponseHeaders = Attributes.GroupByKeyPrefix("http.response.header.", ReadHeaderValues); - - result.Name = Name; - result.Status = TraceStatus; - return true; - } - - public virtual bool TryParseDatabase(out TraceDatabaseResponseDto result) - { - result = default!; - if (!IsContainsAnyKey(Attributes, databaseKeys)) - return false; - result = Attributes.ConvertTo(); - return true; - } - - public virtual bool TryParseException(out TraceExceptionResponseDto result) - { - result = default!; - if (!IsContainsAnyKey(Attributes, exceptionKeys)) - return false; - - result = Attributes.ConvertTo(); - return true; - } - - public virtual string GetDispalyName() - { - if (TryParseDatabase(out var databaseDto)) - { - return $"{(Attributes.ContainsKey("peer.service") ? Attributes["peer.service"] : "")}{databaseDto.System}{databaseDto.Name}"; - } - else if (TryParseHttp(out var traceHttpDto)) - { - return traceHttpDto.Url; - } - else if (TryParseException(out TraceExceptionResponseDto exceptionDto)) - { - return exceptionDto.Type ?? exceptionDto.Message; - } - else - return Name; - } - - private static IEnumerable ReadHeaderValues(object obj) - { - if (obj is JsonElement value) - { - if (value.ValueKind == JsonValueKind.Array) - { - return value.EnumerateArray().Select(item => item.ToString()).ToArray(); - } - else - { - return new string[] { value.ToString() }; - } - } - return new string[] { obj.ToString()! }; - } - - private static bool IsContainsAnyKey(Dictionary source, string[] keys) - { - if (source == null || !source.Any() || keys == null || !keys.Any()) - return false; - if (keys.Length == 1) - return source.ContainsKey(keys[0]); - - return keys.Any(k => source.ContainsKey(k)); - } -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Service/ILogService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Service/ILogService.cs deleted file mode 100644 index 019f14608..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Service/ILogService.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Service; - -public interface ILogService -{ - Task> ListAsync(BaseRequestDto query); - - Task> GetMappingAsync(); - - /// - /// when query type: Count,Sum,Avg and DistinctCount return type is double, DateHistogram return IEnumerable> ,GroupBy return IEnumerable, AllValue is true return IEnumerable> - /// - /// - /// - Task AggregateAsync(SimpleAggregateRequestDto query); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Service/ITraceService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Service/ITraceService.cs deleted file mode 100644 index d91502a9e..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/Service/ITraceService.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Service; - -public interface ITraceService -{ - Task> GetAsync(string traceId); - - Task> ListAsync(BaseRequestDto query); - - Task> ScrollAsync(BaseRequestDto query); - - /// - /// when query type: Count,Sum,Avg and DistinctCount return type is double, DateHistogram return IEnumerable> ,GroupBy return IEnumerable - /// - /// - /// - Task AggregateAsync(SimpleAggregateRequestDto query); - - Task GetMaxDelayTraceIdAsync(BaseRequestDto query); -} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/_Imports.cs deleted file mode 100644 index 63ddf67f5..000000000 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Tsc.Contracts/_Imports.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Log; -global using Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model; -global using Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Model.Aggregate; -global using Masa.BuildingBlocks.StackSdks.Tsc.Contracts.Trace; -global using Masa.Utils.Models; -global using System.Text.Json; -global using System.Text.Json.Serialization; diff --git a/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultMasaDbContext.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultMasaDbContext.cs index 64df82c4a..36ca630c8 100644 --- a/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultMasaDbContext.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultMasaDbContext.cs @@ -219,6 +219,7 @@ protected virtual void OnBeforeSaveChanges() { ChangeTracker.UpdateRowVersion(ConcurrencyStampProvider); OnBeforeSaveChangesByFilters(); + PublishEntityChangedEventAsync(ChangeTracker).ConfigureAwait(false).GetAwaiter().GetResult(); DomainEventEnqueueAsync(ChangeTracker).ConfigureAwait(false).GetAwaiter().GetResult(); } @@ -226,6 +227,7 @@ protected virtual async Task OnBeforeSaveChangesAsync() { ChangeTracker.UpdateRowVersion(ConcurrencyStampProvider); OnBeforeSaveChangesByFilters(); + await PublishEntityChangedEventAsync(ChangeTracker); await DomainEventEnqueueAsync(ChangeTracker); } @@ -265,6 +267,46 @@ protected virtual async Task DomainEventEnqueueAsync(ChangeTracker changeTracker await DomainEventBus.EnqueueAsync(domainEvent); } + protected virtual Task PublishEntityChangedEventAsync(ChangeTracker changeTracker) + { + if (DomainEventBus == null) + return Task.CompletedTask; + + var domainEntities = changeTracker.Entries() + .Where(entrie => entrie.State == EntityState.Deleted || + entrie.State == EntityState.Modified || + entrie.State == EntityState.Added).ToList(); + + if (!domainEntities.Any()) + return Task.CompletedTask; + + var eventTypes = new Dictionary + { + {EntityState.Added,typeof(EntityCreatedDomainEvent<>)}, + {EntityState.Modified,typeof(EntityModifiedDomainEvent<>)}, + {EntityState.Deleted,typeof(EntityDeletedDomainEvent<>)} + }; + + domainEntities.ForEach(item => + { + var entityType = item.Entity.GetType(); + var eventType = item.State switch + { + EntityState.Added => eventTypes[EntityState.Added].MakeGenericType(entityType), + EntityState.Modified => eventTypes[EntityState.Modified].MakeGenericType(entityType), + EntityState.Deleted => eventTypes[EntityState.Deleted].MakeGenericType(entityType), + _ => null, + }; + + if (eventType is not null) + { + item.Entity.AddDomainEvent((IDomainEvent)Activator.CreateInstance(eventType, item.Entity)!); + } + }); + + return Task.CompletedTask; + } + /// /// Automatic soft delete. /// diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainEventBus.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainEventBus.cs index a235391cf..3bea10859 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainEventBus.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainEventBus.cs @@ -51,7 +51,8 @@ bool IsAssignableFromDomainQuery(Type? type) { return IsAssignableFromDomainQuery(type.BaseType); } - return type.GetInterfaces().Any(type => type.GetGenericTypeDefinition() == typeof(IDomainQuery<>)); + + return type.GetInterfaces().Where(item => item.IsGenericType == true).Any(type => type.GetGenericTypeDefinition() == typeof(IDomainQuery<>)); } } diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/LocalEventBusWrapper.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/LocalEventBusWrapper.cs index 25bdd6a58..d24b2b053 100644 --- a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/LocalEventBusWrapper.cs +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/LocalEventBusWrapper.cs @@ -13,6 +13,8 @@ internal class LocalEventBusWrapper : ILocalEventBusWrapper private readonly IUnitOfWork? _unitOfWork; + private static string _entityChangeEventTypeName = typeof(EntityChangedEvent<>).Name; + #pragma warning disable S5332 private const string LOAD_EVENT_HELP_LINK = "https://docs.masastack.com/framework/building-blocks/dispatcher/faq#section-8fdb7a0b51854e8b4ef6"; @@ -36,8 +38,11 @@ public async Task PublishAsync( var eventType = @event.GetType(); if (!_options.UnitOfWorkRelation.ContainsKey(eventType)) { + if (eventType?.BaseType?.Name == _entityChangeEventTypeName) + return; + throw new NotSupportedException( - $"Getting \"{eventType.Name}\" relationship chain failed, see {LOAD_EVENT_HELP_LINK} for details. "); + $"Getting \"{eventType?.Name}\" relationship chain failed, see {LOAD_EVENT_HELP_LINK} for details. "); } if (_options.UnitOfWorkRelation[eventType]) diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Options/DispatcherOptions.cs index 79d340d1f..b2bcf02af 100644 --- a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Options/DispatcherOptions.cs +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Options/DispatcherOptions.cs @@ -22,10 +22,27 @@ public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) : this(services) { Assemblies = assemblies; + var allEventTypes = assemblies .SelectMany(assembly => assembly.GetTypes()) .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) .ToList(); + + allEventTypes.AddRange(GetGenericTypeEventType(assemblies)); + UnitOfWorkRelation = allEventTypes.ToDictionary(type => type, IsSupportUnitOfWork); } + + private List GetGenericTypeEventType(Assembly[] assemblies) + { + var methods = assemblies + .SelectMany(assembly => assembly.GetTypes().SelectMany(method => method.GetMethods())) + .Where(method => method.GetCustomAttributes(typeof(EventHandlerAttribute), false).Length > 0); + + var allEventTypes = methods.SelectMany(method => method.GetParameters().Where(type => type.ParameterType.IsGenericType == true && + type.ParameterType.GetGenericTypeDefinition()?.BaseType?.Name == typeof(EntityChangedEvent<>).Name)) + .Select(type => type.ParameterType).ToList(); + + return allEventTypes; + } } diff --git a/test/Masa.Framework.IntegrationTests.EventBus/Application/Events/RegisterUserEvent.cs b/test/Masa.Framework.IntegrationTests.EventBus/Application/Events/RegisterUserEvent.cs index 0bca53d28..febb72e6a 100644 --- a/test/Masa.Framework.IntegrationTests.EventBus/Application/Events/RegisterUserEvent.cs +++ b/test/Masa.Framework.IntegrationTests.EventBus/Application/Events/RegisterUserEvent.cs @@ -1,6 +1,8 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Masa.BuildingBlocks.Ddd.Domain.Events; + namespace Masa.Framework.IntegrationTests.EventBus.Application.Events; public record RegisterUserEvent : Event @@ -9,3 +11,16 @@ public record RegisterUserEvent : Event public int Age { get; set; } } +public record RegisterUserDomainEvent : DomainCommand +{ + public string Name { get; set; } + + public int Age { get; set; } +} + +public record RegisterUserIntegrationDomainEvent : IntegrationDomainEvent +{ + public string Name { get; set; } + + public int Age { get; set; } +} diff --git a/test/Masa.Framework.IntegrationTests.EventBus/Application/UserHandler.cs b/test/Masa.Framework.IntegrationTests.EventBus/Application/UserHandler.cs index 5dd13e8c0..882d595b4 100644 --- a/test/Masa.Framework.IntegrationTests.EventBus/Application/UserHandler.cs +++ b/test/Masa.Framework.IntegrationTests.EventBus/Application/UserHandler.cs @@ -1,6 +1,8 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Masa.BuildingBlocks.Ddd.Domain.Events; + namespace Masa.Framework.IntegrationTests.EventBus.Application; public class UserHandler @@ -48,7 +50,7 @@ await _repository.AddAsync(new User() public async Task UserExistAsync(UserAgeQuery query) { var checkUserQuery = new CheckUserQuery(); //Check whether the second verification can enter normally - await Assert.ThrowsExceptionAsync(async () => await _eventBus.PublishAsync(checkUserQuery),"Name is required on CheckUserQuery"); + await Assert.ThrowsExceptionAsync(async () => await _eventBus.PublishAsync(checkUserQuery), "Name is required on CheckUserQuery"); if (!checkUserQuery.Result) return; @@ -62,4 +64,14 @@ public async Task UserExistAsync(CheckUserQuery query) var user = await _repository.FindAsync(u => u.Name == query.Name); query.Result = user != null; } + + [EventHandler] + public async Task UserEntityCreatedEventAsync(EntityCreatedDomainEvent command) + { + var userEntity = command.Entity; + if (userEntity is null) + { + throw new Exception($"User 【{nameof(UserEntityCreatedEventAsync)}】 already exists"); + } + } } diff --git a/test/Masa.Framework.IntegrationTests.EventBus/Domain/Aggregate/User.cs b/test/Masa.Framework.IntegrationTests.EventBus/Domain/Aggregate/User.cs index 736ecd83f..21239e764 100644 --- a/test/Masa.Framework.IntegrationTests.EventBus/Domain/Aggregate/User.cs +++ b/test/Masa.Framework.IntegrationTests.EventBus/Domain/Aggregate/User.cs @@ -1,4 +1,4 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.Framework.IntegrationTests.EventBus.Domain.Aggregate; @@ -13,4 +13,9 @@ public User() { Id = Guid.NewGuid(); } + + public void RegisterUserIntegrationDomainEvent() { + + base.AddDomainEvent(new RegisterUserIntegrationDomainEvent()); + } } diff --git a/test/Masa.Framework.IntegrationTests.EventBus/TestDispatcher.cs b/test/Masa.Framework.IntegrationTests.EventBus/TestDispatcher.cs index fe05b2229..eae95c26d 100644 --- a/test/Masa.Framework.IntegrationTests.EventBus/TestDispatcher.cs +++ b/test/Masa.Framework.IntegrationTests.EventBus/TestDispatcher.cs @@ -1,6 +1,11 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Masa.BuildingBlocks.Ddd.Domain.Events; +using Masa.Framework.IntegrationTests.EventBus.Application; +using System.Linq; +using System.Reflection; + namespace Masa.Framework.IntegrationTests.EventBus; [TestClass] @@ -93,7 +98,7 @@ public async Task TestEventBusOnConcurrencyAsync() }; var tasks = new ConcurrentBag(); - var testCount = 1000L; + var testCount = 100; Parallel.For(1L, testCount + 1, i => { tasks.Add(AddUserAsync(serviceProvider, @event)); @@ -112,4 +117,30 @@ private async Task AddUserAsync(IServiceProvider serviceProvider, RegisterUserEv var eventBus = scope.ServiceProvider.GetRequiredService(); await eventBus.PublishAsync(@event); } + + [TestMethod] + public async Task TestEntityCreatedEventAsync() + { + var serviceProvider = ServiceProvider; + var unitOfWork = serviceProvider.GetRequiredService(); + var eventBus = serviceProvider.GetRequiredService(); + var domainEventBus = serviceProvider.GetRequiredService(); + var dbContext = serviceProvider.GetRequiredService(); + var users = new List(); + var testCount = 100; + Parallel.For(1L, testCount + 1, i => + { + users.Add(new User + { + Age = 18, + Name = i.ToString() + }); + }); + await dbContext.Set().AddRangeAsync(users); + await dbContext.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(); + await unitOfWork.CommitAsync(); + var count = dbContext.Set().Count(); + Assert.IsTrue(count == testCount); + } } From 827f1dacb1d5d871f970d39d53dda34955501d66 Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Thu, 25 Apr 2024 13:44:45 +0800 Subject: [PATCH 02/15] 1 --- .../Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs index 71c11e73c..009b0a168 100644 --- a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs +++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs @@ -33,7 +33,10 @@ public UserFriendlyException( { } - public UserFriendlyException(string errorCode, string message, LogLevel? logLevel, params object[] parameters) + public UserFriendlyException(string errorCode, + string message, + LogLevel? logLevel, + params object[] parameters) : base(message, null, errorCode, logLevel, parameters) { } From bf24d3fb39f8434e26207ef98c463156752a6abf Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Thu, 25 Apr 2024 14:15:48 +0800 Subject: [PATCH 03/15] feat:add Aggregate root object creation, modification, and deletion events --- .../Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs index 009b0a168..9652a175d 100644 --- a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs +++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/UserFriendlyException.cs @@ -33,7 +33,8 @@ public UserFriendlyException( { } - public UserFriendlyException(string errorCode, + public UserFriendlyException( + string errorCode, string message, LogLevel? logLevel, params object[] parameters) From 3fb1fea2c189ad7590ffc867d6ab8d8fb047c6ac Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Fri, 26 Apr 2024 10:17:44 +0800 Subject: [PATCH 04/15] feat:optimization topic default value --- .../Events/IntegrationDomainEvent.cs | 2 +- .../IntegrationEvent.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs index f6cd438e2..123f4055e 100644 --- a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs @@ -10,6 +10,6 @@ public abstract record IntegrationDomainEvent(Guid EventId, DateTime EvenCreateT protected IntegrationDomainEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { // ReSharper disable once VirtualMemberCallInConstructor - if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().Name; + if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().FullName ?? GetType().Name; } } diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs index 2cf113ea6..6bb070ed6 100644 --- a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs @@ -5,12 +5,12 @@ namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; public abstract record IntegrationEvent : IIntegrationEvent { - [JsonInclude]public Guid EventId { private get; set; } + [JsonInclude] public Guid EventId { private get; set; } [JsonInclude] public DateTime EvenCreateTime { private get; set; } - [NotMapped] [JsonIgnore] public IUnitOfWork? UnitOfWork { get; set; } + [NotMapped][JsonIgnore] public IUnitOfWork? UnitOfWork { get; set; } public virtual string Topic { get; set; } @@ -20,7 +20,7 @@ protected IntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow) protected IntegrationEvent(Guid eventId, DateTime creationTime) { - if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().Name; + if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().FullName ?? GetType().Name; EventId = eventId; EvenCreateTime = creationTime; From 449e060d7d1bb1dee3ead07a8b45dfc24e152f02 Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Sun, 28 Apr 2024 14:38:28 +0800 Subject: [PATCH 05/15] feat:init event --- Masa.Framework.sln | 11 ++ .../Logs/IIntegrationEventLogService.cs | 6 + .../Publisher.cs | 55 +++++++++ .../IntegrationEventLogService.cs | 111 ++++++++++++++++++ .../IPublisher.cs | 6 +- .../Internal/LocalQueueProcessor.cs | 3 + .../Processor/SendByDataProcessor.cs | 66 ++++++++++- .../CustomIntegrationEventLogService.cs | 17 ++- .../Internal/Options/DispatcherOptions.cs | 4 +- .../Command/RegisterUserCommand.cs | 11 ++ .../Events/AddGoodsIntegrationEvent.cs | 17 +++ .../Application/Events/RegisterUserEvent.cs | 26 ++++ .../Application/Queries/CheckUserQuery.cs | 11 ++ .../Queries/CheckUserQueryValidator.cs | 12 ++ .../Application/Queries/UserAgeQuery.cs | 11 ++ .../Queries/UserAgeQueryValidator.cs | 12 ++ .../Application/UserHandler.cs | 89 ++++++++++++++ .../Controllers/WeatherForecastController.cs | 76 ++++++++++++ .../Domain/Aggregate/User.cs | 27 +++++ .../Domain/IUserRepository.cs | 9 ++ .../Infrastructure/CustomDbContext.cs | 13 ++ .../Extensions/DefaultPublisher.cs | 18 +++ .../Extensions/DispatcherOptionsExtensions.cs | 14 +++ .../Middleware/RecordEventMiddleware.cs | 18 +++ .../Middleware/ValidatorEventMiddleware.cs | 31 +++++ .../Infrastructure/UserRepository.cs | 13 ++ .../Masa.Framework.EventApiTest.csproj | 38 ++++++ .../Masa.Framework.EventApiTest.http | 6 + test/Masa.Framework.EventApiTest/Program.cs | 55 +++++++++ .../Properties/launchSettings.json | 41 +++++++ .../WeatherForecast.cs | 16 +++ test/Masa.Framework.EventApiTest/_Imports.cs | 25 ++++ .../appsettings.Development.json | 17 +++ .../appsettings.json | 9 ++ ...te-db-030e2f29-3398-493e-831a-0df85d3cba90 | Bin 0 -> 32768 bytes ...b-030e2f29-3398-493e-831a-0df85d3cba90-shm | Bin 0 -> 32768 bytes ...b-030e2f29-3398-493e-831a-0df85d3cba90-wal | Bin 0 -> 8272 bytes ...te-db-3c5ac305-031e-4528-b266-8dda3033996b | Bin 0 -> 4096 bytes ...b-3c5ac305-031e-4528-b266-8dda3033996b-shm | Bin 0 -> 32768 bytes ...b-3c5ac305-031e-4528-b266-8dda3033996b-wal | Bin 0 -> 32992 bytes ...te-db-771923ba-dbfc-4e66-a48e-3e3b88dab164 | Bin 0 -> 4096 bytes ...b-771923ba-dbfc-4e66-a48e-3e3b88dab164-shm | Bin 0 -> 32768 bytes ...b-771923ba-dbfc-4e66-a48e-3e3b88dab164-wal | Bin 0 -> 32992 bytes ...te-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a | Bin 0 -> 4096 bytes ...b-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-shm | Bin 0 -> 32768 bytes ...b-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-wal | Bin 0 -> 32992 bytes ...te-db-984c0369-48ed-42be-a99c-72107b56f152 | Bin 0 -> 4096 bytes ...b-984c0369-48ed-42be-a99c-72107b56f152-shm | Bin 0 -> 32768 bytes ...b-984c0369-48ed-42be-a99c-72107b56f152-wal | Bin 0 -> 49472 bytes ...te-db-9ce2678b-23f0-45c2-a462-5cc133563f99 | Bin 0 -> 4096 bytes ...b-9ce2678b-23f0-45c2-a462-5cc133563f99-shm | Bin 0 -> 32768 bytes ...b-9ce2678b-23f0-45c2-a462-5cc133563f99-wal | Bin 0 -> 32992 bytes ...te-db-c06366dc-86f3-432f-88df-e4113c9a1cde | Bin 0 -> 4096 bytes ...b-c06366dc-86f3-432f-88df-e4113c9a1cde-shm | Bin 0 -> 32768 bytes ...b-c06366dc-86f3-432f-88df-e4113c9a1cde-wal | Bin 0 -> 32992 bytes ...te-db-f2690ef2-e66f-48c1-a860-de70296ad11c | Bin 0 -> 4096 bytes ...b-f2690ef2-e66f-48c1-a860-de70296ad11c-shm | Bin 0 -> 32768 bytes ...b-f2690ef2-e66f-48c1-a860-de70296ad11c-wal | Bin 0 -> 74192 bytes ...te-db-f2f00a26-ada5-4daf-87e6-25f27eaea770 | Bin 0 -> 4096 bytes ...b-f2f00a26-ada5-4daf-87e6-25f27eaea770-shm | Bin 0 -> 32768 bytes ...b-f2f00a26-ada5-4daf-87e6-25f27eaea770-wal | Bin 0 -> 49472 bytes .../Extensions/DefaultPublisher.cs | 8 +- 62 files changed, 895 insertions(+), 7 deletions(-) create mode 100644 test/Masa.Framework.EventApiTest/Application/Command/RegisterUserCommand.cs create mode 100644 test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs create mode 100644 test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs create mode 100644 test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQuery.cs create mode 100644 test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQueryValidator.cs create mode 100644 test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQuery.cs create mode 100644 test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQueryValidator.cs create mode 100644 test/Masa.Framework.EventApiTest/Application/UserHandler.cs create mode 100644 test/Masa.Framework.EventApiTest/Controllers/WeatherForecastController.cs create mode 100644 test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs create mode 100644 test/Masa.Framework.EventApiTest/Domain/IUserRepository.cs create mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/CustomDbContext.cs create mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DefaultPublisher.cs create mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DispatcherOptionsExtensions.cs create mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/Middleware/RecordEventMiddleware.cs create mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/Middleware/ValidatorEventMiddleware.cs create mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/UserRepository.cs create mode 100644 test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.csproj create mode 100644 test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.http create mode 100644 test/Masa.Framework.EventApiTest/Program.cs create mode 100644 test/Masa.Framework.EventApiTest/Properties/launchSettings.json create mode 100644 test/Masa.Framework.EventApiTest/WeatherForecast.cs create mode 100644 test/Masa.Framework.EventApiTest/_Imports.cs create mode 100644 test/Masa.Framework.EventApiTest/appsettings.Development.json create mode 100644 test/Masa.Framework.EventApiTest/appsettings.json create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90 create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-wal create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-wal create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164 create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-wal create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-wal create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152 create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-wal create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99 create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-wal create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde-wal create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-wal create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770 create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-wal diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 866922a49..1e2c7aaff 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -625,6 +625,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.DynamicsCrm.Core EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.DynamicsCrm.EntityFrameworkCore", "src\Utils\DynamicsCrm\Masa.Utils.DynamicsCrm.EntityFrameworkCore\Masa.Utils.DynamicsCrm.EntityFrameworkCore.csproj", "{8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Framework.EventApiTest", "test\Masa.Framework.EventApiTest\Masa.Framework.EventApiTest.csproj", "{345F5F33-8788-43F3-9005-B3EEBC007C72}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2185,6 +2187,14 @@ Global {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}.Release|Any CPU.Build.0 = Release|Any CPU {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}.Release|x64.ActiveCfg = Release|Any CPU {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}.Release|x64.Build.0 = Release|Any CPU + {345F5F33-8788-43F3-9005-B3EEBC007C72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {345F5F33-8788-43F3-9005-B3EEBC007C72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {345F5F33-8788-43F3-9005-B3EEBC007C72}.Debug|x64.ActiveCfg = Debug|Any CPU + {345F5F33-8788-43F3-9005-B3EEBC007C72}.Debug|x64.Build.0 = Debug|Any CPU + {345F5F33-8788-43F3-9005-B3EEBC007C72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {345F5F33-8788-43F3-9005-B3EEBC007C72}.Release|Any CPU.Build.0 = Release|Any CPU + {345F5F33-8788-43F3-9005-B3EEBC007C72}.Release|x64.ActiveCfg = Release|Any CPU + {345F5F33-8788-43F3-9005-B3EEBC007C72}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2493,6 +2503,7 @@ Global {64B54122-44F1-4379-9422-953EF706A3A6} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} {83310F46-E1C7-4438-B32A-9F6F7EA13FCF} = {64B54122-44F1-4379-9422-953EF706A3A6} {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC} = {64B54122-44F1-4379-9422-953EF706A3A6} + {345F5F33-8788-43F3-9005-B3EEBC007C72} = {E747043D-81E2-4A89-8B5B-1258ED45F941} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs index 62cbccb11..e1104ceb6 100644 --- a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs @@ -37,10 +37,16 @@ Task SaveEventAsync( Task MarkEventAsPublishedAsync(Guid eventId, CancellationToken cancellationToken = default); + Task BulkMarkEventAsPublishedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default); + Task MarkEventAsInProgressAsync(Guid eventId, int minimumRetryInterval, CancellationToken cancellationToken = default); + Task BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minimumRetryInterval, CancellationToken cancellationToken = default); + Task MarkEventAsFailedAsync(Guid eventId, CancellationToken cancellationToken = default); + Task BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default); + /// /// Delete successfully published and expired data /// diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs index a9839ec31..b66eaa941 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs @@ -67,4 +67,59 @@ public async Task PublishAsync( @event); } } + + public async Task BulkPublishAsync( + string topicName, List<(T @event, IntegrationEventExpand? eventMessageExpand)> @events, + CancellationToken stoppingToken = default) + { + + _logger?.LogDebug("-----BulkPublishEvent Integration event publishing is in progress from {AppId} with DaprAppId as '{DaprAppId}'", _appId, + _daprAppId); + + if (!@events.Any()) + return; + + MasaArgumentException.ThrowIfNullOrWhiteSpace(_daprAppId); + + var masaCloudEvents = new List>(); + var waitEvents = new List(); + + @events.ForEach(item => + { + if (item.eventMessageExpand is { Isolation.Count: > 0 }) + { + var eventMessage = new IntegrationEventMessage(item.@event, item.eventMessageExpand); + var masaCloudEvent = new MasaCloudEvent(eventMessage) + { + Source = new Uri(_daprAppId, UriKind.RelativeOrAbsolute) + }; + + masaCloudEvents.Add(masaCloudEvent); + } + else + { + waitEvents.Add(item.@event); + } + }); + + if (masaCloudEvents.Any()) + { + await DaprClient.PublishEventAsync(_pubSubName, topicName, masaCloudEvents, stoppingToken); + _logger?.LogDebug( + "-----BulkPublishEvent Publishing integration event from {AppId} succeeded with DaprAppId is {DaprAppId} and Event is {Event}", + _appId, + _daprAppId, + masaCloudEvents); + } + + if (waitEvents.Any()) + { + await DaprClient.BulkPublishEventAsync(_pubSubName, topicName, @events.ToList(), cancellationToken: stoppingToken); + _logger?.LogDebug( + "-----BulkPublishEvent Publishing integration event from {AppId} succeeded with DaprAppId is {DaprAppId} and Event is {Event}", + _appId, + _daprAppId, + @events); + } + } } diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs index 7caff061d..867c9e966 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs @@ -106,6 +106,25 @@ public Task MarkEventAsPublishedAsync(Guid eventId, CancellationToken cancellati }, cancellationToken); } + public Task BulkMarkEventAsPublishedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) + { + return BulkUpdateEventStatus(eventIds, IntegrationEventStates.Published, eventLogs => + { + eventLogs.ForEach(eventLog => + { + if (eventLog.State != IntegrationEventStates.InProgress) + { + _logger?.LogWarning( + "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", + IntegrationEventStates.Published, eventLog.State, eventLog.Id); + throw new UserFriendlyException( + $"Failed to modify the state of the local message table to {IntegrationEventStates.Published}, the current State is {eventLog.State}, Id: {eventLog.Id}"); + } + }); + + }, cancellationToken); + } + public Task MarkEventAsInProgressAsync(Guid eventId, int minimumRetryInterval, CancellationToken cancellationToken = default) { return UpdateEventStatus(eventId, IntegrationEventStates.InProgress, eventLog => @@ -132,6 +151,35 @@ public Task MarkEventAsInProgressAsync(Guid eventId, int minimumRetryInterval, C }, cancellationToken); } + public Task BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minimumRetryInterval, CancellationToken cancellationToken = default) + { + return BulkUpdateEventStatus(eventIds, IntegrationEventStates.InProgress, eventLogs => + { + eventLogs.ForEach(eventLog => + { + if (eventLog.State is IntegrationEventStates.InProgress or IntegrationEventStates.PublishedFailed && + (eventLog.GetCurrentTime() - eventLog.ModificationTime).TotalSeconds < minimumRetryInterval) + { + _logger?.LogInformation( + "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}, Multitasking execution error, waiting for the next retry", + IntegrationEventStates.InProgress, eventLog.State, eventLog.Id); + throw new UserFriendlyException( + $"Failed to modify the state of the local message table to {IntegrationEventStates.InProgress}, the current State is {eventLog.State}, Id: {eventLog.Id}, Multitasking execution error, waiting for the next retry"); + } + if (eventLog.State != IntegrationEventStates.NotPublished && + eventLog.State != IntegrationEventStates.InProgress && + eventLog.State != IntegrationEventStates.PublishedFailed) + { + _logger?.LogWarning( + "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", + IntegrationEventStates.InProgress, eventLog.State, eventLog.Id); + throw new UserFriendlyException( + $"Failed to modify the state of the local message table to {IntegrationEventStates.InProgress}, the current State is {eventLog.State}, Id: {eventLog.Id}"); + } + }); + }, cancellationToken); + } + public Task MarkEventAsFailedAsync(Guid eventId, CancellationToken cancellationToken = default) { return UpdateEventStatus(eventId, IntegrationEventStates.PublishedFailed, eventLog => @@ -147,6 +195,24 @@ public Task MarkEventAsFailedAsync(Guid eventId, CancellationToken cancellationT }, cancellationToken); } + public Task BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) + { + return BulkUpdateEventStatus(eventIds, IntegrationEventStates.PublishedFailed, eventLogs => + { + eventLogs.ForEach(eventLog => + { + if (eventLog.State != IntegrationEventStates.InProgress) + { + _logger?.LogWarning( + "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", + IntegrationEventStates.PublishedFailed, eventLog.State, eventLog.Id); + throw new UserFriendlyException( + $"Failed to modify the state of the local message table to {IntegrationEventStates.PublishedFailed}, the current State is {eventLog.State}, Id: {eventLog.Id}"); + } + }); + }, cancellationToken); + } + public async Task DeleteExpiresAsync(DateTime expiresAt, int batchCount, CancellationToken token = default) { var eventLogs = _eventLogContext.EventLogs.Where(e => e.ModificationTime < expiresAt && e.State == IntegrationEventStates.Published) @@ -164,6 +230,51 @@ public async Task DeleteExpiresAsync(DateTime expiresAt, int batchCount, Cancell } } + private async Task BulkUpdateEventStatus(IEnumerable eventIds, + IntegrationEventStates status, + Action>? action = null, + CancellationToken cancellationToken = default) + { + var eventLogEntrys = + await _eventLogContext.EventLogs.Where(e => eventIds.Contains(e.EventId)).ToListAsync(); + if (eventLogEntrys == null || !eventLogEntrys.Any()) + throw new ArgumentException( + $"The local message record does not exist, please confirm whether the local message record has been deleted or other reasons cause the local message record to not be inserted successfully In EventId: {eventIds}", + nameof(eventIds)); + + action?.Invoke(eventLogEntrys); + + var updateEventLogEntry = new List(); + foreach (var eventLogEntry in eventLogEntrys) + { + if (eventLogEntry.State == status) + { + continue; + } + + eventLogEntry.State = status; + eventLogEntry.ModificationTime = eventLogEntry.GetCurrentTime(); + + if (status == IntegrationEventStates.InProgress) + eventLogEntry.TimesSent++; + + updateEventLogEntry.Add(eventLogEntry); + } + + _eventLogContext.EventLogs.UpdateRange(updateEventLogEntry); + + try + { + await _eventLogContext.DbContext.SaveChangesAsync(cancellationToken); + } + catch (DbUpdateConcurrencyException ex) + { + throw new UserFriendlyException($"Concurrency conflict, update exception. {ex.Message}"); + } + + updateEventLogEntry.ForEach(CheckAndDetached); + } + private async Task UpdateEventStatus(Guid eventId, IntegrationEventStates status, Action? action = null, diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs index 7c6c35bb5..5c3792c38 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs @@ -1,4 +1,4 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.Contrib.Dispatcher.IntegrationEvents; @@ -10,4 +10,8 @@ Task PublishAsync( T @event, IntegrationEventExpand? eventMessageExpand, CancellationToken stoppingToken = default); + + Task BulkPublishAsync( + string topicName, List<(T @event, IntegrationEventExpand? eventMessageExpand)> @events, + CancellationToken stoppingToken = default); } diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs index e0fcb6d4d..299032cc6 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs @@ -22,6 +22,9 @@ public static void SetLogger(IServiceCollection services) public void AddJobs(IntegrationEventLogItem items) => _retryEventLogs.TryAdd(items.EventId, items); + public void BulkAddJobs(List items) + => items.ForEach(item => _retryEventLogs.TryAdd(item.EventId, item)); + public void RemoveJobs(Guid eventId) => _retryEventLogs.TryRemove(eventId, out _); diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs index fc45942a6..38f653c5b 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs @@ -35,7 +35,68 @@ await eventLogService.RetrieveEventLogsPendingToPublishAsync( _options.Value.BatchSize, stoppingToken); - if(!retrieveEventLogs.Any()) + if (!retrieveEventLogs.Any()) + return; + + var publisher = serviceProvider.GetRequiredService(); + var retrieveEventLogsGroupByTopic = retrieveEventLogs.GroupBy(eventLog => eventLog.Topic) + .Select(eventLog => new + { + TopicName = eventLog.Key, + Events = eventLog.Select(log => new { log.Event, log.EventExpand, log.EventId }).ToList(), + }).ToList(); + + foreach (var eventLog in retrieveEventLogsGroupByTopic) + { + var eventIds = eventLog.Events.Select(item => item.EventId); + var events = eventLog.Events.Select(item => (item.Event, item.EventExpand)).ToList(); + + try + { + await eventLogService.BulkMarkEventAsInProgressAsync(eventIds, _options.Value.MinimumRetryInterval, stoppingToken); + + _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", + eventLog, + eventLog.TopicName); + + await publisher.BulkPublishAsync(eventLog.TopicName, events, stoppingToken); + + await eventLogService.BulkMarkEventAsPublishedAsync(eventIds, stoppingToken); + } + catch (UserFriendlyException) + { + //Update state due to multitasking contention, no processing required + } + catch (Exception ex) + { + _logger?.LogError(ex, + "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", + eventIds, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); + await eventLogService.BulkMarkEventAsFailedAsync(eventIds, stoppingToken); + + var integrationEventLogItem = eventLog.Events.Select(item => + new IntegrationEventLogItem(item.EventId, eventLog.TopicName, item.Event, item.EventExpand)).ToList(); + + LocalQueueProcessor.Default.BulkAddJobs(integrationEventLogItem); + } + } + } + + [Obsolete] + private async Task ExecuteByObsoleteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) + { + var unitOfWork = serviceProvider.GetService(); + if (unitOfWork != null) + unitOfWork.UseTransaction = false; + + var eventLogService = serviceProvider.GetRequiredService(); + + var retrieveEventLogs = + await eventLogService.RetrieveEventLogsPendingToPublishAsync( + _options.Value.BatchSize, + stoppingToken); + + if (!retrieveEventLogs.Any()) return; var publisher = serviceProvider.GetRequiredService(); @@ -65,7 +126,8 @@ await eventLogService.RetrieveEventLogsPendingToPublishAsync( eventLog.EventId, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); await eventLogService.MarkEventAsFailedAsync(eventLog.EventId, stoppingToken); - LocalQueueProcessor.Default.AddJobs(new IntegrationEventLogItem(eventLog.EventId, eventLog.Topic, eventLog.Event, eventLog.EventExpand)); + LocalQueueProcessor.Default.AddJobs(new IntegrationEventLogItem(eventLog.EventId, eventLog.Topic, eventLog.Event, + eventLog.EventExpand)); } } } diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs index 9d354eb8d..c6fdfe995 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs @@ -1,4 +1,4 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; @@ -47,4 +47,19 @@ public Task SaveEventAsync( { return Task.CompletedTask; } + + public Task BulkMarkEventAsPublishedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minimumRetryInterval, CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } } diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Options/DispatcherOptions.cs index b2bcf02af..bd5f4e9c1 100644 --- a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Options/DispatcherOptions.cs +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Options/DispatcherOptions.cs @@ -28,12 +28,12 @@ public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) .ToList(); - allEventTypes.AddRange(GetGenericTypeEventType(assemblies)); + allEventTypes.AddRange(GetGenericEventType(assemblies)); UnitOfWorkRelation = allEventTypes.ToDictionary(type => type, IsSupportUnitOfWork); } - private List GetGenericTypeEventType(Assembly[] assemblies) + private List GetGenericEventType(Assembly[] assemblies) { var methods = assemblies .SelectMany(assembly => assembly.GetTypes().SelectMany(method => method.GetMethods())) diff --git a/test/Masa.Framework.EventApiTest/Application/Command/RegisterUserCommand.cs b/test/Masa.Framework.EventApiTest/Application/Command/RegisterUserCommand.cs new file mode 100644 index 000000000..125728960 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Application/Command/RegisterUserCommand.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Application.Command; + +public record RegisterUserCommand : BuildingBlocks.ReadWriteSplitting.Cqrs.Commands.Command +{ + public string Name { get; set; } + + public int Age { get; set; } +} diff --git a/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs b/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs new file mode 100644 index 000000000..b52043035 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Application.Events; + +public record AddGoodsIntegrationEvent : IntegrationEvent +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public int Count { get; set; } + + public decimal Price { get; set; } + + public override string Topic { get; set; } = nameof(AddGoodsIntegrationEvent); +} diff --git a/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs b/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs new file mode 100644 index 000000000..febb72e6a --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.Ddd.Domain.Events; + +namespace Masa.Framework.IntegrationTests.EventBus.Application.Events; + +public record RegisterUserEvent : Event +{ + public string Name { get; set; } + + public int Age { get; set; } +} +public record RegisterUserDomainEvent : DomainCommand +{ + public string Name { get; set; } + + public int Age { get; set; } +} + +public record RegisterUserIntegrationDomainEvent : IntegrationDomainEvent +{ + public string Name { get; set; } + + public int Age { get; set; } +} diff --git a/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQuery.cs b/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQuery.cs new file mode 100644 index 000000000..e43964af6 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQuery.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Application.Queries; + +public record CheckUserQuery : Query +{ + public string Name { get; set; } + + public override bool Result { get; set; } +} diff --git a/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQueryValidator.cs b/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQueryValidator.cs new file mode 100644 index 000000000..d7255d017 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQueryValidator.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Application.Queries; + +public class CheckUserQueryValidator : AbstractValidator +{ + public CheckUserQueryValidator() + { + RuleFor(u => u.Name).NotNull().WithMessage("Name is required on CheckUserQuery"); + } +} diff --git a/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQuery.cs b/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQuery.cs new file mode 100644 index 000000000..172807102 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQuery.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Application.Queries; + +public record UserAgeQuery : Query +{ + public string Name { get; set; } + + public override int Result { get; set; } +} diff --git a/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQueryValidator.cs b/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQueryValidator.cs new file mode 100644 index 000000000..6ed387503 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQueryValidator.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Application.Queries; + +public class UserAgeQueryValidator: AbstractValidator +{ + public UserAgeQueryValidator() + { + RuleFor(u => u.Name).NotNull().WithMessage("Name is required on UserAgeQuery"); + } +} diff --git a/test/Masa.Framework.EventApiTest/Application/UserHandler.cs b/test/Masa.Framework.EventApiTest/Application/UserHandler.cs new file mode 100644 index 000000000..4195bb848 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Application/UserHandler.cs @@ -0,0 +1,89 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.Ddd.Domain.Events; + +namespace Masa.Framework.IntegrationTests.EventBus.Application; + +public class UserHandler +{ + private readonly IEventBus _eventBus; + private readonly IRepository _repository; + private readonly IUnitOfWork _unitOfWork; + + public UserHandler(IEventBus eventBus, IRepository repository, IUnitOfWork unitOfWork) + { + _eventBus = eventBus; + _repository = repository; + _unitOfWork = unitOfWork; + } + + [EventHandler] + public async Task RegisterUserByEventAsync(RegisterUserEvent @event) + { + await _repository.AddAsync(new User() + { + Name = @event.Name, + Age = @event.Age + }); + } + + [EventHandler] + public async Task RegisterUserByCommandAsync(RegisterUserCommand command) + { + var query = new CheckUserQuery() + { + Name = command.Name + }; + await _eventBus.PublishAsync(query); + if (query.Result) + throw new Exception($"User 【{command.Name}】 already exists"); + + await _repository.AddAsync(new User() + { + Name = command.Name, + Age = command.Age + }); + } + + [EventHandler] + public async Task UserExistAsync(UserAgeQuery query) + { + var checkUserQuery = new CheckUserQuery(); //Check whether the second verification can enter normally + await Assert.ThrowsExceptionAsync(async () => await _eventBus.PublishAsync(checkUserQuery), "Name is required on CheckUserQuery"); + if (!checkUserQuery.Result) + return; + + var user = await _repository.FindAsync(u => u.Name == query.Name); + query.Result = user!.Age; + } + + [EventHandler] + public async Task UserExistAsync(CheckUserQuery query) + { + var user = await _repository.FindAsync(u => u.Name == query.Name); + query.Result = user != null; + } + + [EventHandler] + public async Task UserEntityCreatedEventAsync(EntityCreatedDomainEvent command) + { + var userEntity = command.Entity; + if (userEntity is null) + { + throw new Exception($"User 【{nameof(UserEntityCreatedEventAsync)}】 already exists"); + } + } + + [EventHandler] + public async Task RegisterUserDomainEvent(RegisterUserDomainEvent command) + { + await Console.Out.WriteLineAsync($"User 【{nameof(RegisterUserDomainEvent)}】 already exists"); + } + + [EventHandler] + public async Task RegisterUserIntegrationDomainEvent(RegisterUserIntegrationDomainEvent command) + { + await Console.Out.WriteLineAsync($"User 【{nameof(RegisterUserIntegrationDomainEvent)}】 already exists"); + } +} diff --git a/test/Masa.Framework.EventApiTest/Controllers/WeatherForecastController.cs b/test/Masa.Framework.EventApiTest/Controllers/WeatherForecastController.cs new file mode 100644 index 000000000..38a496009 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Controllers/WeatherForecastController.cs @@ -0,0 +1,76 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Dapr; +using Microsoft.AspNetCore.Mvc; + +namespace Masa.Framework.EventApiTest.Controllers +{ + [ApiController] + [Route("[controller]/[action]")] + public class WeatherForecastController : ControllerBase + { + private readonly ILogger _logger; + private readonly IEventBus eventBus; + private readonly CustomDbContext dbContext; + private readonly IUnitOfWork unitOfWork; + private readonly Masa.Framework.EventApiTest.Domain.IUserRepository userRepository; + private readonly IIntegrationEventBus integrationEventBus; + + public WeatherForecastController(ILogger logger, IEventBus eventBus, CustomDbContext customDbContext, IUnitOfWork unitOfWork, Domain.IUserRepository userRepository, IIntegrationEventBus integrationEventBus) + { + _logger = logger; + this.eventBus = eventBus; + this.dbContext = customDbContext; + this.unitOfWork = unitOfWork; + this.userRepository = userRepository; + this.integrationEventBus = integrationEventBus; + } + + [HttpGet] + public async Task Add() + { + var user = new User + { + Age = 18, + Name = 1.ToString() + }; + //user.RegisterUserIntegrationDomainEvent(); + user.RegisterUserDomainEvent(); + + await userRepository.AddAsync(user); + await userRepository.UnitOfWork.SaveChangesAsync(); + await userRepository.UnitOfWork.CommitAsync(); + + //await dbContext.Set().AddAsync(user); + //await unitOfWork.SaveChangesAsync(); + //await unitOfWork.CommitAsync(); + var count = await userRepository.GetCountAsync(); + await Console.Out.WriteLineAsync(count.ToString()); + + return count; + } + + [HttpGet] + public async Task IntegrationEventBus() + { + await integrationEventBus.PublishAsync(new AddGoodsIntegrationEvent() + { + Name = "Apple", + Count = 1, + Id = Guid.NewGuid(), + Price = 9.9m, + }); + + return 1; + } + + [HttpPost] + [Topic("pubsub", nameof(AddGoodsIntegrationEvent))] + public async Task UnlockDeviceBindingStatusAsync(AddGoodsIntegrationEvent integrationEvent) + { + await Console.Out.WriteLineAsync("123"); + } + + } +} diff --git a/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs b/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs new file mode 100644 index 000000000..14078516e --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Domain.Aggregate; + +public class User : AggregateRoot +{ + public string Name { get; set; } + + public int Age { get; set; } + + public User() + { + Id = Guid.NewGuid(); + } + + public void RegisterUserIntegrationDomainEvent() { + + base.AddDomainEvent(new RegisterUserIntegrationDomainEvent()); + } + public void RegisterUserDomainEvent() { + + base.AddDomainEvent(new RegisterUserDomainEvent()); + } + + +} diff --git a/test/Masa.Framework.EventApiTest/Domain/IUserRepository.cs b/test/Masa.Framework.EventApiTest/Domain/IUserRepository.cs new file mode 100644 index 000000000..b0cced648 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Domain/IUserRepository.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.EventApiTest.Domain +{ + public interface IUserRepository : IRepository + { + } +} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/CustomDbContext.cs b/test/Masa.Framework.EventApiTest/Infrastructure/CustomDbContext.cs new file mode 100644 index 000000000..077141377 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Infrastructure/CustomDbContext.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure; + +public class CustomDbContext : MasaDbContext +{ + public DbSet User { get; set; } + + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + } +} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DefaultPublisher.cs b/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DefaultPublisher.cs new file mode 100644 index 000000000..c56c62e72 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DefaultPublisher.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + + +namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure.Extensions; + +public class DefaultPublisher : IPublisher +{ + public Task BulkPublishAsync(string topicName, List<(T @event, IntegrationEventExpand? eventMessageExpand)> events, CancellationToken stoppingToken = default) + { + return Task.CompletedTask; + } + + public Task PublishAsync(string topicName, T @event, IntegrationEventExpand? eventMessageExpand, CancellationToken stoppingToken = default) + { + return Task.CompletedTask; + } +} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DispatcherOptionsExtensions.cs b/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DispatcherOptionsExtensions.cs new file mode 100644 index 000000000..c49134f74 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DispatcherOptionsExtensions.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure.Extensions; + +public static class DispatcherOptionsExtensions +{ + public static Contrib.Dispatcher.IntegrationEvents.Options.IntegrationEventOptions UseTestPub( + this Contrib.Dispatcher.IntegrationEvents.Options.IntegrationEventOptions dispatcherOptions) + { + dispatcherOptions.Services.TryAddSingleton(); + return dispatcherOptions; + } +} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/RecordEventMiddleware.cs b/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/RecordEventMiddleware.cs new file mode 100644 index 000000000..60b045561 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/RecordEventMiddleware.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure.Middleware; + +public class RecordEventMiddleware : EventMiddleware + where TEvent : IEvent +{ + public static int Time { get; set; } + + public override bool SupportRecursive => false; + + public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) + { + Time++; + await next(); + } +} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/ValidatorEventMiddleware.cs b/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/ValidatorEventMiddleware.cs new file mode 100644 index 000000000..f9a9b75a7 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/ValidatorEventMiddleware.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure.Middleware; + +public class ValidatorEventMiddleware : EventMiddleware + where TEvent : notnull, IEvent +{ + private readonly IEnumerable> _validators; + + public ValidatorEventMiddleware(IEnumerable> validators) + { + _validators = validators; + } + + public override async Task HandleAsync(TEvent action, EventHandlerDelegate next) + { + var failures = _validators + .Select(v => v.Validate(action)) + .SelectMany(result => result.Errors) + .Where(error => error != null) + .ToList(); + + if (failures.Any()) + { + throw new ValidationException(failures.Select(x=>x.ErrorMessage).FirstOrDefault()); + } + + await next(); + } +} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/UserRepository.cs b/test/Masa.Framework.EventApiTest/Infrastructure/UserRepository.cs new file mode 100644 index 000000000..da7d18ef1 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Infrastructure/UserRepository.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + + +namespace Masa.Framework.EventApiTest.Infrastructure +{ + public class UserRepository : Masa.Contrib.Ddd.Domain.Repository.EFCore.Repository, Masa.Framework.EventApiTest.Domain.IUserRepository + { + public UserRepository(CustomDbContext context, IUnitOfWork unitOfWork) : base(context, unitOfWork) + { + } + } +} diff --git a/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.csproj b/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.csproj new file mode 100644 index 000000000..93aceeafe --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.csproj @@ -0,0 +1,38 @@ + + + + net8.0 + enable + enable + true + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + diff --git a/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.http b/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.http new file mode 100644 index 000000000..fcf285ea5 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.http @@ -0,0 +1,6 @@ +@Masa.Framework.EventApiTest_HostAddress = http://localhost:5021 + +GET {{Masa.Framework.EventApiTest_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/test/Masa.Framework.EventApiTest/Program.cs b/test/Masa.Framework.EventApiTest/Program.cs new file mode 100644 index 000000000..e67c8ff82 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Program.cs @@ -0,0 +1,55 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using FluentValidation.AspNetCore; +using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + +var builder = WebApplication.CreateBuilder(args); + +if (builder.Environment.IsDevelopment()) +{ + builder.Services.AddDaprStarter(builder.Configuration.GetSection("DaprStarter")); +} + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); +builder.Services.AddFluentValidation(options => +{ + options.RegisterValidatorsFromAssemblyContaining(); +}); +builder.Services.AddDomainEventBus(dispatcherOptions => +{ + dispatcherOptions + .UseIntegrationEventBus(option => option.UseDapr().UseEventLog())// + .UseEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(RecordEventMiddleware<>)).UseMiddleware(typeof(ValidatorEventMiddleware<>))) + .UseUoW(optionBuilder => + { + optionBuilder.UseSqlite($"data source=disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90").UseFilter(); + //optionBuilder.UseSqlite($"data source=disabled-soft-delete-db-{Guid.NewGuid()}").UseFilter(); + }) + .UseRepository(); +}); +//var dbContext = builder.Services.BuildServiceProvider().GetRequiredService(); +//dbContext.Database.EnsureCreated(); +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/test/Masa.Framework.EventApiTest/Properties/launchSettings.json b/test/Masa.Framework.EventApiTest/Properties/launchSettings.json new file mode 100644 index 000000000..4fb629230 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:33162", + "sslPort": 44300 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5021", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7269;http://localhost:5021", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/test/Masa.Framework.EventApiTest/WeatherForecast.cs b/test/Masa.Framework.EventApiTest/WeatherForecast.cs new file mode 100644 index 000000000..fb578f4a5 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/WeatherForecast.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Framework.EventApiTest +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/test/Masa.Framework.EventApiTest/_Imports.cs b/test/Masa.Framework.EventApiTest/_Imports.cs new file mode 100644 index 000000000..f7d877b0b --- /dev/null +++ b/test/Masa.Framework.EventApiTest/_Imports.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using FluentValidation; +global using FluentValidation.AspNetCore; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.BuildingBlocks.ReadWriteSplitting.Cqrs.Queries; +global using Masa.Contrib.Dispatcher.Events; +global using Masa.Contrib.Dispatcher.IntegrationEvents; +global using Masa.Framework.IntegrationTests.EventBus.Application.Command; +global using Masa.Framework.IntegrationTests.EventBus.Application.Events; +global using Masa.Framework.IntegrationTests.EventBus.Application.Queries; +global using Masa.Framework.IntegrationTests.EventBus.Domain.Aggregate; +global using Masa.Framework.IntegrationTests.EventBus.Infrastructure; +global using Masa.Framework.IntegrationTests.EventBus.Infrastructure.Extensions; +global using Masa.Framework.IntegrationTests.EventBus.Infrastructure.Middleware; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System.Collections.Concurrent; diff --git a/test/Masa.Framework.EventApiTest/appsettings.Development.json b/test/Masa.Framework.EventApiTest/appsettings.Development.json new file mode 100644 index 000000000..a49f171a3 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/appsettings.Development.json @@ -0,0 +1,17 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + }, + "DaprStarter": { + "AppId": "loncloud-apis-aftersales", + "AppPort": 18900, + "MetricsPort": 18901, + "DaprGrpcPort": 18902, + "DaprHttpPort": 18903, + "CreateNoWindow": true, + "ExtendedParameter": " -placement-host-address localhost:6050 -components-path %USERPROFILE%\\.dapr\\components -log-level debug" + } + } +} diff --git a/test/Masa.Framework.EventApiTest/appsettings.json b/test/Masa.Framework.EventApiTest/appsettings.json new file mode 100644 index 000000000..10f68b8c8 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90 b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90 new file mode 100644 index 0000000000000000000000000000000000000000..15a78fed6648e6baa773a2774fcd3586163a833e GIT binary patch literal 32768 zcmeI&O>7%Q6bEqI`EZ(Kcaw_97X&MV)DLyg&d%=4ju5Cbv$Hg6nv}#r?EzV)aid7B z(IBL{9soI&E)BX71z+YqPP=9cPNa$2c4tpU#|ch)1C8?`r9KJ|i! zwdRbhc|Qd|&i>01BW03Y;8)2d_1ot+!bH!HuoKM*sfe zweH%mH|%#iTethWYyH8nd&Rw691Q!LJH6r7_P~AwpDt~0PMKA!IyPKf&h53ZeN@YK zxUvjK54UfJXWQku+84t1ip7oYd;OhVkQp(^$wP(wugx=y*~>bU)$MzGX90~@#+t2#h5Bc& z4tpQm>aXwicieM)?_3?Fmu%Q}AAzwq9m1o%xX}(f_F5-gUV-QO(o$$vme)F~YH_&} zwy$39K8jymUA&@JuZNfI^$U9~mwPY+2ixu+Qk!rDIdrUu`Mr9x#aR8zg>ob#07rb(I5^G`iRT#h$krni_NQVr zM0vFH@tyuNupX`TLtOioPp*I?BW9=n`Z5; zH`wjna9;?Ame&4|o?5d9%YY?f8MO)t6d+r-|?&N&!Vx=g6 z0w{n2D1ZVefC4Ch0w{n2D1ZXbFEH(z;Qjye!(j^)Kmim$0Te(16hHwKKmim$0Tehv z0`Bks^WICf;P>GB;FI8L@Vfud|IPo-ANrU4m%V?zU%hXp?wJT4`z`qH~^;BsP+0s|7KXCXr%>a%1S}^K&k1(^T6ck4RDE zDM<>I6B&zy&^Wi6DW<68kPTdxQZ2Nw8L_#cBvGj(iWQOwsZ*U5hM6+!msy!eYO;*P zMZrjtrwXdEDG^c3q=cZ>IrQtfY!X{)3M&Zb&>%?^BUwfxs3s|5s<UIzl;xr@S_+;(cE)8@%;UH)oJ5*QsKIEWBWp;ZGLeehN(tScK0ocU zI+q5R7Nh#nI?(M3zFqRfI}8VMJl9K&TPtM zGo=z)umlp&TOuM(R1qnX3zel&oN6sy4NaHj(m;K=BxxK8$l8Qxs-WID=3JyPbYmeq zS@xSUWu%)6$stQKPNZZhp-?(kf<}obAUol*G-q)^sUbR3FmKF)S)MCk(UD+4$c^iF z++{6QG&aJ3DoDZFu_R*()&om8G-q5U&UegZnG&o>fR@J=<`@bhGAlUYLcq#1I*XW_ zw}#8+Sz>i;QX=y-CP~H$B25t!l_fb-N?2i2$ktspVwUGBh4lbOVctXr4#1KtZ8ZE~ zX##WM{{BDjU8)6tc;9-z1WE9P_qYF7FysI1UGm@dzxFqSAAK>@>3zkZ=QT0}6#eBRL4riYBv@u&W@>&LYo_&?81b3eWG`{`c9n&qaG z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfWV&##9d!PV59Fz%hJj&V7f&2Y(K|!zF|(+gQY||WNk{4-CrF}ZXc)ZprA9JH>=Co6#7ys+z=cRX@VkXd zw~|{7SqJBxAog%&ov=|b>ogCfGzi6e@(_fefy9dJ?10&TXkycb2&!hhaDYu96pz6Q zWmAgW!xd&-%+z0rV3nX5`)VLbq<)oh&Ra!gDzW=(U8^xio<(%T%HSYIZ9!7&4!sn{ z^FHh`D~nc5$_yzW%}rNwRtl1qB)letE_2;oW~)T0Xrss~nWEjP5H!+0XyfR1?V@47 zJIreIx*1aIRHYeHLl8rA;Jl~J%P9!WbGyuJ38p5MX={sBV1jNCb5nr96piSsua?+L z%nDsyL0WT1|I*xiAP=OaV9JSpv^6vf`gA!PIQTa&FlXP~{qz0%kB{hZJKfkUFQ%WS z8`G1;Ecd6s=9kOy{M&SAzCHgif4=;>d^TU3zIq2f|Iy+wFboU>!@w{w3=9Lqz%Vcj z3S!s+_xjtpU0!Hxi7X0RtcnARRUqJt9#dvb$g275w- zqZRB(3=SFWi3<)G?8yqQtQ9+gf_(;iQi44Odm@5e27B^>9R_>Cfy*E6oFDci18)HZ C#b>_& literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b new file mode 100644 index 0000000000000000000000000000000000000000..e2a2455a104f1cf6a5d6b143f3ac8831aaaf3ab5 GIT binary patch literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYF`k83r literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-shm new file mode 100644 index 0000000000000000000000000000000000000000..d89ea7b612c778137a5e3a112ea7ee8abbdcdd16 GIT binary patch literal 32768 zcmeI)Jq`h36a`TKlnTXEI;BJcW!cHGMSi} zGyScu<65TvYQGo1*}-(T9bM{&^=7!d9VfH-d2!lT_f_@d_3>AqJihWd`98?|H=@mG zE832BqTOgdj}Rb0fB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72>hc!u1*MnG6iyPMF^BBkV`{CpiF_> z*b)L|3go(+5GYe1cNK*|nF6^eDg??Du%%n(clXu=2oNAZfB*pk1PBlyK!5-N0t5&U aAV7cs0RjXF5FkK+009C72oNCfUjk2F*d(I> literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-wal new file mode 100644 index 0000000000000000000000000000000000000000..802677ef990f9bc1019ac41ee0a0062d85de7ad7 GIT binary patch literal 32992 zcmeI*-)qxA00;0iYn#%o{s2ohlzB$Q4K~>*o0B10Ym~CC-P%k#L_*ePrLwiNjcz_T z*#vzM28xP*fbLxp#AiXoN5Llr=N|SVd)7zq(k5$dI`q-r^;L&(I6Vm*k{< z;efyQgxf2Q23?#vS>@|<^wCV!ZWu)~ZMLKivi3Z87hQrF3c2nF&5<|&I%M(n<8&zT z55sn>?Vw;yg)@YCR=KsH?}AlX>kV9%<<1?@v`D0+@7xp49cfs#&cz}{dOsG7Cetb} zEog=8?q!scRw!#3_Jz=}w5%c3tl9c*&?O@CUU53qY>7C`iaO|!*+#!;t!I1ooNw_4|U&&qtmw`yTh>eSub$QoWUDy|BeD+{pyOW?Ei1s**aKCtfkbR7Ev dtvuxz8w4N#0SG_<0uX=z1Rwwb2tc4B@Ef)s!XE$t literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164 b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164 new file mode 100644 index 0000000000000000000000000000000000000000..e2a2455a104f1cf6a5d6b143f3ac8831aaaf3ab5 GIT binary patch literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYF`k83r literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-shm new file mode 100644 index 0000000000000000000000000000000000000000..9c12c8fcc009e306a2c4a99e3a9ac8a9ba26e292 GIT binary patch literal 32768 zcmeI)KMuiQ90p+j8I2uW!NBSe28lR;$z+f)nZ#Wjz-Dm@yHl9({X!b6wcqn5Z!}G# z?bH1&?!#K7{%OCLexrli<2gDl*T?znu)0hqoAY(I*pIixpVz0qD)ahDdGdP@_iv;& zQ(LL+)J|$QHJ(QZ5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjZ7C=ja?LLg6p*jo_-c?!hRkPygI zAU3vyK%N4zE++)?6o_3#A&{p)EQ$(&JOym&=K0;dH30$y2oNAZfB*pk1PBlyK!5-N c0t5&UAV7cs0RjXF5FkK+009C72vkep4J8jIg#Z8m literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-wal new file mode 100644 index 0000000000000000000000000000000000000000..24646f79d66635494c79ddb3c258d67727382194 GIT binary patch literal 32992 zcmeI*L2J`c00;22Tbr`2%u9&}(MLS!a8qg#(J`>rC}CYP+ia|-m@V0;Z0Xi!ZZbqR zMQ@%2(Ua&!!GoSWOgssG1P>k*FAiZxabCpt(k5$dI`nAxKL~yA<-NT3e($A_N4lN9 z8QL5r)oFwn{p|J<^wYgwQ#vRb<&LX2lKndz-+P8jzV3h3x1GG#XZC)g zNdyQ$00Izz00bZa0SNp*0_%r)UKq(l)@RDLX|2jrdeJc)OV`Q^R;_5+jy}esvh7%N zRl_M)Z0Q=!%~$3Uxq_6{BqA#pq$whHswomxp=aCci{z;2wj~Y{(Ql3=#wuocwmjpu z#!iR>>(Mwb4A5SlYVBpGzVRLU=9d4v9tCtF9^-{{b0=I1+0-YkYK_VS3^LxToEG+Ln=2fKJ7m5OW}a*XMDYocaV+0or-OUs_mOGIQ@)HvBgXb@#nB$_m( z5k;lPL_SY)s#4SnSy|DDI6kV^i;oxNv23A4My1kVqo!ie8ECERoyyM9GxP$|C8^+F zIN39Bq&qGQry`s?S+%8k`e>#b%TC2jyDjNy)?Vz^N`x0OnaJIgJCXpvfUIciI0H)j z!>|Ku2Pk+`5e(s;)vhmEdtlYqdK;H#xqAn6ERw5QyZ1zJN7`0xaIsv4-jBA^VOpit zMZ-4tE~8ZqyJpO=FNC(G+0`yc`V2tWV=5P$##AOHafKmY;|2(tkDzXS7U}9o$P*7lCU|@t|AVoG{WYF`k83r literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-shm new file mode 100644 index 0000000000000000000000000000000000000000..4fb1f7b37a5cf116e51f94555178ccb09768ce94 GIT binary patch literal 32768 zcmeI)KMuiQ90p+jbu{)8jE>;|MuQ7TjAC#R7MsxpOeS#!n*&(!{X!b6wcqn5Z!}G# z?bH1&Z^K5U`RSlYztQ{Uv^o}#{bI5k&F0tb`Z=B+&YNZV=k@8Ys=R(uo%|le{adN+ z)J|$QwU^pYjpq>p1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB=Cy3dHJ!5Xe&?_Ev;Io&vEnBn0vl zh>a~Fkf%Vb%L#!z1!7lG2;?aci=sjxPXSxHd46|qO@IIa0t5&UAV7cs0RjXF5FkK+ c009C72oNAZfB*pk1PBlyK!5-N0`(Gj18PJn2><{9 literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-wal new file mode 100644 index 0000000000000000000000000000000000000000..4f180185d89be223f0c50d623718582ac2bea1f7 GIT binary patch literal 32992 zcmeI*O=#0l00;0i+nTbi>ZL>v(?>jLaSloq5fSWal(Mef+DtZ3vTV&tVN16(y6xb{ zCT>jd`I8emj&s3{oliQy25)!f zIzH1R0t6rc0SG_<0uX=z1pXg^h5dpco{ahy#tTMHpGyp@Sxd8YRVhsArL1mPYCnr6 z3`@_OnpG$o@+F#^Ean68j2u&Bl1QDFhl$jvrbN;ydbYm4L=H-JTT(ZX+~!!KznCjb z6vpk=*a<1T!21O;OnZ5>wwI0iCN$`qUHbxy_d^bEa# zd{)l57Y??E548Hl6CodGPgZGWl0KTL+C{5qr|p*12y3tH`m9e7qfy^-$R3FYphp&8 zJ5G-h|1fON+8zqdRCq(!XO;PBeH*OuTCd}BEVu4}hDGA0zI9J{ccgCBdKZfq>HTO} z4W?C|o7Rln_GJ`PGfLVx`$DK&TF#KF)@*Gz=n|26zc>b; z=ezp_eS6M-k8G}LL6%wGN?DK00bZa0SG_<0uX=z1Rwwb2sE>R{Tl%1_XS=2s@?)w5q&fE--u78`v`vR^HA`pN81Rwwb2tWV= z5P$##AOL}87VxvdIqwU+T)S~^=0n$O>7U}9o$P*7lCU|@t|AVoG{WYF`k83r literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-shm new file mode 100644 index 0000000000000000000000000000000000000000..72efec16601872db90a3c5faa87e917db81e45e2 GIT binary patch literal 32768 zcmeI)Jx)SF6b8_XzUL28Ku6*lNKD)Vt;=vXmNxEyk`34r5*n9aX9=YZ+-ro`T9P?m zax=-~W!}tLz&HJzMddPQ5HTL*dXw|9eSKLzJv@J{AHQQY+3fm7_x?7&pZ@dvJnAQP z?*31Hw@*v{J1%nS9$ikKbCq+QQ};RU9oO6v0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5;&vlpn= z2_ev?K=rK%fi?xIX-EjPDbU4j+_m|1uWnwTk6~0Joe*eGpn4UBK$`;9C@KWn6sRs; yAwYlt0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjZhTi^gPN+<0A literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-wal new file mode 100644 index 0000000000000000000000000000000000000000..d8ecf9a7e77f88119264024dec914a3f5eb2b324 GIT binary patch literal 49472 zcmeI*Z)h839Ki9*wM}ZbkXbB|g6$EJwPTT9F6keKuuFR#VO=`YbZcM5*xYJxO==p~ z`9ezP3&BBOif^kg^xbfRf*>ful)(^(ieo}iQP>M#2nr$&e4cA_ZS18~d@&ln4@q

E2D_FXfAeZ++Q)>+kF%3+p1ww=@5(&fo8T z^}~t5sb?mNRa?7It}NuMnjvbds&Z1(L|Iil+hv`t)FxhAYdhlAdA}X|UYn}&pMH)P^1dEb9QA($aoCWzpEqvsR9;iy5e|TRUXVizDIs@TLEUw2=wZXJnmlyM;!ro=Fm3(O_KPNvB zcAZ+aA?-M4>$@RN5li)lXN^Xuh{vqtbdSsy@j+YrZZE&*yXytthNE|S?l1lkl$o1L z337{s00IagfB*srAbjF}Nga85vAb%#^D2q1s}0tg_000IagfB*u`EZ~=etHldEd-a=*58gj{ zj&*@%o^r;900IagfB*srAbh3%E`6u6>kH1j)NZxnQ7y4Qe4-x_hAbEd26w_fx*>Ju+Uv7y3>S z4-x_hAb7U}9o$P*7lCU|@t|AVoG{WYF`k83r literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-shm new file mode 100644 index 0000000000000000000000000000000000000000..79ca4236c00b68cb4c6e015be2a66e907485b40d GIT binary patch literal 32768 zcmeI)yNLo}6a`@48XC^p!<1kH=7ODAfQAN!rVC=eWf+;733gxwdasIXYC8XS;4m=E zgZU;u)wOPA+OLjBam>y)$G_cTySn_|PSsDnK1}NAdB2=hUtS-NdM2NF|Cjga&mrI6 ziFTvCXg@lL4x@Rm5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXFG*KW|Cxk$m0=c&$1j-c1r6D0u zra*3N34t;Na$QaclqrzAib9}Ffm{?70%Z!=(k=79`)UFN2oNAZfB*pk1PBlyK!5-N d0t5&UAV7cs0RjXF5FkK+009C72oPwNzyl%WCZzxX literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-wal new file mode 100644 index 0000000000000000000000000000000000000000..bb199cf20331ab243a1b7342aaa4e4543cf4a410 GIT binary patch literal 32992 zcmeI*O=#0l00;0i+mhL>%uDI?;2!aygH0SoM8uC;gA420*=DW-A!KVd3tKYVY~2u% zZHkB=co~Sd!S1q)9>k-fh`nQkW2l{VseA?Lgvc2|WmZyRLFD$MFO ziPG9U&z&cPmgVWu&gxV`8~to`6ZF%$URByJ%5%q3H$z?DIkDpu7kbgP*|{Bh)S2tp zqDce@KmY;|fB*y_009X6KLX2#MKN+F8d#ppn>k}q$!Zx}w+&6r&l<&yVcOa-iz=pV zOc!)JZ<+D}%}rR-?eVl6Q)QwgFUnaWHL59*RFa;puP>3KlGB#dMF*FYC5JQRU(ZHY31T0X=ON;9w$TccwePvQl~ReTh~1mo2F;z1>{R| z+PiQl*n6Z^h@1`wIA^ko*JtRXnWoR%mXmf`(gs+2ZL6h#7>Py$cf-y|d;op2_}X#$ zl=z2X`_}eRaHql_!a1uh%^7=OmDhS5mutCu2Q(}aFBrS`gnvisR;_=rxJBv*&zo zzhG*8rswSa_t6l`EN>;S7y<+!009U<00Izz00bZa0SG_<0?jGF_6WRvft{DzTL%Z< z%0ZTieF3I`009U<00Izz00bZa0SG_<0uX3s0p~XW?(Yk3Ed7`-Y3bv5U!a+%9Akq3 z1Rwwb2tWV=5P$##AOHafcmnM219p`1C^%`vRU1A`pN81Rwwb2tWV=5P$##AOL}87GVFEpxxaU*nIb3boFue3HAk= cdCD<12tWV=5P$##AOHafKmY;|fIwN`H({C13jhEB literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde new file mode 100644 index 0000000000000000000000000000000000000000..e2a2455a104f1cf6a5d6b143f3ac8831aaaf3ab5 GIT binary patch literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYF`k83r literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde-shm new file mode 100644 index 0000000000000000000000000000000000000000..252241dfd6638fc2abe2ea95a3cd538055a53890 GIT binary patch literal 32768 zcmeI)y9vTz7zI$@TAD8C3JQ+k29Dt#4qzVyD|fK55er*qa0M$X{XZ44watGnTmm5v za?;=OI&DOn?+yp)7~OA+^QIc#j-$z;y3FQ_`|7k@?~3xz>(irNiDy23@;UuI#QR&R z?bJ?cH?^1APmOzp009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkLHjsmedAq4Uih`kjdkf%T_4GDof z1!7}M2;?ac>vBRMPl4D~6ask)#GAO zx}CZutZ=}GN>Qq7t{cN@q^wYXtRoX4ebA8Drf9EewY(LHUH#;{vw)}TH zvhAN~5&;4bfB*y_009U<00RGy!17U1lm^4TLA# zV|mk zxv5;nYK@(cgUh@iNmX~*CUrs2rZ&CP~8cOB9_%I8O0KnaT%mg z*O5Q!?An=1S!R+dEL2*d8r@Bz6bSfMj+pw@8DqR;6xq>SX-kcqiz`HCS=89yMre>@ zS(&KHgh~=gdW^^8B$`a5)l?*wP>DP?qLqt}rDCIz)Fc^ECVMJ16FQxN+Pe0s$TU4e zFQ5!7Dd)oew&1a5K{^xgan@v&uFcR#Gfkg23s%}{NgH78wcK9tiBdT1TMbwvaRGG6 z;%mq0QsN(m?ONMK!JZ0t2Ao}L#kS{wcVggMBxQ#GTdm1xXg++;F8%yzi91e zd-j~~>=%4}Gyb^mz7U}9o$P*7lCU|@t|AVoG{WYF`k83r literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-shm new file mode 100644 index 0000000000000000000000000000000000000000..289388e0209ec1aeeccda5d7d0e577c7b2c0545d GIT binary patch literal 32768 zcmeI*JxT*%5C-5cnrPx*)>MJCf*{z5jVG}55IIH)?_uF>Jb@k{moQzNS&Y~UHesF@ zUUpfQzBpT-RJB3!~Bo$$4B+a z&)xpY_v4>Se0MvD<~fGZQS>N!934k@&+@(9{Uq*BqNmZbXr5aL5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjZ}Nnp_Lj@YLYJ1c?z63BfkLZGHVZW6cqwB1#*|J5U43|QFCll69|DR1p;LSy0ViSoWLal0%ZmA-)DpX f0RjXF5FkK+009C72oNAZfB*pk1PBlyP($Dgl#n9S literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-wal new file mode 100644 index 0000000000000000000000000000000000000000..17766cb14c3a7a05da7ce6a19a82ce9c52980dfc GIT binary patch literal 74192 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 Lt#LXZCB6RxW!oTH literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770 b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770 new file mode 100644 index 0000000000000000000000000000000000000000..e2a2455a104f1cf6a5d6b143f3ac8831aaaf3ab5 GIT binary patch literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYF`k83r literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-shm new file mode 100644 index 0000000000000000000000000000000000000000..c100219648cd4aa092bf2952aa466c6caa5b41f0 GIT binary patch literal 32768 zcmeI)Ep9?V6b8^K|Ii8)c@EW}5G(@A8d_J`wV+r_bxl{}56bqZwDkPxU-pi_qBvCgM^b@c+>GAh|fCj{yf$X-PuP^UmPiVA@`1+q(5 y2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB=E}7B~Y%ye6dp literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-wal new file mode 100644 index 0000000000000000000000000000000000000000..a86385fb9b404207a36a4dec88497522dc39c187 GIT binary patch literal 49472 zcmeI*L2TPp0DxgTZR4(6lxe7h1KW(Dbe$SRnl^1fh{cIJg|%r(6VxJ52#r@VwMmzT zZ6G1Ea@cL+1{}D9IBcA_?!XQ^Ok4mVAsFITpn?Nv)5L-I+{SIFQx$QT8vRdkVn4s< z_ulvHNPc>8M&I?XD&e0WQIx}q4E@Dh-&@+3KVH9Hdgk;i$tOgVx;_4dfu*%`*@x_z z7bnVfTR&T^Efwo}ROI&glvBDc()z^GE%R)KF7esf*btx2@wRPyt@@Owrrrqz?u4SvbX)WsJq~BYOJSySu(n68# zm2fE1rNT>gZAHjYh^amN|S8$;$|sA<5-6l>g`omkJpQ@FWUJPyC#>; z&9ZU{bHdUM86}JZJ-P@+x@71%Yc{86ro@t;n9!3`nVDQRkCBl&bTJ(1V9D!OfhRqUeF5<|;G}|+`heD$(ydj*uxwn?>U9dLJ^&MOd z%dIP*Ws+pg-nu5dE3)IP^-h+oitDjbZ_%yRrR8F!w0oLdtyozp&dV=^9j8{KN!!lZ z=4yyj#Paz=bJ13(h)1s!A|8<);)}L%Z!hoj-SL9Q`bIza=C}B%fQ;N2N|0*=1Q0*~ z0R#|0009ILKmY**5NJ;UIY!`)3%soM{eIY*27ii}$r)>xzfB*srAboG;)Dej?@zh&KWP2q1s} z0tg_000IagfB*srJWzp?J~;Gux6I*iYAhNL565ETVKW*T4X3PFEDc M)8K$_uk!`|0k_R3zW@LL literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.IntegrationTests.EventBus/Infrastructure/Extensions/DefaultPublisher.cs b/test/Masa.Framework.IntegrationTests.EventBus/Infrastructure/Extensions/DefaultPublisher.cs index 10a12c2a5..c56c62e72 100644 --- a/test/Masa.Framework.IntegrationTests.EventBus/Infrastructure/Extensions/DefaultPublisher.cs +++ b/test/Masa.Framework.IntegrationTests.EventBus/Infrastructure/Extensions/DefaultPublisher.cs @@ -1,10 +1,16 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. + namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure.Extensions; public class DefaultPublisher : IPublisher { + public Task BulkPublishAsync(string topicName, List<(T @event, IntegrationEventExpand? eventMessageExpand)> events, CancellationToken stoppingToken = default) + { + return Task.CompletedTask; + } + public Task PublishAsync(string topicName, T @event, IntegrationEventExpand? eventMessageExpand, CancellationToken stoppingToken = default) { return Task.CompletedTask; From ebd7617108e83a42798476a3f82b959d92276688 Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Tue, 7 May 2024 15:18:11 +0800 Subject: [PATCH 06/15] feat:test bulkevent --- .../DefaultMasaDbContext.cs | 27 ++- .../Publisher.cs | 15 +- .../Internal/LocalQueueProcessor.cs | 28 +++ .../Options/IntegrationEventOptions.cs | 5 + .../Processor/RetryByDataProcessor.cs | 77 +++++++- .../Processor/RetryByLocalQueueProcessor.cs | 69 ++++++- .../Processor/SendByDataProcessor.cs | 67 +++---- .../Events/AddGoodsIntegrationEvent.cs | 21 ++- .../Application/Events/RegisterUserEvent.cs | 1 + .../Application/UserHandler.cs | 26 +++ .../IntegrationEventLogController.cs | 175 ++++++++++++++++++ .../Controllers/UserController.cs | 75 ++++++++ .../Controllers/WeatherForecastController.cs | 76 -------- .../Domain/Aggregate/User.cs | 3 +- test/Masa.Framework.EventApiTest/Program.cs | 17 +- .../dapr-components/pubsub.yaml | 17 ++ .../dapr-components/statestore.yaml | 17 ++ ...te-db-030e2f29-3398-493e-831a-0df85d3cba90 | Bin 32768 -> 32768 bytes ...b-030e2f29-3398-493e-831a-0df85d3cba90-shm | Bin 32768 -> 0 bytes ...b-030e2f29-3398-493e-831a-0df85d3cba90-wal | Bin 8272 -> 0 bytes ...te-db-3c5ac305-031e-4528-b266-8dda3033996b | Bin 4096 -> 0 bytes ...b-3c5ac305-031e-4528-b266-8dda3033996b-shm | Bin 32768 -> 0 bytes ...b-3c5ac305-031e-4528-b266-8dda3033996b-wal | Bin 32992 -> 0 bytes ...te-db-771923ba-dbfc-4e66-a48e-3e3b88dab164 | Bin 4096 -> 0 bytes ...b-771923ba-dbfc-4e66-a48e-3e3b88dab164-shm | Bin 32768 -> 0 bytes ...b-771923ba-dbfc-4e66-a48e-3e3b88dab164-wal | Bin 32992 -> 0 bytes ...te-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a | Bin 4096 -> 0 bytes ...b-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-shm | Bin 32768 -> 0 bytes ...b-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-wal | Bin 32992 -> 0 bytes ...te-db-984c0369-48ed-42be-a99c-72107b56f152 | Bin 4096 -> 0 bytes ...b-984c0369-48ed-42be-a99c-72107b56f152-shm | Bin 32768 -> 0 bytes ...b-984c0369-48ed-42be-a99c-72107b56f152-wal | Bin 49472 -> 0 bytes ...te-db-9ce2678b-23f0-45c2-a462-5cc133563f99 | Bin 4096 -> 0 bytes ...b-9ce2678b-23f0-45c2-a462-5cc133563f99-shm | Bin 32768 -> 0 bytes ...b-9ce2678b-23f0-45c2-a462-5cc133563f99-wal | Bin 32992 -> 0 bytes ...te-db-c06366dc-86f3-432f-88df-e4113c9a1cde | Bin 4096 -> 0 bytes ...b-c06366dc-86f3-432f-88df-e4113c9a1cde-shm | Bin 32768 -> 0 bytes ...b-c06366dc-86f3-432f-88df-e4113c9a1cde-wal | Bin 32992 -> 0 bytes ...te-db-f2690ef2-e66f-48c1-a860-de70296ad11c | Bin 4096 -> 0 bytes ...b-f2690ef2-e66f-48c1-a860-de70296ad11c-shm | Bin 32768 -> 0 bytes ...b-f2690ef2-e66f-48c1-a860-de70296ad11c-wal | Bin 74192 -> 0 bytes ...te-db-f2f00a26-ada5-4daf-87e6-25f27eaea770 | Bin 4096 -> 0 bytes ...b-f2f00a26-ada5-4daf-87e6-25f27eaea770-shm | Bin 32768 -> 0 bytes ...b-f2f00a26-ada5-4daf-87e6-25f27eaea770-wal | Bin 49472 -> 0 bytes 44 files changed, 579 insertions(+), 137 deletions(-) create mode 100644 test/Masa.Framework.EventApiTest/Controllers/IntegrationEventLogController.cs create mode 100644 test/Masa.Framework.EventApiTest/Controllers/UserController.cs delete mode 100644 test/Masa.Framework.EventApiTest/Controllers/WeatherForecastController.cs create mode 100644 test/Masa.Framework.EventApiTest/dapr-components/pubsub.yaml create mode 100644 test/Masa.Framework.EventApiTest/dapr-components/statestore.yaml delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-wal delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-wal delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164 delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-wal delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-wal delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152 delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-wal delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99 delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-wal delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde-wal delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-wal delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770 delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-wal diff --git a/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultMasaDbContext.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultMasaDbContext.cs index 36ca630c8..c8d8a066b 100644 --- a/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultMasaDbContext.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultMasaDbContext.cs @@ -47,6 +47,20 @@ public IConcurrencyStampProvider? ConcurrencyStampProvider } } + protected virtual Dictionary ChangeEventTypes + { + get + { + var eventTypes = new Dictionary + { + {EntityState.Added,typeof(EntityCreatedDomainEvent<>)}, + {EntityState.Modified,typeof(EntityModifiedDomainEvent<>)}, + {EntityState.Deleted,typeof(EntityDeletedDomainEvent<>)} + }; + return eventTypes; + } + } + private IMultiEnvironmentContext? EnvironmentContext => Options?.ServiceProvider?.GetService(); protected IMultiTenantContext? TenantContext => Options?.ServiceProvider?.GetService(); @@ -280,21 +294,14 @@ protected virtual Task PublishEntityChangedEventAsync(ChangeTracker changeTracke if (!domainEntities.Any()) return Task.CompletedTask; - var eventTypes = new Dictionary - { - {EntityState.Added,typeof(EntityCreatedDomainEvent<>)}, - {EntityState.Modified,typeof(EntityModifiedDomainEvent<>)}, - {EntityState.Deleted,typeof(EntityDeletedDomainEvent<>)} - }; - domainEntities.ForEach(item => { var entityType = item.Entity.GetType(); var eventType = item.State switch { - EntityState.Added => eventTypes[EntityState.Added].MakeGenericType(entityType), - EntityState.Modified => eventTypes[EntityState.Modified].MakeGenericType(entityType), - EntityState.Deleted => eventTypes[EntityState.Deleted].MakeGenericType(entityType), + EntityState.Added => ChangeEventTypes[EntityState.Added].MakeGenericType(entityType), + EntityState.Modified => ChangeEventTypes[EntityState.Modified].MakeGenericType(entityType), + EntityState.Deleted => ChangeEventTypes[EntityState.Deleted].MakeGenericType(entityType), _ => null, }; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs index b66eaa941..6dcc290a8 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs @@ -72,7 +72,6 @@ public async Task BulkPublishAsync( string topicName, List<(T @event, IntegrationEventExpand? eventMessageExpand)> @events, CancellationToken stoppingToken = default) { - _logger?.LogDebug("-----BulkPublishEvent Integration event publishing is in progress from {AppId} with DaprAppId as '{DaprAppId}'", _appId, _daprAppId); @@ -81,7 +80,7 @@ public async Task BulkPublishAsync( MasaArgumentException.ThrowIfNullOrWhiteSpace(_daprAppId); - var masaCloudEvents = new List>(); + var waitMasaCloudEvents = new List>(); var waitEvents = new List(); @events.ForEach(item => @@ -94,7 +93,7 @@ public async Task BulkPublishAsync( Source = new Uri(_daprAppId, UriKind.RelativeOrAbsolute) }; - masaCloudEvents.Add(masaCloudEvent); + waitMasaCloudEvents.Add(masaCloudEvent); } else { @@ -102,19 +101,19 @@ public async Task BulkPublishAsync( } }); - if (masaCloudEvents.Any()) + if (waitMasaCloudEvents.Any()) { - await DaprClient.PublishEventAsync(_pubSubName, topicName, masaCloudEvents, stoppingToken); + await DaprClient.BulkPublishEventAsync(_pubSubName, topicName, waitMasaCloudEvents, cancellationToken: stoppingToken); _logger?.LogDebug( - "-----BulkPublishEvent Publishing integration event from {AppId} succeeded with DaprAppId is {DaprAppId} and Event is {Event}", + "-----BulkPublishEvent MasaCloudEvent Publishing integration event from {AppId} succeeded with DaprAppId is {DaprAppId} and Event is {Event}", _appId, _daprAppId, - masaCloudEvents); + waitMasaCloudEvents); } if (waitEvents.Any()) { - await DaprClient.BulkPublishEventAsync(_pubSubName, topicName, @events.ToList(), cancellationToken: stoppingToken); + await DaprClient.BulkPublishEventAsync(_pubSubName, topicName, waitEvents, cancellationToken: stoppingToken); _logger?.LogDebug( "-----BulkPublishEvent Publishing integration event from {AppId} succeeded with DaprAppId is {DaprAppId} and Event is {Event}", _appId, diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs index 299032cc6..c6572605c 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs @@ -28,6 +28,9 @@ public void BulkAddJobs(List items) public void RemoveJobs(Guid eventId) => _retryEventLogs.TryRemove(eventId, out _); + public void BulkRemoveJobs(IEnumerable eventIds) + => eventIds.ToList().ForEach(eventId => _retryEventLogs.TryRemove(eventId, out _)); + public void RetryJobs(Guid eventId) { if (_retryEventLogs.TryGetValue(eventId, out IntegrationEventLogItem? item)) @@ -36,9 +39,34 @@ public void RetryJobs(Guid eventId) } } + public void BulkRetryJobs(IEnumerable eventIds) + { + foreach (var eventId in eventIds) + { + if (_retryEventLogs.TryGetValue(eventId, out IntegrationEventLogItem? item)) + { + item.Retry(); + } + } + } + public bool IsExist(Guid eventId) => _retryEventLogs.ContainsKey(eventId); + public List IsExist(IEnumerable eventIds) + { + var notEventIds = new List(); + foreach (var eventId in eventIds) + { + if (_retryEventLogs.ContainsKey(eventId)) + { + notEventIds.Add(eventId); + } + } + + return notEventIds; + } + public void Delete(int maxRetryTimes) { var eventLogItems = _retryEventLogs.Values.Where(log => log.RetryCount >= maxRetryTimes - 1).ToList(); diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Options/IntegrationEventOptions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Options/IntegrationEventOptions.cs index ccc93ea68..fbe5bcc63 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Options/IntegrationEventOptions.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Options/IntegrationEventOptions.cs @@ -10,6 +10,11 @@ public class IntegrationEventOptions : IIntegrationEventOptions public Assembly[] Assemblies { get; } + ///

+ /// Send in batches according to Topic + /// + public bool BatchesGroupSendOrRetry { get; set; } = false; + private int _localRetryTimes = 3; /// diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs index fdecae742..6c7408b08 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs @@ -24,6 +24,12 @@ public RetryByDataProcessor( protected override async Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) { + if (_options.Value.BatchesGroupSendOrRetry) + { + await this.BulkExecuteAsync(serviceProvider, stoppingToken); + return; + } + var unitOfWork = serviceProvider.GetService(); if (unitOfWork != null) unitOfWork.UseTransaction = false; @@ -36,7 +42,7 @@ await eventLogService.RetrieveEventLogsFailedToPublishAsync( _options.Value.MinimumRetryInterval, stoppingToken); - if(!retrieveEventLogs.Any()) + if (!retrieveEventLogs.Any()) return; var publisher = serviceProvider.GetRequiredService(); @@ -54,7 +60,7 @@ await eventLogService.RetrieveEventLogsFailedToPublishAsync( eventLog, eventLog.Topic); - await publisher.PublishAsync(eventLog.Topic, eventLog.Event, eventLog.EventExpand, stoppingToken); + await publisher.PublishAsync(eventLog.Topic, eventLog.Event, eventLog.EventExpand, stoppingToken); LocalQueueProcessor.Default.RemoveJobs(eventLog.EventId); @@ -73,4 +79,71 @@ await eventLogService.RetrieveEventLogsFailedToPublishAsync( } } } + + protected async Task BulkExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) + { + var unitOfWork = serviceProvider.GetService(); + if (unitOfWork != null) + unitOfWork.UseTransaction = false; + var eventLogService = serviceProvider.GetRequiredService(); + + var retrieveEventLogs = + await eventLogService.RetrieveEventLogsFailedToPublishAsync( + _options.Value.RetryBatchSize, + _options.Value.MaxRetryTimes, + _options.Value.MinimumRetryInterval, + stoppingToken); + + if (!retrieveEventLogs.Any()) + return; + + var publisher = serviceProvider.GetRequiredService(); + var retrieveEventLogsGroupByTopic = retrieveEventLogs.GroupBy(eventLog => eventLog.Topic) + .Select(eventLog => new + { + TopicName = eventLog.Key, + Events = eventLog.Select(log => new { log.Event, log.EventExpand, log.EventId }).ToList(), + }).ToList(); + var allEventIds = retrieveEventLogsGroupByTopic. + SelectMany(eventLog => eventLog.Events.Select(item => item.EventId)); + var removeEventIds = LocalQueueProcessor.Default.IsExist(allEventIds); + + foreach (var eventLog in retrieveEventLogsGroupByTopic) + { + eventLog.Events.RemoveAll(item => removeEventIds.Contains(item.EventId)); + + var eventIds = eventLog.Events.Select(item => item.EventId); + var events = eventLog.Events.Select(item => (item.Event, item.EventExpand)).ToList(); + + try + { + if (!eventIds.Any()) + continue; // The local queue is retrying, no need to retry + + await eventLogService.BulkMarkEventAsInProgressAsync(eventIds, _options.Value.MinimumRetryInterval, stoppingToken); + + _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", + eventLog, + eventLog.TopicName); + + await publisher.BulkPublishAsync(eventLog.TopicName, events, stoppingToken); + + LocalQueueProcessor.Default.BulkRemoveJobs(eventIds); + + await eventLogService.BulkMarkEventAsPublishedAsync(eventIds, stoppingToken); + } + catch (UserFriendlyException) + { + //Update state due to multitasking contention, no processing required + } + catch (Exception ex) + { + _logger?.LogError(ex, + "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", + eventIds, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); + await eventLogService.BulkMarkEventAsFailedAsync(eventIds, stoppingToken); + } + } + } + } diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs index d934cfb5c..51b301502 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs @@ -24,6 +24,12 @@ public RetryByLocalQueueProcessor( protected override async Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) { + if (_options.Value.BatchesGroupSendOrRetry) + { + await this.BulkExecuteAsync(serviceProvider, stoppingToken); + return; + } + var unitOfWork = serviceProvider.GetService(); if (unitOfWork != null) unitOfWork.UseTransaction = false; @@ -34,7 +40,7 @@ protected override async Task ExecuteAsync(IServiceProvider serviceProvider, Can LocalQueueProcessor.Default.RetrieveEventLogsFailedToPublishAsync(_options.Value.LocalRetryTimes, _options.Value.RetryBatchSize); - if(!retrieveEventLogs.Any()) + if (!retrieveEventLogs.Any()) return; var publisher = serviceProvider.GetRequiredService(); @@ -52,7 +58,7 @@ protected override async Task ExecuteAsync(IServiceProvider serviceProvider, Can eventLog, eventLog.Topic); - await publisher.PublishAsync(eventLog.Topic, eventLog.Event, eventLog.EventExpand, stoppingToken); + await publisher.PublishAsync(eventLog.Topic, eventLog.Event, eventLog.EventExpand, stoppingToken); await eventLogService.MarkEventAsPublishedAsync(eventLog.EventId, stoppingToken); @@ -72,4 +78,63 @@ protected override async Task ExecuteAsync(IServiceProvider serviceProvider, Can } } } + + protected async Task BulkExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) + { + var unitOfWork = serviceProvider.GetService(); + if (unitOfWork != null) + unitOfWork.UseTransaction = false; + + var eventLogService = serviceProvider.GetRequiredService(); + + var retrieveEventLogs = + LocalQueueProcessor.Default.RetrieveEventLogsFailedToPublishAsync(_options.Value.LocalRetryTimes, + _options.Value.RetryBatchSize); + + if (!retrieveEventLogs.Any()) + return; + + var publisher = serviceProvider.GetRequiredService(); + var retrieveEventLogsGroupByTopic = retrieveEventLogs.GroupBy(eventLog => eventLog.Topic) + .Select(eventLog => new + { + TopicName = eventLog.Key, + Events = eventLog.Select(log => new { log.Event, log.EventExpand, log.EventId }).ToList(), + }).ToList(); + + foreach (var eventLog in retrieveEventLogsGroupByTopic) + { + var eventIds = eventLog.Events.Select(item => item.EventId); + var events = eventLog.Events.Select(item => (item.Event, item.EventExpand)).ToList(); + + try + { + LocalQueueProcessor.Default.BulkRemoveJobs(eventIds); + + await eventLogService.BulkMarkEventAsInProgressAsync(eventIds, _options.Value.MinimumRetryInterval, stoppingToken); + + _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", + eventLog, + eventLog.TopicName); + + await publisher.BulkPublishAsync(eventLog.TopicName, events, stoppingToken); + + await eventLogService.BulkMarkEventAsPublishedAsync(eventIds, stoppingToken); + + LocalQueueProcessor.Default.BulkRemoveJobs(eventIds); + } + catch (UserFriendlyException) + { + //Update state due to multitasking contention + LocalQueueProcessor.Default.BulkRemoveJobs(eventIds); + } + catch (Exception ex) + { + _logger?.LogError(ex, + "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", + eventIds, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); + await eventLogService.BulkMarkEventAsFailedAsync(eventIds, stoppingToken); + } + } + } } diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs index 38f653c5b..6d07f1463 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs @@ -24,6 +24,12 @@ public SendByDataProcessor( protected override async Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) { + if (_options.Value.BatchesGroupSendOrRetry) + { + await this.BulkExecuteAsync(serviceProvider, stoppingToken); + return; + } + var unitOfWork = serviceProvider.GetService(); if (unitOfWork != null) unitOfWork.UseTransaction = false; @@ -39,29 +45,20 @@ await eventLogService.RetrieveEventLogsPendingToPublishAsync( return; var publisher = serviceProvider.GetRequiredService(); - var retrieveEventLogsGroupByTopic = retrieveEventLogs.GroupBy(eventLog => eventLog.Topic) - .Select(eventLog => new - { - TopicName = eventLog.Key, - Events = eventLog.Select(log => new { log.Event, log.EventExpand, log.EventId }).ToList(), - }).ToList(); - foreach (var eventLog in retrieveEventLogsGroupByTopic) + foreach (var eventLog in retrieveEventLogs) { - var eventIds = eventLog.Events.Select(item => item.EventId); - var events = eventLog.Events.Select(item => (item.Event, item.EventExpand)).ToList(); - try { - await eventLogService.BulkMarkEventAsInProgressAsync(eventIds, _options.Value.MinimumRetryInterval, stoppingToken); + await eventLogService.MarkEventAsInProgressAsync(eventLog.EventId, _options.Value.MinimumRetryInterval, stoppingToken); _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", eventLog, - eventLog.TopicName); + eventLog.Topic); - await publisher.BulkPublishAsync(eventLog.TopicName, events, stoppingToken); + await publisher.PublishAsync(eventLog.Topic, eventLog.Event, eventLog.EventExpand, stoppingToken); - await eventLogService.BulkMarkEventAsPublishedAsync(eventIds, stoppingToken); + await eventLogService.MarkEventAsPublishedAsync(eventLog.EventId, stoppingToken); } catch (UserFriendlyException) { @@ -71,19 +68,16 @@ await eventLogService.RetrieveEventLogsPendingToPublishAsync( { _logger?.LogError(ex, "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", - eventIds, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); - await eventLogService.BulkMarkEventAsFailedAsync(eventIds, stoppingToken); - - var integrationEventLogItem = eventLog.Events.Select(item => - new IntegrationEventLogItem(item.EventId, eventLog.TopicName, item.Event, item.EventExpand)).ToList(); + eventLog.EventId, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); + await eventLogService.MarkEventAsFailedAsync(eventLog.EventId, stoppingToken); - LocalQueueProcessor.Default.BulkAddJobs(integrationEventLogItem); + LocalQueueProcessor.Default.AddJobs(new IntegrationEventLogItem(eventLog.EventId, eventLog.Topic, eventLog.Event, + eventLog.EventExpand)); } } } - [Obsolete] - private async Task ExecuteByObsoleteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) + protected async Task BulkExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) { var unitOfWork = serviceProvider.GetService(); if (unitOfWork != null) @@ -100,20 +94,29 @@ await eventLogService.RetrieveEventLogsPendingToPublishAsync( return; var publisher = serviceProvider.GetRequiredService(); + var retrieveEventLogsGroupByTopic = retrieveEventLogs.GroupBy(eventLog => eventLog.Topic) + .Select(eventLog => new + { + TopicName = eventLog.Key, + Events = eventLog.Select(log => new { log.Event, log.EventExpand, log.EventId }).ToList(), + }).ToList(); - foreach (var eventLog in retrieveEventLogs) + foreach (var eventLog in retrieveEventLogsGroupByTopic) { + var eventIds = eventLog.Events.Select(item => item.EventId); + var events = eventLog.Events.Select(item => (item.Event, item.EventExpand)).ToList(); + try { - await eventLogService.MarkEventAsInProgressAsync(eventLog.EventId, _options.Value.MinimumRetryInterval, stoppingToken); + await eventLogService.BulkMarkEventAsInProgressAsync(eventIds, _options.Value.MinimumRetryInterval, stoppingToken); _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", eventLog, - eventLog.Topic); + eventLog.TopicName); - await publisher.PublishAsync(eventLog.Topic, eventLog.Event, eventLog.EventExpand, stoppingToken); + await publisher.BulkPublishAsync(eventLog.TopicName, events, stoppingToken); - await eventLogService.MarkEventAsPublishedAsync(eventLog.EventId, stoppingToken); + await eventLogService.BulkMarkEventAsPublishedAsync(eventIds, stoppingToken); } catch (UserFriendlyException) { @@ -123,11 +126,13 @@ await eventLogService.RetrieveEventLogsPendingToPublishAsync( { _logger?.LogError(ex, "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", - eventLog.EventId, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); - await eventLogService.MarkEventAsFailedAsync(eventLog.EventId, stoppingToken); + eventIds, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); + await eventLogService.BulkMarkEventAsFailedAsync(eventIds, stoppingToken); - LocalQueueProcessor.Default.AddJobs(new IntegrationEventLogItem(eventLog.EventId, eventLog.Topic, eventLog.Event, - eventLog.EventExpand)); + var integrationEventLogItem = eventLog.Events.Select(item => + new IntegrationEventLogItem(item.EventId, eventLog.TopicName, item.Event, item.EventExpand)).ToList(); + + LocalQueueProcessor.Default.BulkAddJobs(integrationEventLogItem); } } } diff --git a/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs b/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs index b52043035..231a2c7e3 100644 --- a/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs +++ b/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs @@ -1,4 +1,4 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.Framework.IntegrationTests.EventBus.Application.Events; @@ -15,3 +15,22 @@ public record AddGoodsIntegrationEvent : IntegrationEvent public override string Topic { get; set; } = nameof(AddGoodsIntegrationEvent); } + +public record class TestBaseEventLocal : IntegrationEvent +{ + public TestBaseEventLocal() + { + } + + public TestBaseEventLocal(long index) + { + Index = index; + } + + public long Index { get; set; } + + /// + /// Topic + /// + public override string Topic { get; set; } = nameof(TestBaseEventLocal); +} diff --git a/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs b/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs index febb72e6a..ff56b7db8 100644 --- a/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs +++ b/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs @@ -11,6 +11,7 @@ public record RegisterUserEvent : Event public int Age { get; set; } } + public record RegisterUserDomainEvent : DomainCommand { public string Name { get; set; } diff --git a/test/Masa.Framework.EventApiTest/Application/UserHandler.cs b/test/Masa.Framework.EventApiTest/Application/UserHandler.cs index 4195bb848..b781927b8 100644 --- a/test/Masa.Framework.EventApiTest/Application/UserHandler.cs +++ b/test/Masa.Framework.EventApiTest/Application/UserHandler.cs @@ -68,6 +68,20 @@ public async Task UserExistAsync(CheckUserQuery query) [EventHandler] public async Task UserEntityCreatedEventAsync(EntityCreatedDomainEvent command) { + await Console.Out.WriteLineAsync($"run【{nameof(UserEntityCreatedEventAsync)}】"); + + var userEntity = command.Entity; + if (userEntity is null) + { + throw new Exception($"User 【{nameof(UserEntityCreatedEventAsync)}】 already exists"); + } + } + + [EventHandler] + public async Task UserEntityModifiedAsync(EntityModifiedDomainEvent command) + { + await Console.Out.WriteLineAsync($"run【{nameof(UserEntityModifiedAsync)}】"); + var userEntity = command.Entity; if (userEntity is null) { @@ -75,6 +89,18 @@ public async Task UserEntityCreatedEventAsync(EntityCreatedDomainEvent com } } + [EventHandler] + public async Task UserEntityDeleteAsync(EntityDeletedDomainEvent command) + { + await Console.Out.WriteLineAsync($"run【{nameof(UserEntityDeleteAsync)}】"); + + var userEntity = command.Entity; + if (userEntity is null) + { + throw new Exception($"User 【{nameof(UserEntityDeleteAsync)}】 already exists"); + } + } + [EventHandler] public async Task RegisterUserDomainEvent(RegisterUserDomainEvent command) { diff --git a/test/Masa.Framework.EventApiTest/Controllers/IntegrationEventLogController.cs b/test/Masa.Framework.EventApiTest/Controllers/IntegrationEventLogController.cs new file mode 100644 index 000000000..d830f8ebf --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Controllers/IntegrationEventLogController.cs @@ -0,0 +1,175 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Dapr; +using Dapr.AspNetCore; +using Dapr.Client; +using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; +using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; + +namespace Masa.Framework.EventApiTest.Controllers +{ + [ApiController] + [Route("[controller]/[action]")] + public class IntegrationEventLogController : ControllerBase + { + private readonly ILogger _logger; + private readonly IEventBus eventBus; + private readonly CustomDbContext dbContext; + private readonly IUnitOfWork unitOfWork; + private readonly Masa.Framework.EventApiTest.Domain.IUserRepository userRepository; + private readonly IIntegrationEventBus integrationEventBus; + private readonly DaprClient DaprClient; + + public IntegrationEventLogController(ILogger logger, IEventBus eventBus, CustomDbContext customDbContext, + IUnitOfWork unitOfWork, Domain.IUserRepository userRepository, IIntegrationEventBus integrationEventBus, DaprClient daprClient) + { + _logger = logger; + this.eventBus = eventBus; + this.dbContext = customDbContext; + this.unitOfWork = unitOfWork; + this.userRepository = userRepository; + this.integrationEventBus = integrationEventBus; + this.DaprClient = daprClient; + } + + [HttpPost("/createOrder")] + public async Task CreateOrderAsync() + { + var order = new + { + orderId = "123456", + productId = "67890", + amount = 2 + }; + + await DaprClient.PublishEventAsync("pubsub", "newOrder", order); + return new JsonResult(order); + } + + [HttpPost("/bulk_createOrder")] + public async Task BulkCreateOrder2() + { + using var client = new DaprClientBuilder().Build(); + var events = new List() + { + new + { + orderId = "123456", + productId = "67890", + amount = 1 + },new{ + orderId = "123456", + productId = "67890", + amount = 2 + } + }; + + var res = await client.BulkPublishEventAsync("pubsub", "newOrder", events); + if (res == null) + { + throw new Exception("null response from dapr"); + } + + if (res.FailedEntries.Count > 0) + { + Console.WriteLine("Some events failed to be published!"); + foreach (var failedEntry in res.FailedEntries) + { + Console.WriteLine("EntryId: " + failedEntry.Entry.EntryId + " Error message: " + + failedEntry.ErrorMessage); + } + } + else + { + Console.WriteLine("Published all events!"); + } + + return new JsonResult(events); + } + + //[Dapr.AspNetCore.BulkSubscribe("newOrder", 10, 10)] + [Topic("pubsub", "newOrder")] + [HttpPost("/createOrderHandler")] + public async Task CreateOrderHandler(object data) + { + return Content(JsonConvert.SerializeObject(data)); + } + + [HttpGet] + public async Task AddUser() + { + var user = new User + { + Age = 18, + Name = 1.ToString() + }; + user.RegisterUserDomainEvent(); + + await userRepository.AddAsync(user); + await unitOfWork.SaveChangesAsync(); + await unitOfWork.CommitAsync(); + var count = await userRepository.GetCountAsync(); + await Console.Out.WriteLineAsync(count.ToString()); + return count; + } + + [HttpGet] + public async Task AddAsync() + { + var logs = new List(); + + logs.Add(new IntegrationEventLog(new TestBaseEventLocal(1), Guid.Parse("D98F4EA8-8EDE-48BA-A767-2863614AE34C"))); + logs.Add(new IntegrationEventLog(new TestBaseEventLocal(2), Guid.Parse("D98F4EA8-8EDE-48BA-A767-2863614AE34C"))); + await dbContext.Set().AddRangeAsync(logs); + dbContext.SaveChanges(); + var count = await dbContext.Set().CountAsync(); + + return count; + } + + [HttpGet] + public async Task UpdateStateAsync(IntegrationEventStates state = IntegrationEventStates.NotPublished) + { + var logs = await dbContext.Set().ToListAsync(); + + foreach (var item in logs) + { + item.State = state; + } + + dbContext.Set().UpdateRange(logs); + dbContext.SaveChanges(); + return logs.Count; + } + + [HttpGet] + public async Task> GetListAsync() + { + return await dbContext.Set().ToListAsync(); + } + + [HttpGet] + public async Task PublishAsync(long idnex = 1) + { + await integrationEventBus.PublishAsync(new TestBaseEventLocal(idnex)); + return idnex; + } + + [HttpPost] + [Topic("pubsub", nameof(AddGoodsIntegrationEvent))] + public async Task AddGoodsIntegrationEventHandlerAsync(AddGoodsIntegrationEvent integrationEvent) + { + await Console.Out.WriteLineAsync(JsonConvert.SerializeObject(integrationEvent)); + } + + [HttpPost] + [Topic("pubsub", nameof(TestBaseEventLocal))] + public async Task TestBaseEventLocalHandlerAsync(TestBaseEventLocal integrationEvent) + { + await Console.Out.WriteLineAsync(integrationEvent.Index.ToString()); + } + } +} diff --git a/test/Masa.Framework.EventApiTest/Controllers/UserController.cs b/test/Masa.Framework.EventApiTest/Controllers/UserController.cs new file mode 100644 index 000000000..ef2d91014 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/Controllers/UserController.cs @@ -0,0 +1,75 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Dapr; +using Dapr.AspNetCore; +using Dapr.Client; +using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; +using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; + +namespace Masa.Framework.EventApiTest.Controllers +{ + [ApiController] + [Route("[controller]/[action]")] + public class UserController : ControllerBase + { + private readonly ILogger _logger; + private readonly IEventBus eventBus; + private readonly CustomDbContext dbContext; + private readonly IUnitOfWork unitOfWork; + private readonly Masa.Framework.EventApiTest.Domain.IUserRepository userRepository; + private readonly IIntegrationEventBus integrationEventBus; + private readonly DaprClient DaprClient; + + public UserController(ILogger logger, IEventBus eventBus, CustomDbContext customDbContext, + IUnitOfWork unitOfWork, Domain.IUserRepository userRepository, IIntegrationEventBus integrationEventBus, DaprClient daprClient) + { + _logger = logger; + this.eventBus = eventBus; + this.dbContext = customDbContext; + this.unitOfWork = unitOfWork; + this.userRepository = userRepository; + this.integrationEventBus = integrationEventBus; + this.DaprClient = daprClient; + } + + [HttpPost] + public async Task EntityCreatedDomainEventAsync() + { + var user = new User + { + Age = 18, + Name = 1.ToString(), + }; + + await userRepository.AddAsync(user); + await unitOfWork.SaveChangesAsync(); + await unitOfWork.CommitAsync(); + return user; + } + + [HttpPut] + public async Task EntityModifiedDomainEventAsync() + { + var user = await userRepository.FindAsync(item => item.Id != Guid.Empty); + user.Age++; + await userRepository.UpdateAsync(user); + await unitOfWork.SaveChangesAsync(); + await unitOfWork.CommitAsync(); + return user; + } + + [HttpDelete] + public async Task EntityDeletedDomainEventAsync() + { + var user = await userRepository.FindAsync(item => item.Id != Guid.Empty); + + await userRepository.RemoveAsync(user); + await unitOfWork.SaveChangesAsync(); + await unitOfWork.CommitAsync(); + return await userRepository.GetCountAsync(); + } + } +} diff --git a/test/Masa.Framework.EventApiTest/Controllers/WeatherForecastController.cs b/test/Masa.Framework.EventApiTest/Controllers/WeatherForecastController.cs deleted file mode 100644 index 38a496009..000000000 --- a/test/Masa.Framework.EventApiTest/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Dapr; -using Microsoft.AspNetCore.Mvc; - -namespace Masa.Framework.EventApiTest.Controllers -{ - [ApiController] - [Route("[controller]/[action]")] - public class WeatherForecastController : ControllerBase - { - private readonly ILogger _logger; - private readonly IEventBus eventBus; - private readonly CustomDbContext dbContext; - private readonly IUnitOfWork unitOfWork; - private readonly Masa.Framework.EventApiTest.Domain.IUserRepository userRepository; - private readonly IIntegrationEventBus integrationEventBus; - - public WeatherForecastController(ILogger logger, IEventBus eventBus, CustomDbContext customDbContext, IUnitOfWork unitOfWork, Domain.IUserRepository userRepository, IIntegrationEventBus integrationEventBus) - { - _logger = logger; - this.eventBus = eventBus; - this.dbContext = customDbContext; - this.unitOfWork = unitOfWork; - this.userRepository = userRepository; - this.integrationEventBus = integrationEventBus; - } - - [HttpGet] - public async Task Add() - { - var user = new User - { - Age = 18, - Name = 1.ToString() - }; - //user.RegisterUserIntegrationDomainEvent(); - user.RegisterUserDomainEvent(); - - await userRepository.AddAsync(user); - await userRepository.UnitOfWork.SaveChangesAsync(); - await userRepository.UnitOfWork.CommitAsync(); - - //await dbContext.Set().AddAsync(user); - //await unitOfWork.SaveChangesAsync(); - //await unitOfWork.CommitAsync(); - var count = await userRepository.GetCountAsync(); - await Console.Out.WriteLineAsync(count.ToString()); - - return count; - } - - [HttpGet] - public async Task IntegrationEventBus() - { - await integrationEventBus.PublishAsync(new AddGoodsIntegrationEvent() - { - Name = "Apple", - Count = 1, - Id = Guid.NewGuid(), - Price = 9.9m, - }); - - return 1; - } - - [HttpPost] - [Topic("pubsub", nameof(AddGoodsIntegrationEvent))] - public async Task UnlockDeviceBindingStatusAsync(AddGoodsIntegrationEvent integrationEvent) - { - await Console.Out.WriteLineAsync("123"); - } - - } -} diff --git a/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs b/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs index 14078516e..942a0b230 100644 --- a/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs +++ b/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs @@ -18,10 +18,9 @@ public void RegisterUserIntegrationDomainEvent() { base.AddDomainEvent(new RegisterUserIntegrationDomainEvent()); } + public void RegisterUserDomainEvent() { base.AddDomainEvent(new RegisterUserDomainEvent()); } - - } diff --git a/test/Masa.Framework.EventApiTest/Program.cs b/test/Masa.Framework.EventApiTest/Program.cs index e67c8ff82..4010d9eaf 100644 --- a/test/Masa.Framework.EventApiTest/Program.cs +++ b/test/Masa.Framework.EventApiTest/Program.cs @@ -10,12 +10,12 @@ if (builder.Environment.IsDevelopment()) { - builder.Services.AddDaprStarter(builder.Configuration.GetSection("DaprStarter")); + builder.Services.AddDaprStarter();//builder.Configuration.GetSection("DaprStarter") } // Add services to the container. -builder.Services.AddControllers(); +builder.Services.AddControllers().AddDapr(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); @@ -26,7 +26,11 @@ builder.Services.AddDomainEventBus(dispatcherOptions => { dispatcherOptions - .UseIntegrationEventBus(option => option.UseDapr().UseEventLog())// + .UseIntegrationEventBus(option => + { + option.BatchesGroupSendOrRetry = true; + option.UseDapr();//.UseEventLog() + })// .UseEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(RecordEventMiddleware<>)).UseMiddleware(typeof(ValidatorEventMiddleware<>))) .UseUoW(optionBuilder => { @@ -35,8 +39,8 @@ }) .UseRepository(); }); -//var dbContext = builder.Services.BuildServiceProvider().GetRequiredService(); -//dbContext.Database.EnsureCreated(); +var dbContext = builder.Services.BuildServiceProvider().GetRequiredService(); +dbContext.Database.EnsureCreated(); var app = builder.Build(); // Configure the HTTP request pipeline. @@ -46,6 +50,9 @@ app.UseSwaggerUI(); } +app.UseCloudEvents(); +app.MapControllers(); +app.MapSubscribeHandler(); app.UseHttpsRedirection(); app.UseAuthorization(); diff --git a/test/Masa.Framework.EventApiTest/dapr-components/pubsub.yaml b/test/Masa.Framework.EventApiTest/dapr-components/pubsub.yaml new file mode 100644 index 000000000..229d5a0c9 --- /dev/null +++ b/test/Masa.Framework.EventApiTest/dapr-components/pubsub.yaml @@ -0,0 +1,17 @@ +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: pubsub + namespace: NAMESPACE +spec: + metadata: + - name: redisHost + value: 10.130.0.19:4208 + - name: redisPassword + value: Hzss@123 + - name: redisDB + value: '3' + - name: maxLenApprox + value: '100000' + type: pubsub.redis + version: v1 \ No newline at end of file diff --git a/test/Masa.Framework.EventApiTest/dapr-components/statestore.yaml b/test/Masa.Framework.EventApiTest/dapr-components/statestore.yaml new file mode 100644 index 000000000..e27cc47ee --- /dev/null +++ b/test/Masa.Framework.EventApiTest/dapr-components/statestore.yaml @@ -0,0 +1,17 @@ +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: statestore + namespace: NAMESPACE +spec: + metadata: + - name: redisHost + value: 10.130.0.19:4208 + - name: redisPassword + value: Hzss@123 + - name: actorStateStore + value: true + - name: redisDB + value: 3 + type: state.redis + version: v1 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90 b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90 index 15a78fed6648e6baa773a2774fcd3586163a833e..8cd4ce6d6718afad1a3fc55f81fe4977a2e2e0eb 100644 GIT binary patch literal 32768 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 literal 32768 zcmeI&O>7%Q6bEqI`EZ(Kcaw_97X&MV)DLyg&d%=4ju5Cbv$Hg6nv}#r?EzV)aid7B z(IBL{9soI&E)BX71z+YqPP=9cPNa$2c4tpU#|ch)1C8?`r9KJ|i! zwdRbhc|Qd|&i>01BW03Y;8)2d_1ot+!bH!HuoKM*sfe zweH%mH|%#iTethWYyH8nd&Rw691Q!LJH6r7_P~AwpDt~0PMKA!IyPKf&h53ZeN@YK zxUvjK54UfJXWQku+84t1ip7oYd;OhVkQp(^$wP(wugx=y*~>bU)$MzGX90~@#+t2#h5Bc& z4tpQm>aXwicieM)?_3?Fmu%Q}AAzwq9m1o%xX}(f_F5-gUV-QO(o$$vme)F~YH_&} zwy$39K8jymUA&@JuZNfI^$U9~mwPY+2ixu+Qk!rDIdrUu`Mr9x#aR8zg>ob#07rb(I5^G`iRT#h$krni_NQVr zM0vFH@tyuNupX`TLtOioPp*I?BW9=n`Z5; zH`wjna9;?Ame&4|o?5d9%YY?f8MO)t6d+r-|?&N&!Vx=g6 z0w{n2D1ZVefC4Ch0w{n2D1ZXbFEH(z;Qjye!(j^)Kmim$0Te(16hHwKKmim$0Tehv z0`Bks^WICf;P>GB;FI8L@Vfud|IPo-ANrU4m%V?zU%hXp?wJT4`z`qH~^;BsP+0s|7KXCXr%>a%1S}^K&k1(^T6ck4RDE zDM<>I6B&zy&^Wi6DW<68kPTdxQZ2Nw8L_#cBvGj(iWQOwsZ*U5hM6+!msy!eYO;*P zMZrjtrwXdEDG^c3q=cZ>IrQtfY!X{)3M&Zb&>%?^BUwfxs3s|5s<UIzl;xr@S_+;(cE)8@%;UH)oJ5*QsKIEWBWp;ZGLeehN(tScK0ocU zI+q5R7Nh#nI?(M3zFqRfI}8VMJl9K&TPtM zGo=z)umlp&TOuM(R1qnX3zel&oN6sy4NaHj(m;K=BxxK8$l8Qxs-WID=3JyPbYmeq zS@xSUWu%)6$stQKPNZZhp-?(kf<}obAUol*G-q)^sUbR3FmKF)S)MCk(UD+4$c^iF z++{6QG&aJ3DoDZFu_R*()&om8G-q5U&UegZnG&o>fR@J=<`@bhGAlUYLcq#1I*XW_ zw}#8+Sz>i;QX=y-CP~H$B25t!l_fb-N?2i2$ktspVwUGBh4lbOVctXr4#1KtZ8ZE~ zX##WM{{BDjU8)6tc;9-z1WE9P_qYF7FysI1UGm@dzxFqSAAK>@>3zkZ=QT0}6#eBRL4riYBv@u&W@>&LYo_&?81b3eWG`{`c9n&qaG z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfWV&##9d!PV59Fz%hJj&V7f&2Y(K|!zF|(+gQY||WNk{4-CrF}ZXc)ZprA9JH>=Co6#7ys+z=cRX@VkXd zw~|{7SqJBxAog%&ov=|b>ogCfGzi6e@(_fefy9dJ?10&TXkycb2&!hhaDYu96pz6Q zWmAgW!xd&-%+z0rV3nX5`)VLbq<)oh&Ra!gDzW=(U8^xio<(%T%HSYIZ9!7&4!sn{ z^FHh`D~nc5$_yzW%}rNwRtl1qB)letE_2;oW~)T0Xrss~nWEjP5H!+0XyfR1?V@47 zJIreIx*1aIRHYeHLl8rA;Jl~J%P9!WbGyuJ38p5MX={sBV1jNCb5nr96piSsua?+L z%nDsyL0WT1|I*xiAP=OaV9JSpv^6vf`gA!PIQTa&FlXP~{qz0%kB{hZJKfkUFQ%WS z8`G1;Ecd6s=9kOy{M&SAzCHgif4=;>d^TU3zIq2f|Iy+wFboU>!@w{w3=9Lqz%Vcj z3S!s+_xjtpU0!Hxi7X0RtcnARRUqJt9#dvb$g275w- zqZRB(3=SFWi3<)G?8yqQtQ9+gf_(;iQi44Odm@5e27B^>9R_>Cfy*E6oFDci18)HZ C#b>_& diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b deleted file mode 100644 index e2a2455a104f1cf6a5d6b143f3ac8831aaaf3ab5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYF`k83r diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-shm deleted file mode 100644 index d89ea7b612c778137a5e3a112ea7ee8abbdcdd16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)Jq`h36a`TKlnTXEI;BJcW!cHGMSi} zGyScu<65TvYQGo1*}-(T9bM{&^=7!d9VfH-d2!lT_f_@d_3>AqJihWd`98?|H=@mG zE832BqTOgdj}Rb0fB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72>hc!u1*MnG6iyPMF^BBkV`{CpiF_> z*b)L|3go(+5GYe1cNK*|nF6^eDg??Du%%n(clXu=2oNAZfB*pk1PBlyK!5-N0t5&U aAV7cs0RjXF5FkK+009C72oNCfUjk2F*d(I> diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-3c5ac305-031e-4528-b266-8dda3033996b-wal deleted file mode 100644 index 802677ef990f9bc1019ac41ee0a0062d85de7ad7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32992 zcmeI*-)qxA00;0iYn#%o{s2ohlzB$Q4K~>*o0B10Ym~CC-P%k#L_*ePrLwiNjcz_T z*#vzM28xP*fbLxp#AiXoN5Llr=N|SVd)7zq(k5$dI`q-r^;L&(I6Vm*k{< z;efyQgxf2Q23?#vS>@|<^wCV!ZWu)~ZMLKivi3Z87hQrF3c2nF&5<|&I%M(n<8&zT z55sn>?Vw;yg)@YCR=KsH?}AlX>kV9%<<1?@v`D0+@7xp49cfs#&cz}{dOsG7Cetb} zEog=8?q!scRw!#3_Jz=}w5%c3tl9c*&?O@CUU53qY>7C`iaO|!*+#!;t!I1ooNw_4|U&&qtmw`yTh>eSub$QoWUDy|BeD+{pyOW?Ei1s**aKCtfkbR7Ev dtvuxz8w4N#0SG_<0uX=z1Rwwb2tc4B@Ef)s!XE$t diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164 b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164 deleted file mode 100644 index e2a2455a104f1cf6a5d6b143f3ac8831aaaf3ab5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYF`k83r diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-shm deleted file mode 100644 index 9c12c8fcc009e306a2c4a99e3a9ac8a9ba26e292..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)KMuiQ90p+j8I2uW!NBSe28lR;$z+f)nZ#Wjz-Dm@yHl9({X!b6wcqn5Z!}G# z?bH1&?!#K7{%OCLexrli<2gDl*T?znu)0hqoAY(I*pIixpVz0qD)ahDdGdP@_iv;& zQ(LL+)J|$QHJ(QZ5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjZ7C=ja?LLg6p*jo_-c?!hRkPygI zAU3vyK%N4zE++)?6o_3#A&{p)EQ$(&JOym&=K0;dH30$y2oNAZfB*pk1PBlyK!5-N c0t5&UAV7cs0RjXF5FkK+009C72vkep4J8jIg#Z8m diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-771923ba-dbfc-4e66-a48e-3e3b88dab164-wal deleted file mode 100644 index 24646f79d66635494c79ddb3c258d67727382194..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32992 zcmeI*L2J`c00;22Tbr`2%u9&}(MLS!a8qg#(J`>rC}CYP+ia|-m@V0;Z0Xi!ZZbqR zMQ@%2(Ua&!!GoSWOgssG1P>k*FAiZxabCpt(k5$dI`nAxKL~yA<-NT3e($A_N4lN9 z8QL5r)oFwn{p|J<^wYgwQ#vRb<&LX2lKndz-+P8jzV3h3x1GG#XZC)g zNdyQ$00Izz00bZa0SNp*0_%r)UKq(l)@RDLX|2jrdeJc)OV`Q^R;_5+jy}esvh7%N zRl_M)Z0Q=!%~$3Uxq_6{BqA#pq$whHswomxp=aCci{z;2wj~Y{(Ql3=#wuocwmjpu z#!iR>>(Mwb4A5SlYVBpGzVRLU=9d4v9tCtF9^-{{b0=I1+0-YkYK_VS3^LxToEG+Ln=2fKJ7m5OW}a*XMDYocaV+0or-OUs_mOGIQ@)HvBgXb@#nB$_m( z5k;lPL_SY)s#4SnSy|DDI6kV^i;oxNv23A4My1kVqo!ie8ECERoyyM9GxP$|C8^+F zIN39Bq&qGQry`s?S+%8k`e>#b%TC2jyDjNy)?Vz^N`x0OnaJIgJCXpvfUIciI0H)j z!>|Ku2Pk+`5e(s;)vhmEdtlYqdK;H#xqAn6ERw5QyZ1zJN7`0xaIsv4-jBA^VOpit zMZ-4tE~8ZqyJpO=FNC(G+0`yc`V2tWV=5P$##AOHafKmY;|2(tkDzXS7U}9o$P*7lCU|@t|AVoG{WYF`k83r diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-shm deleted file mode 100644 index 4fb1f7b37a5cf116e51f94555178ccb09768ce94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)KMuiQ90p+jbu{)8jE>;|MuQ7TjAC#R7MsxpOeS#!n*&(!{X!b6wcqn5Z!}G# z?bH1&Z^K5U`RSlYztQ{Uv^o}#{bI5k&F0tb`Z=B+&YNZV=k@8Ys=R(uo%|le{adN+ z)J|$QwU^pYjpq>p1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB=Cy3dHJ!5Xe&?_Ev;Io&vEnBn0vl zh>a~Fkf%Vb%L#!z1!7lG2;?aci=sjxPXSxHd46|qO@IIa0t5&UAV7cs0RjXF5FkK+ c009C72oNAZfB*pk1PBlyK!5-N0`(Gj18PJn2><{9 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-8be0bdd5-e9d9-47a2-9469-2ad8cd398c5a-wal deleted file mode 100644 index 4f180185d89be223f0c50d623718582ac2bea1f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32992 zcmeI*O=#0l00;0i+nTbi>ZL>v(?>jLaSloq5fSWal(Mef+DtZ3vTV&tVN16(y6xb{ zCT>jd`I8emj&s3{oliQy25)!f zIzH1R0t6rc0SG_<0uX=z1pXg^h5dpco{ahy#tTMHpGyp@Sxd8YRVhsArL1mPYCnr6 z3`@_OnpG$o@+F#^Ean68j2u&Bl1QDFhl$jvrbN;ydbYm4L=H-JTT(ZX+~!!KznCjb z6vpk=*a<1T!21O;OnZ5>wwI0iCN$`qUHbxy_d^bEa# zd{)l57Y??E548Hl6CodGPgZGWl0KTL+C{5qr|p*12y3tH`m9e7qfy^-$R3FYphp&8 zJ5G-h|1fON+8zqdRCq(!XO;PBeH*OuTCd}BEVu4}hDGA0zI9J{ccgCBdKZfq>HTO} z4W?C|o7Rln_GJ`PGfLVx`$DK&TF#KF)@*Gz=n|26zc>b; z=ezp_eS6M-k8G}LL6%wGN?DK00bZa0SG_<0uX=z1Rwwb2sE>R{Tl%1_XS=2s@?)w5q&fE--u78`v`vR^HA`pN81Rwwb2tWV= z5P$##AOL}87VxvdIqwU+T)S~^=0n$O>7U}9o$P*7lCU|@t|AVoG{WYF`k83r diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-shm deleted file mode 100644 index 72efec16601872db90a3c5faa87e917db81e45e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)Jx)SF6b8_XzUL28Ku6*lNKD)Vt;=vXmNxEyk`34r5*n9aX9=YZ+-ro`T9P?m zax=-~W!}tLz&HJzMddPQ5HTL*dXw|9eSKLzJv@J{AHQQY+3fm7_x?7&pZ@dvJnAQP z?*31Hw@*v{J1%nS9$ikKbCq+QQ};RU9oO6v0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5;&vlpn= z2_ev?K=rK%fi?xIX-EjPDbU4j+_m|1uWnwTk6~0Joe*eGpn4UBK$`;9C@KWn6sRs; yAwYlt0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjZhTi^gPN+<0A diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-984c0369-48ed-42be-a99c-72107b56f152-wal deleted file mode 100644 index d8ecf9a7e77f88119264024dec914a3f5eb2b324..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49472 zcmeI*Z)h839Ki9*wM}ZbkXbB|g6$EJwPTT9F6keKuuFR#VO=`YbZcM5*xYJxO==p~ z`9ezP3&BBOif^kg^xbfRf*>ful)(^(ieo}iQP>M#2nr$&e4cA_ZS18~d@&ln4@q

E2D_FXfAeZ++Q)>+kF%3+p1ww=@5(&fo8T z^}~t5sb?mNRa?7It}NuMnjvbds&Z1(L|Iil+hv`t)FxhAYdhlAdA}X|UYn}&pMH)P^1dEb9QA($aoCWzpEqvsR9;iy5e|TRUXVizDIs@TLEUw2=wZXJnmlyM;!ro=Fm3(O_KPNvB zcAZ+aA?-M4>$@RN5li)lXN^Xuh{vqtbdSsy@j+YrZZE&*yXytthNE|S?l1lkl$o1L z337{s00IagfB*srAbjF}Nga85vAb%#^D2q1s}0tg_000IagfB*u`EZ~=etHldEd-a=*58gj{ zj&*@%o^r;900IagfB*srAbh3%E`6u6>kH1j)NZxnQ7y4Qe4-x_hAbEd26w_fx*>Ju+Uv7y3>S z4-x_hAb7U}9o$P*7lCU|@t|AVoG{WYF`k83r diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-shm deleted file mode 100644 index 79ca4236c00b68cb4c6e015be2a66e907485b40d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)yNLo}6a`@48XC^p!<1kH=7ODAfQAN!rVC=eWf+;733gxwdasIXYC8XS;4m=E zgZU;u)wOPA+OLjBam>y)$G_cTySn_|PSsDnK1}NAdB2=hUtS-NdM2NF|Cjga&mrI6 ziFTvCXg@lL4x@Rm5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXFG*KW|Cxk$m0=c&$1j-c1r6D0u zra*3N34t;Na$QaclqrzAib9}Ffm{?70%Z!=(k=79`)UFN2oNAZfB*pk1PBlyK!5-N d0t5&UAV7cs0RjXF5FkK+009C72oPwNzyl%WCZzxX diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-9ce2678b-23f0-45c2-a462-5cc133563f99-wal deleted file mode 100644 index bb199cf20331ab243a1b7342aaa4e4543cf4a410..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32992 zcmeI*O=#0l00;0i+mhL>%uDI?;2!aygH0SoM8uC;gA420*=DW-A!KVd3tKYVY~2u% zZHkB=co~Sd!S1q)9>k-fh`nQkW2l{VseA?Lgvc2|WmZyRLFD$MFO ziPG9U&z&cPmgVWu&gxV`8~to`6ZF%$URByJ%5%q3H$z?DIkDpu7kbgP*|{Bh)S2tp zqDce@KmY;|fB*y_009X6KLX2#MKN+F8d#ppn>k}q$!Zx}w+&6r&l<&yVcOa-iz=pV zOc!)JZ<+D}%}rR-?eVl6Q)QwgFUnaWHL59*RFa;puP>3KlGB#dMF*FYC5JQRU(ZHY31T0X=ON;9w$TccwePvQl~ReTh~1mo2F;z1>{R| z+PiQl*n6Z^h@1`wIA^ko*JtRXnWoR%mXmf`(gs+2ZL6h#7>Py$cf-y|d;op2_}X#$ zl=z2X`_}eRaHql_!a1uh%^7=OmDhS5mutCu2Q(}aFBrS`gnvisR;_=rxJBv*&zo zzhG*8rswSa_t6l`EN>;S7y<+!009U<00Izz00bZa0SG_<0?jGF_6WRvft{DzTL%Z< z%0ZTieF3I`009U<00Izz00bZa0SG_<0uX3s0p~XW?(Yk3Ed7`-Y3bv5U!a+%9Akq3 z1Rwwb2tWV=5P$##AOHafcmnM219p`1C^%`vRU1A`pN81Rwwb2tWV=5P$##AOL}87GVFEpxxaU*nIb3boFue3HAk= cdCD<12tWV=5P$##AOHafKmY;|fIwN`H({C13jhEB diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde deleted file mode 100644 index e2a2455a104f1cf6a5d6b143f3ac8831aaaf3ab5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYF`k83r diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-c06366dc-86f3-432f-88df-e4113c9a1cde-shm deleted file mode 100644 index 252241dfd6638fc2abe2ea95a3cd538055a53890..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)y9vTz7zI$@TAD8C3JQ+k29Dt#4qzVyD|fK55er*qa0M$X{XZ44watGnTmm5v za?;=OI&DOn?+yp)7~OA+^QIc#j-$z;y3FQ_`|7k@?~3xz>(irNiDy23@;UuI#QR&R z?bJ?cH?^1APmOzp009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkLHjsmedAq4Uih`kjdkf%T_4GDof z1!7}M2;?ac>vBRMPl4D~6ask)#GAO zx}CZutZ=}GN>Qq7t{cN@q^wYXtRoX4ebA8Drf9EewY(LHUH#;{vw)}TH zvhAN~5&;4bfB*y_009U<00RGy!17U1lm^4TLA# zV|mk zxv5;nYK@(cgUh@iNmX~*CUrs2rZ&CP~8cOB9_%I8O0KnaT%mg z*O5Q!?An=1S!R+dEL2*d8r@Bz6bSfMj+pw@8DqR;6xq>SX-kcqiz`HCS=89yMre>@ zS(&KHgh~=gdW^^8B$`a5)l?*wP>DP?qLqt}rDCIz)Fc^ECVMJ16FQxN+Pe0s$TU4e zFQ5!7Dd)oew&1a5K{^xgan@v&uFcR#Gfkg23s%}{NgH78wcK9tiBdT1TMbwvaRGG6 z;%mq0QsN(m?ONMK!JZ0t2Ao}L#kS{wcVggMBxQ#GTdm1xXg++;F8%yzi91e zd-j~~>=%4}Gyb^mz7U}9o$P*7lCU|@t|AVoG{WYF`k83r diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-shm deleted file mode 100644 index 289388e0209ec1aeeccda5d7d0e577c7b2c0545d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI*JxT*%5C-5cnrPx*)>MJCf*{z5jVG}55IIH)?_uF>Jb@k{moQzNS&Y~UHesF@ zUUpfQzBpT-RJB3!~Bo$$4B+a z&)xpY_v4>Se0MvD<~fGZQS>N!934k@&+@(9{Uq*BqNmZbXr5aL5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjZ}Nnp_Lj@YLYJ1c?z63BfkLZGHVZW6cqwB1#*|J5U43|QFCll69|DR1p;LSy0ViSoWLal0%ZmA-)DpX f0RjXF5FkK+009C72oNAZfB*pk1PBlyP($Dgl#n9S diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2690ef2-e66f-48c1-a860-de70296ad11c-wal deleted file mode 100644 index 17766cb14c3a7a05da7ce6a19a82ce9c52980dfc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 74192 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 Lt#LXZCB6RxW!oTH diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770 b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770 deleted file mode 100644 index e2a2455a104f1cf6a5d6b143f3ac8831aaaf3ab5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYF`k83r diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-shm deleted file mode 100644 index c100219648cd4aa092bf2952aa466c6caa5b41f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)Ep9?V6b8^K|Ii8)c@EW}5G(@A8d_J`wV+r_bxl{}56bqZwDkPxU-pi_qBvCgM^b@c+>GAh|fCj{yf$X-PuP^UmPiVA@`1+q(5 y2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB=E}7B~Y%ye6dp diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-f2f00a26-ada5-4daf-87e6-25f27eaea770-wal deleted file mode 100644 index a86385fb9b404207a36a4dec88497522dc39c187..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49472 zcmeI*L2TPp0DxgTZR4(6lxe7h1KW(Dbe$SRnl^1fh{cIJg|%r(6VxJ52#r@VwMmzT zZ6G1Ea@cL+1{}D9IBcA_?!XQ^Ok4mVAsFITpn?Nv)5L-I+{SIFQx$QT8vRdkVn4s< z_ulvHNPc>8M&I?XD&e0WQIx}q4E@Dh-&@+3KVH9Hdgk;i$tOgVx;_4dfu*%`*@x_z z7bnVfTR&T^Efwo}ROI&glvBDc()z^GE%R)KF7esf*btx2@wRPyt@@Owrrrqz?u4SvbX)WsJq~BYOJSySu(n68# zm2fE1rNT>gZAHjYh^amN|S8$;$|sA<5-6l>g`omkJpQ@FWUJPyC#>; z&9ZU{bHdUM86}JZJ-P@+x@71%Yc{86ro@t;n9!3`nVDQRkCBl&bTJ(1V9D!OfhRqUeF5<|;G}|+`heD$(ydj*uxwn?>U9dLJ^&MOd z%dIP*Ws+pg-nu5dE3)IP^-h+oitDjbZ_%yRrR8F!w0oLdtyozp&dV=^9j8{KN!!lZ z=4yyj#Paz=bJ13(h)1s!A|8<);)}L%Z!hoj-SL9Q`bIza=C}B%fQ;N2N|0*=1Q0*~ z0R#|0009ILKmY**5NJ;UIY!`)3%soM{eIY*27ii}$r)>xzfB*srAboG;)Dej?@zh&KWP2q1s} z0tg_000IagfB*srJWzp?J~;Gux6I*iYAhNL565ETVKW*T4X3PFEDc M)8K$_uk!`|0k_R3zW@LL From 0ebdc50207792a63ebb0ed944472423d944ed553 Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Tue, 7 May 2024 16:17:55 +0800 Subject: [PATCH 07/15] feat:update BulkMarkEventAsInProgress --- .../Logs/IIntegrationEventLogService.cs | 6 +-- .../IntegrationEventLogService.cs | 36 +++++++++++------- .../Processor/RetryByDataProcessor.cs | 24 +++++++++--- .../Processor/RetryByLocalQueueProcessor.cs | 8 +++- .../Processor/SendByDataProcessor.cs | 23 ++++++++--- test/Masa.Framework.EventApiTest/Program.cs | 2 +- ...b-030e2f29-3398-493e-831a-0df85d3cba90-shm | Bin 0 -> 32768 bytes ...b-030e2f29-3398-493e-831a-0df85d3cba90-wal | Bin 0 -> 98912 bytes 8 files changed, 68 insertions(+), 31 deletions(-) create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm create mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-wal diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs index e1104ceb6..9c2acaf61 100644 --- a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs @@ -37,15 +37,15 @@ Task SaveEventAsync( Task MarkEventAsPublishedAsync(Guid eventId, CancellationToken cancellationToken = default); - Task BulkMarkEventAsPublishedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default); + Task> BulkMarkEventAsPublishedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default); Task MarkEventAsInProgressAsync(Guid eventId, int minimumRetryInterval, CancellationToken cancellationToken = default); - Task BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minimumRetryInterval, CancellationToken cancellationToken = default); + Task> BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minimumRetryInterval, CancellationToken cancellationToken = default); Task MarkEventAsFailedAsync(Guid eventId, CancellationToken cancellationToken = default); - Task BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default); + Task> BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default); ///

/// Delete successfully published and expired data diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs index 867c9e966..f7773f5fd 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs @@ -106,9 +106,11 @@ public Task MarkEventAsPublishedAsync(Guid eventId, CancellationToken cancellati }, cancellationToken); } - public Task BulkMarkEventAsPublishedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) + public async Task> BulkMarkEventAsPublishedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) { - return BulkUpdateEventStatus(eventIds, IntegrationEventStates.Published, eventLogs => + var failedEventIds = new List(); + + await BulkUpdateEventStatus(eventIds, IntegrationEventStates.Published, eventLogs => { eventLogs.ForEach(eventLog => { @@ -117,12 +119,13 @@ public Task BulkMarkEventAsPublishedAsync(IEnumerable eventIds, Cancellati _logger?.LogWarning( "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", IntegrationEventStates.Published, eventLog.State, eventLog.Id); - throw new UserFriendlyException( - $"Failed to modify the state of the local message table to {IntegrationEventStates.Published}, the current State is {eventLog.State}, Id: {eventLog.Id}"); + failedEventIds.Add(eventLog.EventId); } }); }, cancellationToken); + + return failedEventIds; } public Task MarkEventAsInProgressAsync(Guid eventId, int minimumRetryInterval, CancellationToken cancellationToken = default) @@ -151,9 +154,11 @@ public Task MarkEventAsInProgressAsync(Guid eventId, int minimumRetryInterval, C }, cancellationToken); } - public Task BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minimumRetryInterval, CancellationToken cancellationToken = default) + public async Task> BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minimumRetryInterval, CancellationToken cancellationToken = default) { - return BulkUpdateEventStatus(eventIds, IntegrationEventStates.InProgress, eventLogs => + var failedEventIds = new List(); + + await BulkUpdateEventStatus(eventIds, IntegrationEventStates.InProgress, eventLogs => { eventLogs.ForEach(eventLog => { @@ -163,8 +168,7 @@ public Task BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minim _logger?.LogInformation( "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}, Multitasking execution error, waiting for the next retry", IntegrationEventStates.InProgress, eventLog.State, eventLog.Id); - throw new UserFriendlyException( - $"Failed to modify the state of the local message table to {IntegrationEventStates.InProgress}, the current State is {eventLog.State}, Id: {eventLog.Id}, Multitasking execution error, waiting for the next retry"); + failedEventIds.Add(eventLog.EventId); } if (eventLog.State != IntegrationEventStates.NotPublished && eventLog.State != IntegrationEventStates.InProgress && @@ -173,11 +177,12 @@ public Task BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minim _logger?.LogWarning( "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", IntegrationEventStates.InProgress, eventLog.State, eventLog.Id); - throw new UserFriendlyException( - $"Failed to modify the state of the local message table to {IntegrationEventStates.InProgress}, the current State is {eventLog.State}, Id: {eventLog.Id}"); + failedEventIds.Add(eventLog.EventId); } }); }, cancellationToken); + + return failedEventIds; } public Task MarkEventAsFailedAsync(Guid eventId, CancellationToken cancellationToken = default) @@ -195,9 +200,11 @@ public Task MarkEventAsFailedAsync(Guid eventId, CancellationToken cancellationT }, cancellationToken); } - public Task BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) + public async Task> BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) { - return BulkUpdateEventStatus(eventIds, IntegrationEventStates.PublishedFailed, eventLogs => + var failedEventIds = new List(); + + await BulkUpdateEventStatus(eventIds, IntegrationEventStates.PublishedFailed, eventLogs => { eventLogs.ForEach(eventLog => { @@ -206,11 +213,12 @@ public Task BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationT _logger?.LogWarning( "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", IntegrationEventStates.PublishedFailed, eventLog.State, eventLog.Id); - throw new UserFriendlyException( - $"Failed to modify the state of the local message table to {IntegrationEventStates.PublishedFailed}, the current State is {eventLog.State}, Id: {eventLog.Id}"); + failedEventIds.Add(eventLog.EventId); } }); }, cancellationToken); + + return failedEventIds; } public async Task DeleteExpiresAsync(DateTime expiresAt, int batchCount, CancellationToken token = default) diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs index 6c7408b08..18914bff4 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs @@ -112,15 +112,24 @@ await eventLogService.RetrieveEventLogsFailedToPublishAsync( { eventLog.Events.RemoveAll(item => removeEventIds.Contains(item.EventId)); - var eventIds = eventLog.Events.Select(item => item.EventId); - var events = eventLog.Events.Select(item => (item.Event, item.EventExpand)).ToList(); + var sourceEventIds = eventLog.Events.Select(item => item.EventId); + var sourceEvents = eventLog.Events; try { - if (!eventIds.Any()) + if (!sourceEventIds.Any()) continue; // The local queue is retrying, no need to retry - await eventLogService.BulkMarkEventAsInProgressAsync(eventIds, _options.Value.MinimumRetryInterval, stoppingToken); + var failedEventIds = await eventLogService.BulkMarkEventAsInProgressAsync(sourceEventIds, + _options.Value.MinimumRetryInterval, stoppingToken); + if (failedEventIds.Any()) + { + sourceEvents = sourceEvents.Where(item => !failedEventIds.Contains(item.EventId)).ToList(); + _logger?.LogDebug("Error Publishing integration event {Event} to {TopicName} failedEventIds {failedEventIds}", + eventLog, eventLog.TopicName, failedEventIds); + } + var eventIds = sourceEvents.Select(item => item.EventId); + var events = sourceEvents.Select(item => (item.Event, item.EventExpand)).ToList(); _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", eventLog, @@ -131,6 +140,9 @@ await eventLogService.RetrieveEventLogsFailedToPublishAsync( LocalQueueProcessor.Default.BulkRemoveJobs(eventIds); await eventLogService.BulkMarkEventAsPublishedAsync(eventIds, stoppingToken); + + if (failedEventIds.Any()) + await eventLogService.BulkMarkEventAsFailedAsync(failedEventIds, stoppingToken); } catch (UserFriendlyException) { @@ -140,8 +152,8 @@ await eventLogService.RetrieveEventLogsFailedToPublishAsync( { _logger?.LogError(ex, "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", - eventIds, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); - await eventLogService.BulkMarkEventAsFailedAsync(eventIds, stoppingToken); + sourceEventIds, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); + await eventLogService.BulkMarkEventAsFailedAsync(sourceEventIds, stoppingToken); } } } diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs index 51b301502..4b3ccbd28 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs @@ -111,7 +111,13 @@ protected async Task BulkExecuteAsync(IServiceProvider serviceProvider, Cancella { LocalQueueProcessor.Default.BulkRemoveJobs(eventIds); - await eventLogService.BulkMarkEventAsInProgressAsync(eventIds, _options.Value.MinimumRetryInterval, stoppingToken); + var failedEventIds = await eventLogService.BulkMarkEventAsInProgressAsync(eventIds, + _options.Value.MinimumRetryInterval, stoppingToken); + if (failedEventIds.Any()) + { + _logger?.LogDebug("Error Publishing integration event {Event} to {TopicName} failedEventIds {failedEventIds}", + eventLog, eventLog.TopicName, failedEventIds); + } _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", eventLog, diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs index 6d07f1463..415cfd6e3 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/SendByDataProcessor.cs @@ -103,20 +103,31 @@ await eventLogService.RetrieveEventLogsPendingToPublishAsync( foreach (var eventLog in retrieveEventLogsGroupByTopic) { - var eventIds = eventLog.Events.Select(item => item.EventId); - var events = eventLog.Events.Select(item => (item.Event, item.EventExpand)).ToList(); + var sourceEventIds = eventLog.Events.Select(item => item.EventId); + var sourceEvents = eventLog.Events; try { - await eventLogService.BulkMarkEventAsInProgressAsync(eventIds, _options.Value.MinimumRetryInterval, stoppingToken); + var failedEventIds = await eventLogService.BulkMarkEventAsInProgressAsync(sourceEventIds, + _options.Value.MinimumRetryInterval, stoppingToken); + if (failedEventIds.Any()) + { + sourceEvents = sourceEvents.Where(item => !failedEventIds.Contains(item.EventId)).ToList(); + _logger?.LogDebug("Error Publishing integration event {Event} to {TopicName} failedEventIds {failedEventIds}", + eventLog, eventLog.TopicName, failedEventIds); + } + var eventIds = sourceEvents.Select(item => item.EventId); + var events = sourceEvents.Select(item => (item.Event, item.EventExpand)).ToList(); _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", eventLog, eventLog.TopicName); await publisher.BulkPublishAsync(eventLog.TopicName, events, stoppingToken); - await eventLogService.BulkMarkEventAsPublishedAsync(eventIds, stoppingToken); + + if (failedEventIds.Any()) + await eventLogService.BulkMarkEventAsFailedAsync(failedEventIds, stoppingToken); } catch (UserFriendlyException) { @@ -126,8 +137,8 @@ await eventLogService.RetrieveEventLogsPendingToPublishAsync( { _logger?.LogError(ex, "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", - eventIds, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); - await eventLogService.BulkMarkEventAsFailedAsync(eventIds, stoppingToken); + sourceEventIds, _masaAppConfigureOptions?.CurrentValue.AppId ?? string.Empty, eventLog); + await eventLogService.BulkMarkEventAsFailedAsync(sourceEventIds, stoppingToken); var integrationEventLogItem = eventLog.Events.Select(item => new IntegrationEventLogItem(item.EventId, eventLog.TopicName, item.Event, item.EventExpand)).ToList(); diff --git a/test/Masa.Framework.EventApiTest/Program.cs b/test/Masa.Framework.EventApiTest/Program.cs index 4010d9eaf..a74f5f855 100644 --- a/test/Masa.Framework.EventApiTest/Program.cs +++ b/test/Masa.Framework.EventApiTest/Program.cs @@ -29,7 +29,7 @@ .UseIntegrationEventBus(option => { option.BatchesGroupSendOrRetry = true; - option.UseDapr();//.UseEventLog() + option.UseDapr().UseEventLog(); })// .UseEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(RecordEventMiddleware<>)).UseMiddleware(typeof(ValidatorEventMiddleware<>))) .UseUoW(optionBuilder => diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm new file mode 100644 index 0000000000000000000000000000000000000000..30ffe6901bf080e32c452793010ae0f6c24ac409 GIT binary patch literal 32768 zcmeI)yGjF55C-7M#Y?NvX-QPp{#WkWrmaNa(~nB8L0>mAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAkZ3tP8`J`E@K$u z*34uO0t5&UAV7cs0RjY?73k)s#k07Io49K>SQ>%W3-ofw=y_bnC?>6+)qn(=73k-7 z-HWK=Hp)g`MSuVS0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5*B GM}aS)>MNH3 literal 0 HcmV?d00001 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-wal new file mode 100644 index 0000000000000000000000000000000000000000..cadbf533f7501c0b8bf2fcf0eddf2b7e6797adf6 GIT binary patch literal 98912 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 UBH_XOwtj)b<$Kh&dk-=5|EiC~(EtDd literal 0 HcmV?d00001 From de7201ed491d607f623a1c11c8511b939c47b53f Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Wed, 8 May 2024 10:19:11 +0800 Subject: [PATCH 08/15] fix:IntegrationEvents.Tests.Infrastructure.CustomIntegrationEventLogService --- .../CustomIntegrationEventLogService.cs | 12 ++++++------ ...b-030e2f29-3398-493e-831a-0df85d3cba90-shm | Bin 32768 -> 32768 bytes 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs index c6fdfe995..7731f2965 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs @@ -48,18 +48,18 @@ public Task SaveEventAsync( return Task.CompletedTask; } - public Task BulkMarkEventAsPublishedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) + public async Task> BulkMarkEventAsPublishedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) { - return Task.CompletedTask; + return new List(); } - public Task BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minimumRetryInterval, CancellationToken cancellationToken = default) + public async Task> BulkMarkEventAsInProgressAsync(IEnumerable eventIds, int minimumRetryInterval, CancellationToken cancellationToken = default) { - return Task.CompletedTask; + return new List(); } - public Task BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) + public async Task> BulkMarkEventAsFailedAsync(IEnumerable eventIds, CancellationToken cancellationToken = default) { - return Task.CompletedTask; + return new List(); } } diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm index 30ffe6901bf080e32c452793010ae0f6c24ac409..abceb6eb3bb29c6f40282e1cd52c25ed6a6edf6b 100644 GIT binary patch delta 56 ucmZo@U}|V!;*@x#%K!!wIpqaCbB}AipSkK0vLG8oaAKSiqr}F>`g#Dqz!50` delta 56 vcmZo@U}|V!;*@x#%K!pw6FKDtr{^Bm%AK|95wai~L~vr95+lRL#`<~yxswpL From 3ac2d9bb28636fcf2e4a465241908780c69a6f93 Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Wed, 8 May 2024 10:30:42 +0800 Subject: [PATCH 09/15] fix:resolve conflicts --- .../Masa.BuildingBlocks.Exceptions/MasaException.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaException.cs b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaException.cs index d92be6057..b3bf383d5 100644 --- a/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaException.cs +++ b/src/BuildingBlocks/Exception/Masa.BuildingBlocks.Exceptions/MasaException.cs @@ -91,14 +91,6 @@ public MasaException(string errorCode, LogLevel? logLevel, params object[] param { } - public MasaException(string message, Exception? innerException, string errorCode, LogLevel? logLevel = null, params object[] parameters) - : base(message, innerException) - { - _errorCode = errorCode; - _parameters = parameters; - _logLevel = logLevel; - } - public MasaException(Exception? innerException, string errorCode, LogLevel? logLevel = null, params object[] parameters) : base(null, innerException) { From ad2e5d29397edd9e8f510bc43c48aa738d9e6901 Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Wed, 8 May 2024 11:25:46 +0800 Subject: [PATCH 10/15] feat:remove test api --- Masa.Framework.sln | 11 -- .../Command/RegisterUserCommand.cs | 11 -- .../Events/AddGoodsIntegrationEvent.cs | 36 ---- .../Application/Events/RegisterUserEvent.cs | 27 --- .../Application/Queries/CheckUserQuery.cs | 11 -- .../Queries/CheckUserQueryValidator.cs | 12 -- .../Application/Queries/UserAgeQuery.cs | 11 -- .../Queries/UserAgeQueryValidator.cs | 12 -- .../Application/UserHandler.cs | 115 ------------ .../IntegrationEventLogController.cs | 175 ------------------ .../Controllers/UserController.cs | 75 -------- .../Domain/Aggregate/User.cs | 26 --- .../Domain/IUserRepository.cs | 9 - .../Infrastructure/CustomDbContext.cs | 13 -- .../Extensions/DefaultPublisher.cs | 18 -- .../Extensions/DispatcherOptionsExtensions.cs | 14 -- .../Middleware/RecordEventMiddleware.cs | 18 -- .../Middleware/ValidatorEventMiddleware.cs | 31 ---- .../Infrastructure/UserRepository.cs | 13 -- .../Masa.Framework.EventApiTest.csproj | 38 ---- .../Masa.Framework.EventApiTest.http | 6 - test/Masa.Framework.EventApiTest/Program.cs | 62 ------- .../Properties/launchSettings.json | 41 ---- .../WeatherForecast.cs | 16 -- test/Masa.Framework.EventApiTest/_Imports.cs | 25 --- .../appsettings.Development.json | 17 -- .../appsettings.json | 9 - .../dapr-components/pubsub.yaml | 17 -- .../dapr-components/statestore.yaml | 17 -- ...te-db-030e2f29-3398-493e-831a-0df85d3cba90 | Bin 32768 -> 0 bytes ...b-030e2f29-3398-493e-831a-0df85d3cba90-shm | Bin 32768 -> 0 bytes ...b-030e2f29-3398-493e-831a-0df85d3cba90-wal | Bin 98912 -> 0 bytes 32 files changed, 886 deletions(-) delete mode 100644 test/Masa.Framework.EventApiTest/Application/Command/RegisterUserCommand.cs delete mode 100644 test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs delete mode 100644 test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs delete mode 100644 test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQuery.cs delete mode 100644 test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQueryValidator.cs delete mode 100644 test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQuery.cs delete mode 100644 test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQueryValidator.cs delete mode 100644 test/Masa.Framework.EventApiTest/Application/UserHandler.cs delete mode 100644 test/Masa.Framework.EventApiTest/Controllers/IntegrationEventLogController.cs delete mode 100644 test/Masa.Framework.EventApiTest/Controllers/UserController.cs delete mode 100644 test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs delete mode 100644 test/Masa.Framework.EventApiTest/Domain/IUserRepository.cs delete mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/CustomDbContext.cs delete mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DefaultPublisher.cs delete mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DispatcherOptionsExtensions.cs delete mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/Middleware/RecordEventMiddleware.cs delete mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/Middleware/ValidatorEventMiddleware.cs delete mode 100644 test/Masa.Framework.EventApiTest/Infrastructure/UserRepository.cs delete mode 100644 test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.csproj delete mode 100644 test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.http delete mode 100644 test/Masa.Framework.EventApiTest/Program.cs delete mode 100644 test/Masa.Framework.EventApiTest/Properties/launchSettings.json delete mode 100644 test/Masa.Framework.EventApiTest/WeatherForecast.cs delete mode 100644 test/Masa.Framework.EventApiTest/_Imports.cs delete mode 100644 test/Masa.Framework.EventApiTest/appsettings.Development.json delete mode 100644 test/Masa.Framework.EventApiTest/appsettings.json delete mode 100644 test/Masa.Framework.EventApiTest/dapr-components/pubsub.yaml delete mode 100644 test/Masa.Framework.EventApiTest/dapr-components/statestore.yaml delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90 delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm delete mode 100644 test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-wal diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 1e2c7aaff..866922a49 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -625,8 +625,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.DynamicsCrm.Core EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.DynamicsCrm.EntityFrameworkCore", "src\Utils\DynamicsCrm\Masa.Utils.DynamicsCrm.EntityFrameworkCore\Masa.Utils.DynamicsCrm.EntityFrameworkCore.csproj", "{8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Framework.EventApiTest", "test\Masa.Framework.EventApiTest\Masa.Framework.EventApiTest.csproj", "{345F5F33-8788-43F3-9005-B3EEBC007C72}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2187,14 +2185,6 @@ Global {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}.Release|Any CPU.Build.0 = Release|Any CPU {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}.Release|x64.ActiveCfg = Release|Any CPU {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC}.Release|x64.Build.0 = Release|Any CPU - {345F5F33-8788-43F3-9005-B3EEBC007C72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {345F5F33-8788-43F3-9005-B3EEBC007C72}.Debug|Any CPU.Build.0 = Debug|Any CPU - {345F5F33-8788-43F3-9005-B3EEBC007C72}.Debug|x64.ActiveCfg = Debug|Any CPU - {345F5F33-8788-43F3-9005-B3EEBC007C72}.Debug|x64.Build.0 = Debug|Any CPU - {345F5F33-8788-43F3-9005-B3EEBC007C72}.Release|Any CPU.ActiveCfg = Release|Any CPU - {345F5F33-8788-43F3-9005-B3EEBC007C72}.Release|Any CPU.Build.0 = Release|Any CPU - {345F5F33-8788-43F3-9005-B3EEBC007C72}.Release|x64.ActiveCfg = Release|Any CPU - {345F5F33-8788-43F3-9005-B3EEBC007C72}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2503,7 +2493,6 @@ Global {64B54122-44F1-4379-9422-953EF706A3A6} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} {83310F46-E1C7-4438-B32A-9F6F7EA13FCF} = {64B54122-44F1-4379-9422-953EF706A3A6} {8A51A2A9-FBF4-40DC-AD89-AD3B9D3A50DC} = {64B54122-44F1-4379-9422-953EF706A3A6} - {345F5F33-8788-43F3-9005-B3EEBC007C72} = {E747043D-81E2-4A89-8B5B-1258ED45F941} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/test/Masa.Framework.EventApiTest/Application/Command/RegisterUserCommand.cs b/test/Masa.Framework.EventApiTest/Application/Command/RegisterUserCommand.cs deleted file mode 100644 index 125728960..000000000 --- a/test/Masa.Framework.EventApiTest/Application/Command/RegisterUserCommand.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Application.Command; - -public record RegisterUserCommand : BuildingBlocks.ReadWriteSplitting.Cqrs.Commands.Command -{ - public string Name { get; set; } - - public int Age { get; set; } -} diff --git a/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs b/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs deleted file mode 100644 index 231a2c7e3..000000000 --- a/test/Masa.Framework.EventApiTest/Application/Events/AddGoodsIntegrationEvent.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Application.Events; - -public record AddGoodsIntegrationEvent : IntegrationEvent -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - public int Count { get; set; } - - public decimal Price { get; set; } - - public override string Topic { get; set; } = nameof(AddGoodsIntegrationEvent); -} - -public record class TestBaseEventLocal : IntegrationEvent -{ - public TestBaseEventLocal() - { - } - - public TestBaseEventLocal(long index) - { - Index = index; - } - - public long Index { get; set; } - - /// - /// Topic - /// - public override string Topic { get; set; } = nameof(TestBaseEventLocal); -} diff --git a/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs b/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs deleted file mode 100644 index ff56b7db8..000000000 --- a/test/Masa.Framework.EventApiTest/Application/Events/RegisterUserEvent.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.Ddd.Domain.Events; - -namespace Masa.Framework.IntegrationTests.EventBus.Application.Events; - -public record RegisterUserEvent : Event -{ - public string Name { get; set; } - - public int Age { get; set; } -} - -public record RegisterUserDomainEvent : DomainCommand -{ - public string Name { get; set; } - - public int Age { get; set; } -} - -public record RegisterUserIntegrationDomainEvent : IntegrationDomainEvent -{ - public string Name { get; set; } - - public int Age { get; set; } -} diff --git a/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQuery.cs b/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQuery.cs deleted file mode 100644 index e43964af6..000000000 --- a/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQuery.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Application.Queries; - -public record CheckUserQuery : Query -{ - public string Name { get; set; } - - public override bool Result { get; set; } -} diff --git a/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQueryValidator.cs b/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQueryValidator.cs deleted file mode 100644 index d7255d017..000000000 --- a/test/Masa.Framework.EventApiTest/Application/Queries/CheckUserQueryValidator.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Application.Queries; - -public class CheckUserQueryValidator : AbstractValidator -{ - public CheckUserQueryValidator() - { - RuleFor(u => u.Name).NotNull().WithMessage("Name is required on CheckUserQuery"); - } -} diff --git a/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQuery.cs b/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQuery.cs deleted file mode 100644 index 172807102..000000000 --- a/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQuery.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Application.Queries; - -public record UserAgeQuery : Query -{ - public string Name { get; set; } - - public override int Result { get; set; } -} diff --git a/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQueryValidator.cs b/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQueryValidator.cs deleted file mode 100644 index 6ed387503..000000000 --- a/test/Masa.Framework.EventApiTest/Application/Queries/UserAgeQueryValidator.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Application.Queries; - -public class UserAgeQueryValidator: AbstractValidator -{ - public UserAgeQueryValidator() - { - RuleFor(u => u.Name).NotNull().WithMessage("Name is required on UserAgeQuery"); - } -} diff --git a/test/Masa.Framework.EventApiTest/Application/UserHandler.cs b/test/Masa.Framework.EventApiTest/Application/UserHandler.cs deleted file mode 100644 index b781927b8..000000000 --- a/test/Masa.Framework.EventApiTest/Application/UserHandler.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.Ddd.Domain.Events; - -namespace Masa.Framework.IntegrationTests.EventBus.Application; - -public class UserHandler -{ - private readonly IEventBus _eventBus; - private readonly IRepository _repository; - private readonly IUnitOfWork _unitOfWork; - - public UserHandler(IEventBus eventBus, IRepository repository, IUnitOfWork unitOfWork) - { - _eventBus = eventBus; - _repository = repository; - _unitOfWork = unitOfWork; - } - - [EventHandler] - public async Task RegisterUserByEventAsync(RegisterUserEvent @event) - { - await _repository.AddAsync(new User() - { - Name = @event.Name, - Age = @event.Age - }); - } - - [EventHandler] - public async Task RegisterUserByCommandAsync(RegisterUserCommand command) - { - var query = new CheckUserQuery() - { - Name = command.Name - }; - await _eventBus.PublishAsync(query); - if (query.Result) - throw new Exception($"User 【{command.Name}】 already exists"); - - await _repository.AddAsync(new User() - { - Name = command.Name, - Age = command.Age - }); - } - - [EventHandler] - public async Task UserExistAsync(UserAgeQuery query) - { - var checkUserQuery = new CheckUserQuery(); //Check whether the second verification can enter normally - await Assert.ThrowsExceptionAsync(async () => await _eventBus.PublishAsync(checkUserQuery), "Name is required on CheckUserQuery"); - if (!checkUserQuery.Result) - return; - - var user = await _repository.FindAsync(u => u.Name == query.Name); - query.Result = user!.Age; - } - - [EventHandler] - public async Task UserExistAsync(CheckUserQuery query) - { - var user = await _repository.FindAsync(u => u.Name == query.Name); - query.Result = user != null; - } - - [EventHandler] - public async Task UserEntityCreatedEventAsync(EntityCreatedDomainEvent command) - { - await Console.Out.WriteLineAsync($"run【{nameof(UserEntityCreatedEventAsync)}】"); - - var userEntity = command.Entity; - if (userEntity is null) - { - throw new Exception($"User 【{nameof(UserEntityCreatedEventAsync)}】 already exists"); - } - } - - [EventHandler] - public async Task UserEntityModifiedAsync(EntityModifiedDomainEvent command) - { - await Console.Out.WriteLineAsync($"run【{nameof(UserEntityModifiedAsync)}】"); - - var userEntity = command.Entity; - if (userEntity is null) - { - throw new Exception($"User 【{nameof(UserEntityCreatedEventAsync)}】 already exists"); - } - } - - [EventHandler] - public async Task UserEntityDeleteAsync(EntityDeletedDomainEvent command) - { - await Console.Out.WriteLineAsync($"run【{nameof(UserEntityDeleteAsync)}】"); - - var userEntity = command.Entity; - if (userEntity is null) - { - throw new Exception($"User 【{nameof(UserEntityDeleteAsync)}】 already exists"); - } - } - - [EventHandler] - public async Task RegisterUserDomainEvent(RegisterUserDomainEvent command) - { - await Console.Out.WriteLineAsync($"User 【{nameof(RegisterUserDomainEvent)}】 already exists"); - } - - [EventHandler] - public async Task RegisterUserIntegrationDomainEvent(RegisterUserIntegrationDomainEvent command) - { - await Console.Out.WriteLineAsync($"User 【{nameof(RegisterUserIntegrationDomainEvent)}】 already exists"); - } -} diff --git a/test/Masa.Framework.EventApiTest/Controllers/IntegrationEventLogController.cs b/test/Masa.Framework.EventApiTest/Controllers/IntegrationEventLogController.cs deleted file mode 100644 index d830f8ebf..000000000 --- a/test/Masa.Framework.EventApiTest/Controllers/IntegrationEventLogController.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Dapr; -using Dapr.AspNetCore; -using Dapr.Client; -using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; -using Microsoft.AspNetCore.Mvc; -using Newtonsoft.Json; - -namespace Masa.Framework.EventApiTest.Controllers -{ - [ApiController] - [Route("[controller]/[action]")] - public class IntegrationEventLogController : ControllerBase - { - private readonly ILogger _logger; - private readonly IEventBus eventBus; - private readonly CustomDbContext dbContext; - private readonly IUnitOfWork unitOfWork; - private readonly Masa.Framework.EventApiTest.Domain.IUserRepository userRepository; - private readonly IIntegrationEventBus integrationEventBus; - private readonly DaprClient DaprClient; - - public IntegrationEventLogController(ILogger logger, IEventBus eventBus, CustomDbContext customDbContext, - IUnitOfWork unitOfWork, Domain.IUserRepository userRepository, IIntegrationEventBus integrationEventBus, DaprClient daprClient) - { - _logger = logger; - this.eventBus = eventBus; - this.dbContext = customDbContext; - this.unitOfWork = unitOfWork; - this.userRepository = userRepository; - this.integrationEventBus = integrationEventBus; - this.DaprClient = daprClient; - } - - [HttpPost("/createOrder")] - public async Task CreateOrderAsync() - { - var order = new - { - orderId = "123456", - productId = "67890", - amount = 2 - }; - - await DaprClient.PublishEventAsync("pubsub", "newOrder", order); - return new JsonResult(order); - } - - [HttpPost("/bulk_createOrder")] - public async Task BulkCreateOrder2() - { - using var client = new DaprClientBuilder().Build(); - var events = new List() - { - new - { - orderId = "123456", - productId = "67890", - amount = 1 - },new{ - orderId = "123456", - productId = "67890", - amount = 2 - } - }; - - var res = await client.BulkPublishEventAsync("pubsub", "newOrder", events); - if (res == null) - { - throw new Exception("null response from dapr"); - } - - if (res.FailedEntries.Count > 0) - { - Console.WriteLine("Some events failed to be published!"); - foreach (var failedEntry in res.FailedEntries) - { - Console.WriteLine("EntryId: " + failedEntry.Entry.EntryId + " Error message: " + - failedEntry.ErrorMessage); - } - } - else - { - Console.WriteLine("Published all events!"); - } - - return new JsonResult(events); - } - - //[Dapr.AspNetCore.BulkSubscribe("newOrder", 10, 10)] - [Topic("pubsub", "newOrder")] - [HttpPost("/createOrderHandler")] - public async Task CreateOrderHandler(object data) - { - return Content(JsonConvert.SerializeObject(data)); - } - - [HttpGet] - public async Task AddUser() - { - var user = new User - { - Age = 18, - Name = 1.ToString() - }; - user.RegisterUserDomainEvent(); - - await userRepository.AddAsync(user); - await unitOfWork.SaveChangesAsync(); - await unitOfWork.CommitAsync(); - var count = await userRepository.GetCountAsync(); - await Console.Out.WriteLineAsync(count.ToString()); - return count; - } - - [HttpGet] - public async Task AddAsync() - { - var logs = new List(); - - logs.Add(new IntegrationEventLog(new TestBaseEventLocal(1), Guid.Parse("D98F4EA8-8EDE-48BA-A767-2863614AE34C"))); - logs.Add(new IntegrationEventLog(new TestBaseEventLocal(2), Guid.Parse("D98F4EA8-8EDE-48BA-A767-2863614AE34C"))); - await dbContext.Set().AddRangeAsync(logs); - dbContext.SaveChanges(); - var count = await dbContext.Set().CountAsync(); - - return count; - } - - [HttpGet] - public async Task UpdateStateAsync(IntegrationEventStates state = IntegrationEventStates.NotPublished) - { - var logs = await dbContext.Set().ToListAsync(); - - foreach (var item in logs) - { - item.State = state; - } - - dbContext.Set().UpdateRange(logs); - dbContext.SaveChanges(); - return logs.Count; - } - - [HttpGet] - public async Task> GetListAsync() - { - return await dbContext.Set().ToListAsync(); - } - - [HttpGet] - public async Task PublishAsync(long idnex = 1) - { - await integrationEventBus.PublishAsync(new TestBaseEventLocal(idnex)); - return idnex; - } - - [HttpPost] - [Topic("pubsub", nameof(AddGoodsIntegrationEvent))] - public async Task AddGoodsIntegrationEventHandlerAsync(AddGoodsIntegrationEvent integrationEvent) - { - await Console.Out.WriteLineAsync(JsonConvert.SerializeObject(integrationEvent)); - } - - [HttpPost] - [Topic("pubsub", nameof(TestBaseEventLocal))] - public async Task TestBaseEventLocalHandlerAsync(TestBaseEventLocal integrationEvent) - { - await Console.Out.WriteLineAsync(integrationEvent.Index.ToString()); - } - } -} diff --git a/test/Masa.Framework.EventApiTest/Controllers/UserController.cs b/test/Masa.Framework.EventApiTest/Controllers/UserController.cs deleted file mode 100644 index ef2d91014..000000000 --- a/test/Masa.Framework.EventApiTest/Controllers/UserController.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Dapr; -using Dapr.AspNetCore; -using Dapr.Client; -using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; -using Microsoft.AspNetCore.Mvc; -using Newtonsoft.Json; - -namespace Masa.Framework.EventApiTest.Controllers -{ - [ApiController] - [Route("[controller]/[action]")] - public class UserController : ControllerBase - { - private readonly ILogger _logger; - private readonly IEventBus eventBus; - private readonly CustomDbContext dbContext; - private readonly IUnitOfWork unitOfWork; - private readonly Masa.Framework.EventApiTest.Domain.IUserRepository userRepository; - private readonly IIntegrationEventBus integrationEventBus; - private readonly DaprClient DaprClient; - - public UserController(ILogger logger, IEventBus eventBus, CustomDbContext customDbContext, - IUnitOfWork unitOfWork, Domain.IUserRepository userRepository, IIntegrationEventBus integrationEventBus, DaprClient daprClient) - { - _logger = logger; - this.eventBus = eventBus; - this.dbContext = customDbContext; - this.unitOfWork = unitOfWork; - this.userRepository = userRepository; - this.integrationEventBus = integrationEventBus; - this.DaprClient = daprClient; - } - - [HttpPost] - public async Task EntityCreatedDomainEventAsync() - { - var user = new User - { - Age = 18, - Name = 1.ToString(), - }; - - await userRepository.AddAsync(user); - await unitOfWork.SaveChangesAsync(); - await unitOfWork.CommitAsync(); - return user; - } - - [HttpPut] - public async Task EntityModifiedDomainEventAsync() - { - var user = await userRepository.FindAsync(item => item.Id != Guid.Empty); - user.Age++; - await userRepository.UpdateAsync(user); - await unitOfWork.SaveChangesAsync(); - await unitOfWork.CommitAsync(); - return user; - } - - [HttpDelete] - public async Task EntityDeletedDomainEventAsync() - { - var user = await userRepository.FindAsync(item => item.Id != Guid.Empty); - - await userRepository.RemoveAsync(user); - await unitOfWork.SaveChangesAsync(); - await unitOfWork.CommitAsync(); - return await userRepository.GetCountAsync(); - } - } -} diff --git a/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs b/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs deleted file mode 100644 index 942a0b230..000000000 --- a/test/Masa.Framework.EventApiTest/Domain/Aggregate/User.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Domain.Aggregate; - -public class User : AggregateRoot -{ - public string Name { get; set; } - - public int Age { get; set; } - - public User() - { - Id = Guid.NewGuid(); - } - - public void RegisterUserIntegrationDomainEvent() { - - base.AddDomainEvent(new RegisterUserIntegrationDomainEvent()); - } - - public void RegisterUserDomainEvent() { - - base.AddDomainEvent(new RegisterUserDomainEvent()); - } -} diff --git a/test/Masa.Framework.EventApiTest/Domain/IUserRepository.cs b/test/Masa.Framework.EventApiTest/Domain/IUserRepository.cs deleted file mode 100644 index b0cced648..000000000 --- a/test/Masa.Framework.EventApiTest/Domain/IUserRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.EventApiTest.Domain -{ - public interface IUserRepository : IRepository - { - } -} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/CustomDbContext.cs b/test/Masa.Framework.EventApiTest/Infrastructure/CustomDbContext.cs deleted file mode 100644 index 077141377..000000000 --- a/test/Masa.Framework.EventApiTest/Infrastructure/CustomDbContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure; - -public class CustomDbContext : MasaDbContext -{ - public DbSet User { get; set; } - - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } -} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DefaultPublisher.cs b/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DefaultPublisher.cs deleted file mode 100644 index c56c62e72..000000000 --- a/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DefaultPublisher.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - - -namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure.Extensions; - -public class DefaultPublisher : IPublisher -{ - public Task BulkPublishAsync(string topicName, List<(T @event, IntegrationEventExpand? eventMessageExpand)> events, CancellationToken stoppingToken = default) - { - return Task.CompletedTask; - } - - public Task PublishAsync(string topicName, T @event, IntegrationEventExpand? eventMessageExpand, CancellationToken stoppingToken = default) - { - return Task.CompletedTask; - } -} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DispatcherOptionsExtensions.cs b/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DispatcherOptionsExtensions.cs deleted file mode 100644 index c49134f74..000000000 --- a/test/Masa.Framework.EventApiTest/Infrastructure/Extensions/DispatcherOptionsExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure.Extensions; - -public static class DispatcherOptionsExtensions -{ - public static Contrib.Dispatcher.IntegrationEvents.Options.IntegrationEventOptions UseTestPub( - this Contrib.Dispatcher.IntegrationEvents.Options.IntegrationEventOptions dispatcherOptions) - { - dispatcherOptions.Services.TryAddSingleton(); - return dispatcherOptions; - } -} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/RecordEventMiddleware.cs b/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/RecordEventMiddleware.cs deleted file mode 100644 index 60b045561..000000000 --- a/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/RecordEventMiddleware.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure.Middleware; - -public class RecordEventMiddleware : EventMiddleware - where TEvent : IEvent -{ - public static int Time { get; set; } - - public override bool SupportRecursive => false; - - public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) - { - Time++; - await next(); - } -} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/ValidatorEventMiddleware.cs b/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/ValidatorEventMiddleware.cs deleted file mode 100644 index f9a9b75a7..000000000 --- a/test/Masa.Framework.EventApiTest/Infrastructure/Middleware/ValidatorEventMiddleware.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.IntegrationTests.EventBus.Infrastructure.Middleware; - -public class ValidatorEventMiddleware : EventMiddleware - where TEvent : notnull, IEvent -{ - private readonly IEnumerable> _validators; - - public ValidatorEventMiddleware(IEnumerable> validators) - { - _validators = validators; - } - - public override async Task HandleAsync(TEvent action, EventHandlerDelegate next) - { - var failures = _validators - .Select(v => v.Validate(action)) - .SelectMany(result => result.Errors) - .Where(error => error != null) - .ToList(); - - if (failures.Any()) - { - throw new ValidationException(failures.Select(x=>x.ErrorMessage).FirstOrDefault()); - } - - await next(); - } -} diff --git a/test/Masa.Framework.EventApiTest/Infrastructure/UserRepository.cs b/test/Masa.Framework.EventApiTest/Infrastructure/UserRepository.cs deleted file mode 100644 index da7d18ef1..000000000 --- a/test/Masa.Framework.EventApiTest/Infrastructure/UserRepository.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - - -namespace Masa.Framework.EventApiTest.Infrastructure -{ - public class UserRepository : Masa.Contrib.Ddd.Domain.Repository.EFCore.Repository, Masa.Framework.EventApiTest.Domain.IUserRepository - { - public UserRepository(CustomDbContext context, IUnitOfWork unitOfWork) : base(context, unitOfWork) - { - } - } -} diff --git a/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.csproj b/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.csproj deleted file mode 100644 index 93aceeafe..000000000 --- a/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - net8.0 - enable - enable - true - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - diff --git a/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.http b/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.http deleted file mode 100644 index fcf285ea5..000000000 --- a/test/Masa.Framework.EventApiTest/Masa.Framework.EventApiTest.http +++ /dev/null @@ -1,6 +0,0 @@ -@Masa.Framework.EventApiTest_HostAddress = http://localhost:5021 - -GET {{Masa.Framework.EventApiTest_HostAddress}}/weatherforecast/ -Accept: application/json - -### diff --git a/test/Masa.Framework.EventApiTest/Program.cs b/test/Masa.Framework.EventApiTest/Program.cs deleted file mode 100644 index a74f5f855..000000000 --- a/test/Masa.Framework.EventApiTest/Program.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using FluentValidation.AspNetCore; -using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; - -var builder = WebApplication.CreateBuilder(args); - -if (builder.Environment.IsDevelopment()) -{ - builder.Services.AddDaprStarter();//builder.Configuration.GetSection("DaprStarter") -} - -// Add services to the container. - -builder.Services.AddControllers().AddDapr(); -// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); -builder.Services.AddFluentValidation(options => -{ - options.RegisterValidatorsFromAssemblyContaining(); -}); -builder.Services.AddDomainEventBus(dispatcherOptions => -{ - dispatcherOptions - .UseIntegrationEventBus(option => - { - option.BatchesGroupSendOrRetry = true; - option.UseDapr().UseEventLog(); - })// - .UseEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(RecordEventMiddleware<>)).UseMiddleware(typeof(ValidatorEventMiddleware<>))) - .UseUoW(optionBuilder => - { - optionBuilder.UseSqlite($"data source=disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90").UseFilter(); - //optionBuilder.UseSqlite($"data source=disabled-soft-delete-db-{Guid.NewGuid()}").UseFilter(); - }) - .UseRepository(); -}); -var dbContext = builder.Services.BuildServiceProvider().GetRequiredService(); -dbContext.Database.EnsureCreated(); -var app = builder.Build(); - -// Configure the HTTP request pipeline. -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} - -app.UseCloudEvents(); -app.MapControllers(); -app.MapSubscribeHandler(); -app.UseHttpsRedirection(); - -app.UseAuthorization(); - -app.MapControllers(); - -app.Run(); diff --git a/test/Masa.Framework.EventApiTest/Properties/launchSettings.json b/test/Masa.Framework.EventApiTest/Properties/launchSettings.json deleted file mode 100644 index 4fb629230..000000000 --- a/test/Masa.Framework.EventApiTest/Properties/launchSettings.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:33162", - "sslPort": 44300 - } - }, - "profiles": { - "http": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "http://localhost:5021", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:7269;http://localhost:5021", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/test/Masa.Framework.EventApiTest/WeatherForecast.cs b/test/Masa.Framework.EventApiTest/WeatherForecast.cs deleted file mode 100644 index fb578f4a5..000000000 --- a/test/Masa.Framework.EventApiTest/WeatherForecast.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Framework.EventApiTest -{ - public class WeatherForecast - { - public DateOnly Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string? Summary { get; set; } - } -} diff --git a/test/Masa.Framework.EventApiTest/_Imports.cs b/test/Masa.Framework.EventApiTest/_Imports.cs deleted file mode 100644 index f7d877b0b..000000000 --- a/test/Masa.Framework.EventApiTest/_Imports.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using FluentValidation; -global using FluentValidation.AspNetCore; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.BuildingBlocks.ReadWriteSplitting.Cqrs.Queries; -global using Masa.Contrib.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.IntegrationEvents; -global using Masa.Framework.IntegrationTests.EventBus.Application.Command; -global using Masa.Framework.IntegrationTests.EventBus.Application.Events; -global using Masa.Framework.IntegrationTests.EventBus.Application.Queries; -global using Masa.Framework.IntegrationTests.EventBus.Domain.Aggregate; -global using Masa.Framework.IntegrationTests.EventBus.Infrastructure; -global using Masa.Framework.IntegrationTests.EventBus.Infrastructure.Extensions; -global using Masa.Framework.IntegrationTests.EventBus.Infrastructure.Middleware; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System.Collections.Concurrent; diff --git a/test/Masa.Framework.EventApiTest/appsettings.Development.json b/test/Masa.Framework.EventApiTest/appsettings.Development.json deleted file mode 100644 index a49f171a3..000000000 --- a/test/Masa.Framework.EventApiTest/appsettings.Development.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - }, - "DaprStarter": { - "AppId": "loncloud-apis-aftersales", - "AppPort": 18900, - "MetricsPort": 18901, - "DaprGrpcPort": 18902, - "DaprHttpPort": 18903, - "CreateNoWindow": true, - "ExtendedParameter": " -placement-host-address localhost:6050 -components-path %USERPROFILE%\\.dapr\\components -log-level debug" - } - } -} diff --git a/test/Masa.Framework.EventApiTest/appsettings.json b/test/Masa.Framework.EventApiTest/appsettings.json deleted file mode 100644 index 10f68b8c8..000000000 --- a/test/Masa.Framework.EventApiTest/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" -} diff --git a/test/Masa.Framework.EventApiTest/dapr-components/pubsub.yaml b/test/Masa.Framework.EventApiTest/dapr-components/pubsub.yaml deleted file mode 100644 index 229d5a0c9..000000000 --- a/test/Masa.Framework.EventApiTest/dapr-components/pubsub.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: dapr.io/v1alpha1 -kind: Component -metadata: - name: pubsub - namespace: NAMESPACE -spec: - metadata: - - name: redisHost - value: 10.130.0.19:4208 - - name: redisPassword - value: Hzss@123 - - name: redisDB - value: '3' - - name: maxLenApprox - value: '100000' - type: pubsub.redis - version: v1 \ No newline at end of file diff --git a/test/Masa.Framework.EventApiTest/dapr-components/statestore.yaml b/test/Masa.Framework.EventApiTest/dapr-components/statestore.yaml deleted file mode 100644 index e27cc47ee..000000000 --- a/test/Masa.Framework.EventApiTest/dapr-components/statestore.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: dapr.io/v1alpha1 -kind: Component -metadata: - name: statestore - namespace: NAMESPACE -spec: - metadata: - - name: redisHost - value: 10.130.0.19:4208 - - name: redisPassword - value: Hzss@123 - - name: actorStateStore - value: true - - name: redisDB - value: 3 - type: state.redis - version: v1 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90 b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90 deleted file mode 100644 index 8cd4ce6d6718afad1a3fc55f81fe4977a2e2e0eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 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 diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-shm deleted file mode 100644 index abceb6eb3bb29c6f40282e1cd52c25ed6a6edf6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)J4ypl6b9fwF}`1;F*=2AK(KcUE+z|d3pVz4R)XLr(gd^+dqK|>fwaODBYX!A z+&f(UIeZH^?cye@8YN9zm!0a{kFWRdx8`;B{4}{*UOwKsz9~SK&->pggQXD|yue277~RitrnwmWtOg{|ufU|X>mH=Z zS-Oq9iU0uu1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBoLj{?7a CJ1hwR diff --git a/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-wal b/test/Masa.Framework.EventApiTest/disabled-soft-delete-db-030e2f29-3398-493e-831a-0df85d3cba90-wal deleted file mode 100644 index cadbf533f7501c0b8bf2fcf0eddf2b7e6797adf6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 98912 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 UBH_XOwtj)b<$Kh&dk-=5|EiC~(EtDd From 43515665a0f12df7e31453be46787fda9b613f1d Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Thu, 9 May 2024 09:05:17 +0800 Subject: [PATCH 11/15] fix:DefaultUserContext --- .../DefaultUserContext.cs | 48 ++++++++-- .../IdentityTest.cs | 91 ++++++++++++++++++- 2 files changed, 129 insertions(+), 10 deletions(-) diff --git a/src/Contrib/Authentication/Identity/Masa.Contrib.Authentication.Identity.Core/DefaultUserContext.cs b/src/Contrib/Authentication/Identity/Masa.Contrib.Authentication.Identity.Core/DefaultUserContext.cs index 4af3515fe..d4e451f83 100644 --- a/src/Contrib/Authentication/Identity/Masa.Contrib.Authentication.Identity.Core/DefaultUserContext.cs +++ b/src/Contrib/Authentication/Identity/Masa.Contrib.Authentication.Identity.Core/DefaultUserContext.cs @@ -1,6 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using System.Collections; + namespace Masa.Contrib.Authentication.Identity; internal class DefaultUserContext : UserContext @@ -44,26 +46,54 @@ public DefaultUserContext( if (claimType == null) continue; - string? claimValue = null; - if (property.PropertyType != typeof(string) && typeof(System.Collections.IEnumerable).IsAssignableFrom(property.PropertyType)) + string? claimValue = ClaimsPrincipal.FindClaimValue(claimType); + object? claimTypeValue = null; + try { - var claimsValues = ClaimsPrincipal?.Claims.Where(claim => claim.Type == claimType) - .Select(claim => claim.Value); - if (claimsValues?.Any() == true) - claimValue = JsonSerializer.Serialize(claimsValues); + claimTypeValue = TypeConvertProvider.ConvertTo(claimValue, property.PropertyType); } - else + catch { - claimValue = ClaimsPrincipal?.FindClaimValue(claimType); + claimTypeValue = this.ParseNonJson(property); } if (claimValue != null) { modelRelation.Setters[property] - .Invoke(userModel, new[] { TypeConvertProvider.ConvertTo(claimValue, property.PropertyType) }); + .Invoke(userModel, new[] { claimTypeValue }); } } return userModel; } + + private object? ParseNonJson(PropertyInfo property) + { + var claimValues = new List(); + var claimType = _optionsMonitor.CurrentValue.GetClaimType(property.Name); + if (claimType == null) + return null; + + if (property.PropertyType != typeof(string) && typeof(IEnumerable).IsAssignableFrom(property.PropertyType)) + { + var claimsValues = ClaimsPrincipal?.Claims.Where(claim => claim.Type == claimType) + .Select(claim => claim.Value).ToList(); + + claimsValues?.ForEach(item => + { + try + { + var claimsValue = JsonSerializer.Deserialize>(item); + if (claimsValue?.Any() == true) + claimValues.AddRange(claimsValue); + } + catch + { + claimValues.Add(item); + } + }); + } + + return TypeConvertProvider.ConvertTo(JsonSerializer.Serialize(claimValues), property.PropertyType); + } } diff --git a/src/Contrib/Authentication/Identity/Tests/Masa.Contrib.Authentication.Identity.BlazorServer.Tests/IdentityTest.cs b/src/Contrib/Authentication/Identity/Tests/Masa.Contrib.Authentication.Identity.BlazorServer.Tests/IdentityTest.cs index c9c941b1d..1ef869d9e 100644 --- a/src/Contrib/Authentication/Identity/Tests/Masa.Contrib.Authentication.Identity.BlazorServer.Tests/IdentityTest.cs +++ b/src/Contrib/Authentication/Identity/Tests/Masa.Contrib.Authentication.Identity.BlazorServer.Tests/IdentityTest.cs @@ -1,6 +1,8 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Newtonsoft.Json; + namespace Masa.Contrib.Authentication.Identity.BlazorServer.Tests; [TestClass] @@ -62,6 +64,93 @@ public void TestMasaIdentity2() Assert.AreEqual(1, userRoles[0]); } + [TestMethod] + public void TestMasaIdentity3() + { + var services = new ServiceCollection(); + var claimsPrincipal = new ClaimsPrincipal(new List() + { + new(new List() + { + new("sub", "1"), + new(ClaimType.DEFAULT_USER_NAME, "Jim"), + new(ClaimType.DEFAULT_USER_ROLE, "1")//"[\"1\"]" + }) + }); + Mock authenticationStateProvider = new(); + authenticationStateProvider + .Setup(provider => provider.GetAuthenticationStateAsync()) + .ReturnsAsync(new AuthenticationState(claimsPrincipal)); + + services.AddScoped(_ => authenticationStateProvider.Object); + services.AddMasaIdentity(option => + { + option.UserId = "sub"; + }); + + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + + var serviceProvider = services.BuildServiceProvider(); + var userContext = serviceProvider.GetService(); + Assert.IsNotNull(userContext); + Assert.AreEqual("1", userContext.UserId); + Assert.AreEqual("Jim", userContext.UserName); + + var userRoles = userContext.GetUserRoles().ToList(); + Assert.AreEqual(1, userRoles.Count); + Assert.AreEqual(1, userRoles[0]); + } + + [TestMethod] + public void TestMasaIdentity4() + { + var roles = new List() + { + "admin", "admin2", "admin3","admin4" + }; + var services = new ServiceCollection(); + var claimsPrincipal = new ClaimsPrincipal(new List() + { + new(new List() + { + new("sub", "1"), + new(ClaimType.DEFAULT_USER_NAME, "Jim"), + new(ClaimType.DEFAULT_USER_ROLE, JsonConvert.SerializeObject(roles))//"[\"1\"]" + }) + }); + Mock authenticationStateProvider = new(); + authenticationStateProvider + .Setup(provider => provider.GetAuthenticationStateAsync()) + .ReturnsAsync(new AuthenticationState(claimsPrincipal)); + + services.AddScoped(_ => authenticationStateProvider.Object); + services.AddMasaIdentity(option => + { + option.UserId = "sub"; + }); + + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + + var serviceProvider = services.BuildServiceProvider(); + var userContext = serviceProvider.GetService(); + Assert.IsNotNull(userContext); + Assert.AreEqual("1", userContext.UserId); + Assert.AreEqual("Jim", userContext.UserName); + + var userRoles = userContext.GetUserRoles().ToList(); + Assert.AreEqual(4, userRoles.Count); + } + [TestMethod] public void TestIdentityByYaml() { From c2ad5b0b6f032a19547f3cac95b9b152bec5e416 Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Thu, 9 May 2024 09:23:41 +0800 Subject: [PATCH 12/15] fix:optimization --- .../DefaultUserContext.cs | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Contrib/Authentication/Identity/Masa.Contrib.Authentication.Identity.Core/DefaultUserContext.cs b/src/Contrib/Authentication/Identity/Masa.Contrib.Authentication.Identity.Core/DefaultUserContext.cs index d4e451f83..90016be98 100644 --- a/src/Contrib/Authentication/Identity/Masa.Contrib.Authentication.Identity.Core/DefaultUserContext.cs +++ b/src/Contrib/Authentication/Identity/Masa.Contrib.Authentication.Identity.Core/DefaultUserContext.cs @@ -46,21 +46,22 @@ public DefaultUserContext( if (claimType == null) continue; - string? claimValue = ClaimsPrincipal.FindClaimValue(claimType); - object? claimTypeValue = null; - try - { - claimTypeValue = TypeConvertProvider.ConvertTo(claimValue, property.PropertyType); - } - catch - { - claimTypeValue = this.ParseNonJson(property); - } - + string? claimValue = ClaimsPrincipal?.FindClaimValue(claimType); if (claimValue != null) { + object? claimTypeValue = null; + + try + { + claimTypeValue = TypeConvertProvider.ConvertTo(claimValue, property.PropertyType); + } + catch + { + claimTypeValue = this.ParseNonJson(property); + } + modelRelation.Setters[property] - .Invoke(userModel, new[] { claimTypeValue }); + .Invoke(userModel, new[] { claimTypeValue }); } } From 56ff1839481cad36d72656d8bb1aaee0052420e8 Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Thu, 9 May 2024 09:34:05 +0800 Subject: [PATCH 13/15] =?UTF-8?q?fix:=E5=8F=96=E6=B6=88=E9=9B=86=E6=88=90?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E9=BB=98=E8=AE=A4Topic,=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=BC=95=E8=B5=B7=E5=91=BD=E5=90=8D=E5=86=B2=E7=AA=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/EventTest.cs | 2 +- .../Events/IntegrationDomainEvent.cs | 2 +- .../IntegrationEvent.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/EventTest.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/EventTest.cs index 39eff2517..4a459db75 100644 --- a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/EventTest.cs +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/EventTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.BuildingBlocks.Ddd.Domain.Tests; diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs index 123f4055e..f6cd438e2 100644 --- a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs @@ -10,6 +10,6 @@ public abstract record IntegrationDomainEvent(Guid EventId, DateTime EvenCreateT protected IntegrationDomainEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { // ReSharper disable once VirtualMemberCallInConstructor - if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().FullName ?? GetType().Name; + if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().Name; } } diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs index 6bb070ed6..4c401cce0 100644 --- a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs @@ -20,7 +20,7 @@ protected IntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow) protected IntegrationEvent(Guid eventId, DateTime creationTime) { - if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().FullName ?? GetType().Name; + if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().Name; EventId = eventId; EvenCreateTime = creationTime; From 7c11143d02bc42136bfc286082a7afdee4a4eeef Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Thu, 9 May 2024 19:13:14 +0800 Subject: [PATCH 14/15] fix:remove backup.csproj --- ...ocks.Authentication.OpenIdConnect.Domain.csproj | 14 -------------- ....BuildingBlocks.Development.DaprStarters.csproj | 13 ------------- 2 files changed, 27 deletions(-) delete mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Masa - Backup.BuildingBlocks.Authentication.OpenIdConnect.Domain.csproj delete mode 100644 src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Masa - Backup.BuildingBlocks.Development.DaprStarters.csproj diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Masa - Backup.BuildingBlocks.Authentication.OpenIdConnect.Domain.csproj b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Masa - Backup.BuildingBlocks.Authentication.OpenIdConnect.Domain.csproj deleted file mode 100644 index 36d94ae77..000000000 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Masa - Backup.BuildingBlocks.Authentication.OpenIdConnect.Domain.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Masa - Backup.BuildingBlocks.Development.DaprStarters.csproj b/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Masa - Backup.BuildingBlocks.Development.DaprStarters.csproj deleted file mode 100644 index 23f339d8f..000000000 --- a/src/BuildingBlocks/Development/Masa.BuildingBlocks.Development.DaprStarter/Masa - Backup.BuildingBlocks.Development.DaprStarters.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - From 1a20607d69b9f448b2b92be2837b699e01d1400c Mon Sep 17 00:00:00 2001 From: duia <532977252@qq.com> Date: Thu, 9 May 2024 19:21:57 +0800 Subject: [PATCH 15/15] fix:TestEntityCreatedEventAsync --- .../TestDispatcher.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Masa.Framework.IntegrationTests.EventBus/TestDispatcher.cs b/test/Masa.Framework.IntegrationTests.EventBus/TestDispatcher.cs index eae95c26d..5033ffc43 100644 --- a/test/Masa.Framework.IntegrationTests.EventBus/TestDispatcher.cs +++ b/test/Masa.Framework.IntegrationTests.EventBus/TestDispatcher.cs @@ -128,14 +128,14 @@ public async Task TestEntityCreatedEventAsync() var dbContext = serviceProvider.GetRequiredService(); var users = new List(); var testCount = 100; - Parallel.For(1L, testCount + 1, i => + for (int i = 0; i < 100; i++) { users.Add(new User { Age = 18, Name = i.ToString() }); - }); + } await dbContext.Set().AddRangeAsync(users); await dbContext.SaveChangesAsync(); await unitOfWork.SaveChangesAsync();