├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── _screenshots ├── ui-home.png ├── ui-login.png └── ui-user-create-modal.png ├── angular ├── .browserslistrc ├── .dockerignore ├── .editorconfig ├── .gitignore ├── .vscode │ └── launch.json ├── Dockerfile ├── EventCloud.AngularUI.csproj ├── EventCloud.AngularUI.sln ├── Properties │ └── launchSettings.json ├── README.md ├── angular.json ├── app.config ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.json ├── fast-nginx-default.conf ├── karma.conf.js ├── nswag │ ├── refresh.bat │ └── service.config.nswag ├── package.json ├── protractor.conf.js ├── src │ ├── account │ │ ├── account-routing.module.ts │ │ ├── account.component.html │ │ ├── account.component.ts │ │ ├── account.module.ts │ │ ├── layout │ │ │ ├── account-footer.component.html │ │ │ ├── account-footer.component.ts │ │ │ ├── account-header.component.html │ │ │ ├── account-header.component.ts │ │ │ ├── account-languages.component.html │ │ │ └── account-languages.component.ts │ │ ├── login │ │ │ ├── login.component.html │ │ │ └── login.component.ts │ │ ├── register │ │ │ ├── register.component.html │ │ │ └── register.component.ts │ │ └── tenant │ │ │ ├── tenant-change-dialog.component.html │ │ │ ├── tenant-change-dialog.component.ts │ │ │ ├── tenant-change.component.html │ │ │ └── tenant-change.component.ts │ ├── app-initializer.ts │ ├── app │ │ ├── about │ │ │ ├── about.component.html │ │ │ └── about.component.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── events │ │ │ ├── create-event │ │ │ │ ├── create-event.component.html │ │ │ │ └── create-event.component.ts │ │ │ ├── event-detail │ │ │ │ ├── event-detail.component.html │ │ │ │ └── event-detail.component.ts │ │ │ ├── event.component.ts │ │ │ └── events.component.html │ │ ├── home │ │ │ ├── home.component.html │ │ │ └── home.component.ts │ │ ├── layout │ │ │ ├── footer.component.html │ │ │ ├── footer.component.ts │ │ │ ├── header-language-menu.component.html │ │ │ ├── header-language-menu.component.ts │ │ │ ├── header-left-navbar.component.html │ │ │ ├── header-left-navbar.component.ts │ │ │ ├── header-user-menu.component.html │ │ │ ├── header-user-menu.component.ts │ │ │ ├── header.component.html │ │ │ ├── header.component.ts │ │ │ ├── sidebar-logo.component.html │ │ │ ├── sidebar-logo.component.ts │ │ │ ├── sidebar-menu.component.html │ │ │ ├── sidebar-menu.component.ts │ │ │ ├── sidebar-user-panel.component.html │ │ │ ├── sidebar-user-panel.component.ts │ │ │ ├── sidebar.component.html │ │ │ └── sidebar.component.ts │ │ ├── roles │ │ │ ├── create-role │ │ │ │ ├── create-role-dialog.component.html │ │ │ │ └── create-role-dialog.component.ts │ │ │ ├── edit-role │ │ │ │ ├── edit-role-dialog.component.html │ │ │ │ └── edit-role-dialog.component.ts │ │ │ ├── roles.component.html │ │ │ └── roles.component.ts │ │ ├── tenants │ │ │ ├── create-tenant │ │ │ │ ├── create-tenant-dialog.component.html │ │ │ │ └── create-tenant-dialog.component.ts │ │ │ ├── edit-tenant │ │ │ │ ├── edit-tenant-dialog.component.html │ │ │ │ └── edit-tenant-dialog.component.ts │ │ │ ├── tenants.component.html │ │ │ └── tenants.component.ts │ │ └── users │ │ │ ├── change-password │ │ │ ├── change-password.component.html │ │ │ └── change-password.component.ts │ │ │ ├── create-user │ │ │ ├── create-user-dialog.component.html │ │ │ └── create-user-dialog.component.ts │ │ │ ├── edit-user │ │ │ ├── edit-user-dialog.component.html │ │ │ └── edit-user-dialog.component.ts │ │ │ ├── reset-password │ │ │ ├── reset-password.component.html │ │ │ └── reset-password.component.ts │ │ │ ├── users.component.html │ │ │ └── users.component.ts │ ├── assets │ │ ├── .gitkeep │ │ ├── abp-web-resources │ │ │ ├── abp.freeze-ui.js │ │ │ └── abp.sweet-alert.js │ │ ├── appconfig.container.json │ │ ├── appconfig.json │ │ ├── appconfig.production.json │ │ ├── freeze-ui │ │ │ ├── freeze-ui.css │ │ │ └── freeze-ui.js │ │ └── img │ │ │ ├── logo.png │ │ │ └── user.png │ ├── environments │ │ ├── environment.hmr.ts │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── hmr.ts │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── root-routing.module.ts │ ├── root.component.ts │ ├── root.module.ts │ ├── shared │ │ ├── AppConsts.ts │ │ ├── AppEnums.ts │ │ ├── animations │ │ │ └── routerTransition.ts │ │ ├── app-component-base.ts │ │ ├── auth │ │ │ ├── app-auth.service.ts │ │ │ └── auth-route-guard.ts │ │ ├── components │ │ │ ├── modal │ │ │ │ ├── abp-modal-footer.component.html │ │ │ │ ├── abp-modal-footer.component.ts │ │ │ │ ├── abp-modal-header.component.html │ │ │ │ └── abp-modal-header.component.ts │ │ │ ├── pagination │ │ │ │ ├── abp-pagination-controls.component.html │ │ │ │ └── abp-pagination-controls.component.ts │ │ │ └── validation │ │ │ │ ├── abp-validation.api.ts │ │ │ │ ├── abp-validation.summary.component.html │ │ │ │ └── abp-validation.summary.component.ts │ │ ├── core.less │ │ ├── directives │ │ │ ├── busy.directive.ts │ │ │ └── equal-validator.directive.ts │ │ ├── helpers │ │ │ ├── FormattedStringValueExtracter.ts │ │ │ ├── SignalRAspNetCoreHelper.ts │ │ │ ├── SubdomainTenancyNameFinder.ts │ │ │ └── UrlHelper.ts │ │ ├── layout │ │ │ ├── layout-config.ts │ │ │ ├── layout-store.service.ts │ │ │ └── menu-item.ts │ │ ├── multi-tenancy │ │ │ └── tenant-resolvers │ │ │ │ ├── query-string-tenant-resolver.ts │ │ │ │ └── subdomain-tenant-resolver.ts │ │ ├── nav │ │ │ └── app-url.service.ts │ │ ├── paged-listing-component-base.ts │ │ ├── pipes │ │ │ └── localize.pipe.ts │ │ ├── service-proxies │ │ │ ├── service-proxies.ts │ │ │ └── service-proxy.module.ts │ │ ├── session │ │ │ └── app-session.service.ts │ │ └── shared.module.ts │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.json ├── tslint.json ├── web.config └── yarn.lock ├── aspnet-core ├── .dockerignore ├── .gitattributes ├── .gitignore ├── EventCloud.sln ├── build │ ├── build-with-ng.ps1 │ └── build-with-ng.sh ├── docker │ └── ng │ │ ├── .gitignore │ │ ├── docker-compose.yml │ │ ├── down.ps1 │ │ └── up.ps1 ├── src │ ├── EventCloud.Application │ │ ├── Authorization │ │ │ ├── AbpLoginResultTypeHelper.cs │ │ │ └── Accounts │ │ │ │ ├── AccountAppService.cs │ │ │ │ ├── Dto │ │ │ │ ├── IsTenantAvailableInput.cs │ │ │ │ ├── IsTenantAvailableOutput.cs │ │ │ │ ├── RegisterInput.cs │ │ │ │ ├── RegisterOutput.cs │ │ │ │ └── TenantAvailabilityState.cs │ │ │ │ └── IAccountAppService.cs │ │ ├── Configuration │ │ │ ├── ConfigurationAppService.cs │ │ │ ├── Dto │ │ │ │ └── ChangeUiThemeInput.cs │ │ │ ├── IConfigurationAppService.cs │ │ │ └── Ui │ │ │ │ ├── UiThemeInfo.cs │ │ │ │ └── UiThemes.cs │ │ ├── EventCloud.Application.csproj │ │ ├── EventCloudAppServiceBase.cs │ │ ├── EventCloudApplicationModule.cs │ │ ├── Events │ │ │ ├── Dto │ │ │ │ ├── CreateEventInput.cs │ │ │ │ ├── EventDetailOutput.cs │ │ │ │ ├── EventListDto.cs │ │ │ │ ├── EventRegisterOutput.cs │ │ │ │ ├── EventRegistrationDto.cs │ │ │ │ └── GetEventListInput.cs │ │ │ ├── EventAppService.cs │ │ │ └── IEventAppService.cs │ │ ├── MultiTenancy │ │ │ ├── Dto │ │ │ │ ├── CreateTenantDto.cs │ │ │ │ ├── PagedTenantResultRequestDto.cs │ │ │ │ └── TenantDto.cs │ │ │ ├── ITenantAppService.cs │ │ │ └── TenantAppService.cs │ │ ├── Net │ │ │ └── MimeTypes │ │ │ │ └── MimeTypeNames.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Roles │ │ │ ├── Dto │ │ │ │ ├── CreateRoleDto.cs │ │ │ │ ├── FlatPermissionDto.cs │ │ │ │ ├── GetRoleForEditOutput.cs │ │ │ │ ├── GetRolesInput.cs │ │ │ │ ├── PagedRoleResultRequestDto.cs │ │ │ │ ├── PermissionDto.cs │ │ │ │ ├── RoleDto.cs │ │ │ │ ├── RoleEditDto.cs │ │ │ │ ├── RoleListDto.cs │ │ │ │ └── RoleMapProfile.cs │ │ │ ├── IRoleAppService.cs │ │ │ └── RoleAppService.cs │ │ ├── Sessions │ │ │ ├── Dto │ │ │ │ ├── ApplicationInfoDto.cs │ │ │ │ ├── GetCurrentLoginInformationsOutput.cs │ │ │ │ ├── TenantLoginInfoDto.cs │ │ │ │ └── UserLoginInfoDto.cs │ │ │ ├── ISessionAppService.cs │ │ │ └── SessionAppService.cs │ │ └── Users │ │ │ ├── Dto │ │ │ ├── ChangePasswordDto.cs │ │ │ ├── ChangeUserLanguageDto.cs │ │ │ ├── CreateUserDto.cs │ │ │ ├── PagedUserResultRequestDto.cs │ │ │ ├── ResetPasswordDto.cs │ │ │ ├── UserDto.cs │ │ │ └── UserMapProfile.cs │ │ │ ├── IUserAppService.cs │ │ │ └── UserAppService.cs │ ├── EventCloud.Core │ │ ├── AppVersionHelper.cs │ │ ├── Authorization │ │ │ ├── EventCloudAuthorizationProvider.cs │ │ │ ├── LoginManager.cs │ │ │ ├── PermissionChecker.cs │ │ │ ├── PermissionNames.cs │ │ │ ├── Roles │ │ │ │ ├── AppRoleConfig.cs │ │ │ │ ├── Role.cs │ │ │ │ ├── RoleManager.cs │ │ │ │ ├── RoleStore.cs │ │ │ │ └── StaticRoleNames.cs │ │ │ └── Users │ │ │ │ ├── User.cs │ │ │ │ ├── UserClaimsPrincipalFactory.cs │ │ │ │ ├── UserManager.cs │ │ │ │ ├── UserRegistrationManager.cs │ │ │ │ └── UserStore.cs │ │ ├── Configuration │ │ │ ├── AppConfigurations.cs │ │ │ ├── AppSettingNames.cs │ │ │ └── AppSettingProvider.cs │ │ ├── Debugging │ │ │ └── DebugHelper.cs │ │ ├── Domain │ │ │ └── Events │ │ │ │ └── DomainEvents.cs │ │ ├── Editions │ │ │ └── EditionManager.cs │ │ ├── EventCloud.Core.csproj │ │ ├── EventCloudConsts.cs │ │ ├── EventCloudCoreModule.cs │ │ ├── Events │ │ │ ├── Event.cs │ │ │ ├── EventCancelledEvent.cs │ │ │ ├── EventDateChangedEvent.cs │ │ │ ├── EventManager.cs │ │ │ ├── EventRegistration.cs │ │ │ ├── EventRegistrationPolicy.cs │ │ │ ├── IEventManager.cs │ │ │ └── IEventRegistrationPolicy.cs │ │ ├── Features │ │ │ └── FeatureValueStore.cs │ │ ├── Identity │ │ │ ├── IdentityRegistrar.cs │ │ │ ├── SecurityStampValidator.cs │ │ │ └── SignInManager.cs │ │ ├── Localization │ │ │ ├── EventCloudLocalizationConfigurer.cs │ │ │ └── SourceFiles │ │ │ │ ├── EventCloud-es.xml │ │ │ │ ├── EventCloud-fa.xml │ │ │ │ ├── EventCloud-fr.xml │ │ │ │ ├── EventCloud-it.xml │ │ │ │ ├── EventCloud-ja.xml │ │ │ │ ├── EventCloud-lt.xml │ │ │ │ ├── EventCloud-nl.xml │ │ │ │ ├── EventCloud-pt-BR.xml │ │ │ │ ├── EventCloud-tr.xml │ │ │ │ ├── EventCloud-zh-Hans.xml │ │ │ │ └── EventCloud.xml │ │ ├── MultiTenancy │ │ │ ├── Tenant.cs │ │ │ └── TenantManager.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Timing │ │ │ └── AppTimes.cs │ │ ├── Validation │ │ │ └── ValidationHelper.cs │ │ └── Web │ │ │ └── WebContentFolderHelper.cs │ ├── EventCloud.EntityFrameworkCore │ │ ├── EntityFrameworkCore │ │ │ ├── AbpZeroDbMigrator.cs │ │ │ ├── EventCloudDbContext.cs │ │ │ ├── EventCloudDbContextConfigurer.cs │ │ │ ├── EventCloudDbContextFactory.cs │ │ │ ├── EventCloudEntityFrameworkModule.cs │ │ │ ├── Repositories │ │ │ │ └── EventCloudRepositoryBase.cs │ │ │ └── Seed │ │ │ │ ├── Host │ │ │ │ ├── DefaultEditionCreator.cs │ │ │ │ ├── DefaultLanguagesCreator.cs │ │ │ │ ├── DefaultSettingsCreator.cs │ │ │ │ ├── HostRoleAndUserCreator.cs │ │ │ │ └── InitialHostDbBuilder.cs │ │ │ │ ├── SeedHelper.cs │ │ │ │ └── Tenants │ │ │ │ ├── DefaultTenantBuilder.cs │ │ │ │ └── TenantRoleAndUserBuilder.cs │ │ ├── EventCloud.EntityFrameworkCore.csproj │ │ └── Migrations │ │ │ ├── 20170424115119_Initial_Migrations.Designer.cs │ │ │ ├── 20170424115119_Initial_Migrations.cs │ │ │ ├── 20170608053244_Upgraded_To_Abp_2_1_0.Designer.cs │ │ │ ├── 20170608053244_Upgraded_To_Abp_2_1_0.cs │ │ │ ├── 20170621153937_Added_Description_And_IsActive_To_Role.Designer.cs │ │ │ ├── 20170621153937_Added_Description_And_IsActive_To_Role.cs │ │ │ ├── 20170703134115_Remove_IsActive_From_Role.Designer.cs │ │ │ ├── 20170703134115_Remove_IsActive_From_Role.cs │ │ │ ├── 20170804083601_Upgraded_To_Abp_v2.2.2.Designer.cs │ │ │ ├── 20170804083601_Upgraded_To_Abp_v2.2.2.cs │ │ │ ├── 20180201051646_Upgraded_To_Abp_v3.4.0.Designer.cs │ │ │ ├── 20180201051646_Upgraded_To_Abp_v3.4.0.cs │ │ │ ├── 20180320131229_Upgraded_To_Abp_v3_5_0.Designer.cs │ │ │ ├── 20180320131229_Upgraded_To_Abp_v3_5_0.cs │ │ │ ├── 20180509121141_Upgraded_To_Abp_v3_6_1.Designer.cs │ │ │ ├── 20180509121141_Upgraded_To_Abp_v3_6_1.cs │ │ │ ├── 20180726102703_Upgrade_ABP_3.8.0.Designer.cs │ │ │ ├── 20180726102703_Upgrade_ABP_3.8.0.cs │ │ │ ├── 20180731132139_Upgrade_ABP_3.8.1.Designer.cs │ │ │ ├── 20180731132139_Upgrade_ABP_3.8.1.cs │ │ │ ├── 20180927062608_Upgrade_ABP_3.8.3.Designer.cs │ │ │ ├── 20180927062608_Upgrade_ABP_3.8.3.cs │ │ │ ├── 20181013103914_Upgraded_To_Abp_v3_9_0.Designer.cs │ │ │ ├── 20181013103914_Upgraded_To_Abp_v3_9_0.cs │ │ │ ├── 20190208051931_Upgrade_ABP_4_2_0.Designer.cs │ │ │ ├── 20190208051931_Upgrade_ABP_4_2_0.cs │ │ │ ├── 20190703062215_Upgraded_To_Abp_4_7_0.Designer.cs │ │ │ ├── 20190703062215_Upgraded_To_Abp_4_7_0.cs │ │ │ ├── 20190719143908_Upgraded_To_Abp_4_8_0.Designer.cs │ │ │ ├── 20190719143908_Upgraded_To_Abp_4_8_0.cs │ │ │ ├── 20191216011543_Upgraded_To_Abp_5_1_0.Designer.cs │ │ │ ├── 20191216011543_Upgraded_To_Abp_5_1_0.cs │ │ │ ├── 20200220110527_Upgraded_To_Abp_5_2_0.Designer.cs │ │ │ ├── 20200220110527_Upgraded_To_Abp_5_2_0.cs │ │ │ ├── 20200320114152_Upgraded_To_Abp_5_4_0.Designer.cs │ │ │ ├── 20200320114152_Upgraded_To_Abp_5_4_0.cs │ │ │ ├── 20200604091046_Upgraded_To_Abp_5_9.Designer.cs │ │ │ ├── 20200604091046_Upgraded_To_Abp_5_9.cs │ │ │ ├── 20200928141743_Upgraded_To_ABP_5_13_0.Designer.cs │ │ │ ├── 20200928141743_Upgraded_To_ABP_5_13_0.cs │ │ │ ├── 20201112121732_Upgraded_To_ABP_6_0.Designer.cs │ │ │ ├── 20201112121732_Upgraded_To_ABP_6_0.cs │ │ │ ├── 20201217144556_Upgrade_To_ABP_6_1_1.Designer.cs │ │ │ ├── 20201217144556_Upgrade_To_ABP_6_1_1.cs │ │ │ ├── 20210324090321_Upgrade_To_ABP_6_3.Designer.cs │ │ │ ├── 20210324090321_Upgrade_To_ABP_6_3.cs │ │ │ ├── 20210628103231_Upgrade_To_ABP_6_4_rc1.Designer.cs │ │ │ ├── 20210628103231_Upgrade_To_ABP_6_4_rc1.cs │ │ │ ├── 20220622074714_Upgrade_To_ABP_7.3.Designer.cs │ │ │ ├── 20220622074714_Upgrade_To_ABP_7.3.cs │ │ │ ├── 20221213132802_Upgraded_To_Abp_8_0.Designer.cs │ │ │ ├── 20221213132802_Upgraded_To_Abp_8_0.cs │ │ │ ├── 20231227125039_Added_Event.Designer.cs │ │ │ ├── 20231227125039_Added_Event.cs │ │ │ └── EventCloudDbContextModelSnapshot.cs │ ├── EventCloud.Migrator │ │ ├── DependencyInjection │ │ │ └── ServiceCollectionRegistrar.cs │ │ ├── EventCloud.Migrator.csproj │ │ ├── EventCloudMigratorModule.cs │ │ ├── Log.cs │ │ ├── MultiTenantMigrateExecuter.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── appsettings.json │ │ └── log4net.config │ ├── EventCloud.Web.Core │ │ ├── Authentication │ │ │ ├── External │ │ │ │ ├── ExternalAuthConfiguration.cs │ │ │ │ ├── ExternalAuthManager.cs │ │ │ │ ├── ExternalAuthProviderApiBase.cs │ │ │ │ ├── ExternalAuthUserInfo.cs │ │ │ │ ├── ExternalLoginProviderInfo.cs │ │ │ │ ├── IExternalAuthConfiguration.cs │ │ │ │ ├── IExternalAuthManager.cs │ │ │ │ └── IExternalAuthProviderApi.cs │ │ │ └── JwtBearer │ │ │ │ ├── JwtTokenMiddleware.cs │ │ │ │ └── TokenAuthConfiguration.cs │ │ ├── Configuration │ │ │ └── HostingEnvironmentExtensions.cs │ │ ├── Controllers │ │ │ ├── EventCloudControllerBase.cs │ │ │ └── TokenAuthController.cs │ │ ├── EventCloud.Web.Core.csproj │ │ ├── EventCloudWebCoreModule.cs │ │ ├── Identity │ │ │ └── ExternalLoginInfoHelper.cs │ │ ├── Models │ │ │ └── TokenAuth │ │ │ │ ├── AuthenticateModel.cs │ │ │ │ └── AuthenticateResultModel.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── EventCloud.Web.Host │ │ ├── Controllers │ │ ├── AntiForgeryController.cs │ │ └── HomeController.cs │ │ ├── Dockerfile │ │ ├── EventCloud.Web.Host.csproj │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Startup │ │ ├── AuthConfigurer.cs │ │ ├── EventCloudWebHostModule.cs │ │ ├── Program.cs │ │ └── Startup.cs │ │ ├── app.config │ │ ├── appsettings.Staging.json │ │ ├── appsettings.json │ │ ├── log4net.Production.config │ │ ├── log4net.config │ │ └── wwwroot │ │ └── swagger │ │ └── ui │ │ ├── abp.js │ │ ├── abp.swagger.js │ │ └── index.html └── test │ ├── EventCloud.Tests │ ├── DependencyInjection │ │ └── ServiceCollectionRegistrar.cs │ ├── EventCloud.Tests.csproj │ ├── EventCloudTestBase.cs │ ├── EventCloudTestModule.cs │ ├── Events │ │ └── EventAppService_Tests.cs │ ├── MultiTenantFactAttribute.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Sessions │ │ └── SessionAppService_Tests.cs │ └── Users │ │ └── UserAppService_Tests.cs │ └── EventCloud.Web.Tests │ ├── Controllers │ └── HomeController_Tests.cs │ ├── EventCloud.Web.Tests.csproj │ ├── EventCloudWebTestBase.cs │ ├── EventCloudWebTestModule.cs │ └── Startup.cs └── rename.ps1 /.gitattributes: -------------------------------------------------------------------------------- 1 | **/wwwroot/lib/** linguist-vendored 2 | **/wwwroot/css/** linguist-vendored 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # IDEs and editors 4 | .vs/ 5 | obj/ 6 | bin/ 7 | aspnet-core/src/EventCloud.Web.Host/App_Data/Logs/ 8 | aspnet-core/src/EventCloud.Web.Mvc/App_Data/Logs/ 9 | aspnet-core/src/EventCloud.Migrator/Logs/Logs.txt 10 | aspnet-core/build/outputs/ 11 | aspnet-core/docker/mvc/Mvc-Logs/ 12 | 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ASP.NET Boilerplate 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Important 2 | 3 | Issues of this repository are tracked on https://github.com/aspnetboilerplate/aspnetboilerplate. Please create your issues on https://github.com/aspnetboilerplate/aspnetboilerplate/issues. 4 | 5 | # Event Cloud 6 | 7 | This is a sample Multi-Tenant application built using ASP.NET Boilerplate and module-zero. 8 | In this repository there are 2 diffrent source code of even cloud sample. 9 | One of them is developed using ASP.NET MVC, Angularjs and EntityFramewok, and the other 10 | is developed using ASP.NET Core, Angular and EntityFrameworkCore. 11 | Here are the feaures: 12 | 13 | * Anyone can create a tenant using a registration form and becomes admin of the tenant. 14 | * Anyone can register to a tenant. 15 | * Users can create events. 16 | * Users can see events and other registered users. 17 | * Users can register to events based on some policy. 18 | * Users can cancel their registration based on some policy. 19 | * Users can cancel their own events. 20 | 21 | ## Live Demo 22 | 23 | __http://eventcloud.aspnetboilerplate.com__ 24 | 25 | ![alt login form](https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/doc/WebSite/Articles/Developing-a-Multi-Tenant-SaaS-Application-with-ASP.NET-MVC-EntityFramework-AngularJs/login-page-v2.jpg) 26 | 27 | Note: You can register to __default__ tenant or create your own tenant. 28 | 29 | ## Articles 30 | 31 | There are 2 Codeproject articles explains this example deeply: 32 | 33 | ##### ASP.NET MVC, Angularjs and EntityFramework version: 34 | http://www.codeproject.com/Articles/1043326/A-Multi-Tenant-SaaS-Application-With-ASP-NET-MVC-A 35 | 36 | ##### ASP.NET Core, Angular and EntityFrameworkCore version 37 | https://www.codeproject.com/Articles/1231118/A-Multi-Tenant-SaaS-Application-With-ASP-NET-Core 38 | -------------------------------------------------------------------------------- /_screenshots/ui-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aspnetboilerplate/eventcloud/f18da077b42949c4ec613a1db85d3ef7cbc230bb/_screenshots/ui-home.png -------------------------------------------------------------------------------- /_screenshots/ui-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aspnetboilerplate/eventcloud/f18da077b42949c4ec613a1db85d3ef7cbc230bb/_screenshots/ui-login.png -------------------------------------------------------------------------------- /_screenshots/ui-user-create-modal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aspnetboilerplate/eventcloud/f18da077b42949c4ec613a1db85d3ef7cbc230bb/_screenshots/ui-user-create-modal.png -------------------------------------------------------------------------------- /angular/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /angular/.dockerignore: -------------------------------------------------------------------------------- 1 | .env 2 | .git 3 | .gitignore 4 | .vs 5 | .vscode 6 | */bin 7 | */obj 8 | */node_modules 9 | */dist 10 | */.git 11 | */.idea 12 | */.vs 13 | */.vscode 14 | **/.toolstarget 15 | -------------------------------------------------------------------------------- /angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | [*.md] 11 | max_line_length = off 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | 10 | # IDEs and editors 11 | /.idea 12 | .project 13 | .classpath 14 | .c9/ 15 | *.launch 16 | .settings/ 17 | .vs/ 18 | [Oo]bj/ 19 | bin/ 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | //.angular/cache 30 | .sass-cache 31 | /connect.lock 32 | /coverage/* 33 | /libpeerconnection.log 34 | npm-debug.log 35 | testem.log 36 | /typings 37 | 38 | # e2e 39 | /e2e/*.js 40 | /e2e/*.map 41 | 42 | #System Files 43 | .DS_Store 44 | Thumbs.db 45 | 46 | .angular -------------------------------------------------------------------------------- /angular/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "configurations": [ 4 | { 5 | "name": "Launch Chrome", 6 | "request": "launch", 7 | "type": "chrome", 8 | "url": "http://localhost:8080", 9 | "webRoot": "${workspaceFolder}" 10 | }, 11 | { 12 | "type": "chrome", 13 | "request": "launch", 14 | "name": "Launch Chrome against localhost", 15 | "url": "http://localhost:4200", 16 | "sourceMaps": true, 17 | "webRoot": "${workspaceFolder}" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /angular/Dockerfile: -------------------------------------------------------------------------------- 1 | # stage 1 2 | FROM node:14 as node 3 | WORKDIR /app 4 | COPY . . 5 | # This is a workaround to avoid updating appconfig.production.json file. 6 | # If you prefer to updating appconfig.production.json file instead of appconfig.container.json please delete this line. 7 | RUN mv ./src/assets/appconfig.container.json ./src/assets/appconfig.production.json 8 | RUN yarn install 9 | RUN yarn run ng build --configuration production 10 | # stage 2 11 | FROM nginx 12 | COPY --from=node /app/dist /usr/share/nginx/html 13 | COPY fast-nginx-default.conf /etc/nginx/conf.d/default.conf 14 | -------------------------------------------------------------------------------- /angular/EventCloud.AngularUI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0 4 | angular 5 | angular 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | PreserveNewest 17 | 18 | 19 | 20 | 21 | Always 22 | 23 | 24 | -------------------------------------------------------------------------------- /angular/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:14424/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "EventCloud.AngularUI": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /angular/README.md: -------------------------------------------------------------------------------- 1 | # EventCloudTemplate 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0-beta.31. 4 | 5 | ## Development server 6 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 7 | 8 | ## Code scaffolding 9 | 10 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`. 11 | 12 | ## Build 13 | 14 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. 15 | 16 | ## Running unit tests 17 | 18 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 19 | 20 | ## Running end-to-end tests 21 | 22 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 23 | Before running the tests make sure you are serving the app via `ng serve`. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /angular/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /angular/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { EventCloudTemplatePage } from './app.po'; 2 | 3 | describe('EventCloud App', function() { 4 | let page: EventCloudTemplatePage; 5 | 6 | beforeEach(() => { 7 | page = new EventCloudTemplatePage(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /angular/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class EventCloudTemplatePage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /angular/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "declaration": false, 5 | "experimentalDecorators": true, 6 | "lib": [ 7 | "es2016" 8 | ], 9 | "module": "commonjs", 10 | "moduleResolution": "node", 11 | "outDir": "../dist/out-tsc-e2e", 12 | "sourceMap": true, 13 | "target": "es6", 14 | "typeRoots": [ 15 | "../node_modules/@types" 16 | ], 17 | "baseUrl": ".", 18 | "paths": { 19 | "@abp/*": [ "../node_modules/abp-ng2-module/dist/src/*" ], 20 | "@app/*": [ "./app/*" ], 21 | "@shared/*": [ "./shared/*" ], 22 | "@node_modules/*": [ "../node_modules/*" ] 23 | } 24 | }, 25 | "files": [ 26 | "../src/polyfills.ts", 27 | "../src/test.ts" 28 | ], 29 | } 30 | -------------------------------------------------------------------------------- /angular/fast-nginx-default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | sendfile on; 4 | default_type application/octet-stream; 5 | 6 | gzip on; 7 | gzip_http_version 1.1; 8 | gzip_disable "MSIE [1-6]\."; 9 | gzip_min_length 256; 10 | gzip_vary on; 11 | gzip_proxied expired no-cache no-store private auth; 12 | gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; 13 | gzip_comp_level 9; 14 | 15 | root /usr/share/nginx/html; 16 | 17 | location / { 18 | try_files $uri $uri/ /index.html =404; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /angular/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/0.13/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-coverage-istanbul-reporter'), 12 | require('@angular-devkit/build-angular/plugins/karma') 13 | ], 14 | files: [ 15 | 16 | ], 17 | preprocessors: { 18 | 19 | }, 20 | mime: { 21 | 'text/x-typescript': ['ts','tsx'] 22 | }, 23 | coverageIstanbulReporter: { 24 | dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ], 25 | fixWebpackSourcePaths: true 26 | }, 27 | angularCli: { 28 | config: './.angular-cli.json', 29 | environment: 'dev' 30 | }, 31 | reporters: config.angularCli && config.angularCli.codeCoverage 32 | ? ['progress', 'coverage-istanbul'] 33 | : ['progress'], 34 | port: 9876, 35 | colors: true, 36 | logLevel: config.LOG_INFO, 37 | autoWatch: true, 38 | browsers: ['Chrome'], 39 | singleRun: false 40 | }); 41 | }; 42 | -------------------------------------------------------------------------------- /angular/nswag/refresh.bat: -------------------------------------------------------------------------------- 1 | "..\node_modules\.bin\nswag" run -------------------------------------------------------------------------------- /angular/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | /*global jasmine */ 5 | var SpecReporter = require('jasmine-spec-reporter'); 6 | 7 | exports.config = { 8 | allScriptsTimeout: 11000, 9 | specs: [ 10 | './e2e/**/*.e2e-spec.ts' 11 | ], 12 | capabilities: { 13 | 'browserName': 'chrome' 14 | }, 15 | directConnect: true, 16 | baseUrl: 'http://localhost:4200/', 17 | framework: 'jasmine', 18 | jasmineNodeOpts: { 19 | showColors: true, 20 | defaultTimeoutInterval: 30000, 21 | print: function() {} 22 | }, 23 | useAllAngular2AppRoots: true, 24 | beforeLaunch: function() { 25 | require('ts-node').register({ 26 | project: 'e2e' 27 | }); 28 | }, 29 | onPrepare: function() { 30 | jasmine.getEnv().addReporter(new SpecReporter()); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /angular/src/account/account-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | import { LoginComponent } from './login/login.component'; 4 | import { RegisterComponent } from './register/register.component'; 5 | import { AccountComponent } from './account.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | RouterModule.forChild([ 10 | { 11 | path: '', 12 | component: AccountComponent, 13 | children: [ 14 | { path: 'login', component: LoginComponent }, 15 | { path: 'register', component: RegisterComponent } 16 | ] 17 | } 18 | ]) 19 | ], 20 | exports: [ 21 | RouterModule 22 | ] 23 | }) 24 | export class AccountRoutingModule { } 25 | -------------------------------------------------------------------------------- /angular/src/account/account.component.html: -------------------------------------------------------------------------------- 1 | 
2 | 3 |
4 |
5 | 6 |
7 | 10 | 13 |
14 | 15 |
16 | -------------------------------------------------------------------------------- /angular/src/account/account.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | OnInit, 4 | ViewEncapsulation, 5 | Injector, 6 | Renderer2 7 | } from '@angular/core'; 8 | import { AppComponentBase } from '@shared/app-component-base'; 9 | 10 | @Component({ 11 | templateUrl: './account.component.html', 12 | encapsulation: ViewEncapsulation.None 13 | }) 14 | export class AccountComponent extends AppComponentBase implements OnInit { 15 | constructor(injector: Injector, private renderer: Renderer2) { 16 | super(injector); 17 | } 18 | 19 | showTenantChange(): boolean { 20 | return abp.multiTenancy.isEnabled; 21 | } 22 | 23 | ngOnInit(): void { 24 | this.renderer.addClass(document.body, 'login-page'); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /angular/src/account/layout/account-footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | Copyright © {{ currentYear }} 5 | {{ "Version" | localize }} 6 | {{ versionText }} 7 | 8 |
9 |
10 | -------------------------------------------------------------------------------- /angular/src/account/layout/account-footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Injector, ChangeDetectionStrategy } from '@angular/core'; 2 | import { AppComponentBase } from '@shared/app-component-base'; 3 | 4 | @Component({ 5 | selector: 'account-footer', 6 | templateUrl: './account-footer.component.html', 7 | changeDetection: ChangeDetectionStrategy.OnPush 8 | }) 9 | export class AccountFooterComponent extends AppComponentBase { 10 | currentYear: number; 11 | versionText: string; 12 | 13 | constructor(injector: Injector) { 14 | super(injector); 15 | 16 | this.currentYear = new Date().getFullYear(); 17 | this.versionText = 18 | this.appSession.application.version + 19 | ' [' + 20 | this.appSession.application.releaseDate.format('YYYYDDMM') + 21 | ']'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /angular/src/account/layout/account-header.component.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /angular/src/account/layout/account-header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'account-header', 5 | templateUrl: './account-header.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class AccountHeaderComponent {} 9 | -------------------------------------------------------------------------------- /angular/src/account/layout/account-languages.component.html: -------------------------------------------------------------------------------- 1 | 
2 | 3 | 8 | 14 | 15 | 16 | 17 | 18 |
19 | -------------------------------------------------------------------------------- /angular/src/account/layout/account-languages.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | OnInit, 4 | Injector, 5 | ChangeDetectionStrategy 6 | } from '@angular/core'; 7 | import { AppComponentBase } from '@shared/app-component-base'; 8 | import { filter as _filter } from 'lodash-es'; 9 | 10 | @Component({ 11 | selector: 'account-languages', 12 | templateUrl: './account-languages.component.html', 13 | changeDetection: ChangeDetectionStrategy.OnPush 14 | }) 15 | export class AccountLanguagesComponent extends AppComponentBase 16 | implements OnInit { 17 | languages: abp.localization.ILanguageInfo[]; 18 | currentLanguage: abp.localization.ILanguageInfo; 19 | 20 | constructor(injector: Injector) { 21 | super(injector); 22 | } 23 | 24 | ngOnInit() { 25 | this.languages = _filter( 26 | this.localization.languages, 27 | (l) => !l.isDisabled 28 | ); 29 | this.currentLanguage = this.localization.currentLanguage; 30 | } 31 | 32 | changeLanguage(languageName: string): void { 33 | abp.utils.setCookieValue( 34 | 'Abp.Localization.CultureName', 35 | languageName, 36 | new Date(new Date().getTime() + 5 * 365 * 86400000), // 5 year 37 | abp.appPath 38 | ); 39 | 40 | location.reload(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /angular/src/account/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Injector } from '@angular/core'; 2 | import { AbpSessionService } from 'abp-ng2-module'; 3 | import { AppComponentBase } from '@shared/app-component-base'; 4 | import { accountModuleAnimation } from '@shared/animations/routerTransition'; 5 | import { AppAuthService } from '@shared/auth/app-auth.service'; 6 | 7 | @Component({ 8 | templateUrl: './login.component.html', 9 | animations: [accountModuleAnimation()] 10 | }) 11 | export class LoginComponent extends AppComponentBase { 12 | submitting = false; 13 | 14 | constructor( 15 | injector: Injector, 16 | public authService: AppAuthService, 17 | private _sessionService: AbpSessionService 18 | ) { 19 | super(injector); 20 | } 21 | 22 | get multiTenancySideIsTeanant(): boolean { 23 | return this._sessionService.tenantId > 0; 24 | } 25 | 26 | get isSelfRegistrationAllowed(): boolean { 27 | if (!this._sessionService.tenantId) { 28 | return false; 29 | } 30 | 31 | return true; 32 | } 33 | 34 | login(): void { 35 | this.submitting = true; 36 | this.authService.authenticate(() => (this.submitting = false)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /angular/src/account/tenant/tenant-change-dialog.component.html: -------------------------------------------------------------------------------- 1 | 
7 | 11 | 32 | 37 |
38 | -------------------------------------------------------------------------------- /angular/src/account/tenant/tenant-change.component.html: -------------------------------------------------------------------------------- 1 | 
2 | 3 | {{ "CurrentTenant" | localize }}: 4 | 5 | {{ tenancyName }} 6 | 7 | {{ "NotSelected" | localize }} 8 | ( 9 | {{ "Change" | localize }} ) 11 | 12 |
13 | -------------------------------------------------------------------------------- /angular/src/account/tenant/tenant-change.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Injector } from '@angular/core'; 2 | import { AppComponentBase } from '@shared/app-component-base'; 3 | import { TenantChangeDialogComponent } from './tenant-change-dialog.component'; 4 | import { BsModalService } from 'ngx-bootstrap/modal'; 5 | 6 | @Component({ 7 | selector: 'tenant-change', 8 | templateUrl: './tenant-change.component.html' 9 | }) 10 | export class TenantChangeComponent extends AppComponentBase implements OnInit { 11 | tenancyName = ''; 12 | name = ''; 13 | 14 | constructor(injector: Injector, private _modalService: BsModalService) { 15 | super(injector); 16 | } 17 | 18 | get isMultiTenancyEnabled(): boolean { 19 | return abp.multiTenancy.isEnabled; 20 | } 21 | 22 | ngOnInit() { 23 | if (this.appSession.tenant) { 24 | this.tenancyName = this.appSession.tenant.tenancyName; 25 | this.name = this.appSession.tenant.name; 26 | } 27 | } 28 | 29 | showChangeModal(): void { 30 | const modal = this._modalService.show(TenantChangeDialogComponent); 31 | if (this.appSession.tenant) { 32 | modal.content.tenancyName = this.appSession.tenant.tenancyName; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /angular/src/app/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Injector, ChangeDetectionStrategy } from '@angular/core'; 2 | import { AppComponentBase } from '@shared/app-component-base'; 3 | import { appModuleAnimation } from '@shared/animations/routerTransition'; 4 | 5 | @Component({ 6 | templateUrl: './about.component.html', 7 | animations: [appModuleAnimation()], 8 | changeDetection: ChangeDetectionStrategy.OnPush 9 | }) 10 | export class AboutComponent extends AppComponentBase { 11 | constructor(injector: Injector) { 12 | super(injector); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /angular/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 |
7 | 8 | 9 |
10 | -------------------------------------------------------------------------------- /angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Injector, OnInit, Renderer2 } from '@angular/core'; 2 | import { AppComponentBase } from '@shared/app-component-base'; 3 | import { SignalRAspNetCoreHelper } from '@shared/helpers/SignalRAspNetCoreHelper'; 4 | import { LayoutStoreService } from '@shared/layout/layout-store.service'; 5 | 6 | @Component({ 7 | templateUrl: './app.component.html' 8 | }) 9 | export class AppComponent extends AppComponentBase implements OnInit { 10 | sidebarExpanded: boolean; 11 | 12 | constructor( 13 | injector: Injector, 14 | private renderer: Renderer2, 15 | private _layoutStore: LayoutStoreService 16 | ) { 17 | super(injector); 18 | } 19 | 20 | ngOnInit(): void { 21 | this.renderer.addClass(document.body, 'sidebar-mini'); 22 | 23 | SignalRAspNetCoreHelper.initSignalR(); 24 | 25 | abp.event.on('abp.notifications.received', (userNotification) => { 26 | abp.notifications.showUiNotifyForUserNotification(userNotification); 27 | 28 | // Desktop notification 29 | Push.create('AbpZeroTemplate', { 30 | body: userNotification.notification.data.message, 31 | icon: abp.appPath + 'assets/app-logo-small.png', 32 | timeout: 6000, 33 | onClick: function () { 34 | window.focus(); 35 | this.close(); 36 | } 37 | }); 38 | }); 39 | 40 | this._layoutStore.sidebarExpanded.subscribe((value) => { 41 | this.sidebarExpanded = value; 42 | }); 43 | } 44 | 45 | toggleSidebar(): void { 46 | this._layoutStore.setSidebarExpanded(!this.sidebarExpanded); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /angular/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Injector, ChangeDetectionStrategy } from '@angular/core'; 2 | import { AppComponentBase } from '@shared/app-component-base'; 3 | import { appModuleAnimation } from '@shared/animations/routerTransition'; 4 | 5 | @Component({ 6 | templateUrl: './home.component.html', 7 | animations: [appModuleAnimation()], 8 | changeDetection: ChangeDetectionStrategy.OnPush 9 | }) 10 | export class HomeComponent extends AppComponentBase { 11 | constructor(injector: Injector) { 12 | super(injector); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /angular/src/app/layout/footer.component.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /angular/src/app/layout/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Injector, ChangeDetectionStrategy } from '@angular/core'; 2 | import { AppComponentBase } from '@shared/app-component-base'; 3 | 4 | @Component({ 5 | selector: 'app-footer', 6 | templateUrl: './footer.component.html', 7 | changeDetection: ChangeDetectionStrategy.OnPush 8 | }) 9 | export class FooterComponent extends AppComponentBase { 10 | currentYear: number; 11 | versionText: string; 12 | 13 | constructor(injector: Injector) { 14 | super(injector); 15 | 16 | this.currentYear = new Date().getFullYear(); 17 | this.versionText = 18 | this.appSession.application.version + 19 | ' [' + 20 | this.appSession.application.releaseDate.format('YYYYDDMM') + 21 | ']'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /angular/src/app/layout/header-language-menu.component.html: -------------------------------------------------------------------------------- 1 | 22 | -------------------------------------------------------------------------------- /angular/src/app/layout/header-language-menu.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | ChangeDetectionStrategy, 4 | OnInit, 5 | Injector 6 | } from '@angular/core'; 7 | import { AppComponentBase } from '@shared/app-component-base'; 8 | import { 9 | UserServiceProxy, 10 | ChangeUserLanguageDto 11 | } from '@shared/service-proxies/service-proxies'; 12 | import { filter as _filter } from 'lodash-es'; 13 | 14 | @Component({ 15 | selector: 'header-language-menu', 16 | templateUrl: './header-language-menu.component.html', 17 | changeDetection: ChangeDetectionStrategy.OnPush 18 | }) 19 | export class HeaderLanguageMenuComponent extends AppComponentBase 20 | implements OnInit { 21 | languages: abp.localization.ILanguageInfo[]; 22 | currentLanguage: abp.localization.ILanguageInfo; 23 | 24 | constructor(injector: Injector, private _userService: UserServiceProxy) { 25 | super(injector); 26 | } 27 | 28 | ngOnInit() { 29 | this.languages = _filter( 30 | this.localization.languages, 31 | (l) => !l.isDisabled 32 | ); 33 | this.currentLanguage = this.localization.currentLanguage; 34 | } 35 | 36 | changeLanguage(languageName: string): void { 37 | const input = new ChangeUserLanguageDto(); 38 | input.languageName = languageName; 39 | 40 | this._userService.changeLanguage(input).subscribe(() => { 41 | abp.utils.setCookieValue( 42 | 'Abp.Localization.CultureName', 43 | languageName, 44 | new Date(new Date().getTime() + 5 * 365 * 86400000), // 5 year 45 | abp.appPath 46 | ); 47 | 48 | window.location.reload(); 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /angular/src/app/layout/header-left-navbar.component.html: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /angular/src/app/layout/header-left-navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core'; 2 | import { LayoutStoreService } from '@shared/layout/layout-store.service'; 3 | 4 | @Component({ 5 | selector: 'header-left-navbar', 6 | templateUrl: './header-left-navbar.component.html', 7 | changeDetection: ChangeDetectionStrategy.OnPush 8 | }) 9 | export class HeaderLeftNavbarComponent implements OnInit { 10 | sidebarExpanded: boolean; 11 | 12 | constructor(private _layoutStore: LayoutStoreService) {} 13 | 14 | ngOnInit(): void { 15 | this._layoutStore.sidebarExpanded.subscribe((value) => { 16 | this.sidebarExpanded = value; 17 | }); 18 | } 19 | 20 | toggleSidebar(): void { 21 | this._layoutStore.setSidebarExpanded(!this.sidebarExpanded); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /angular/src/app/layout/header-user-menu.component.html: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /angular/src/app/layout/header-user-menu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectionStrategy } from '@angular/core'; 2 | import { AppAuthService } from '@shared/auth/app-auth.service'; 3 | 4 | @Component({ 5 | selector: 'header-user-menu', 6 | templateUrl: './header-user-menu.component.html', 7 | changeDetection: ChangeDetectionStrategy.OnPush 8 | }) 9 | export class HeaderUserMenuComponent { 10 | constructor(private _authService: AppAuthService) {} 11 | 12 | logout(): void { 13 | this._authService.logout(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /angular/src/app/layout/header.component.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /angular/src/app/layout/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class HeaderComponent {} 9 | -------------------------------------------------------------------------------- /angular/src/app/layout/sidebar-logo.component.html: -------------------------------------------------------------------------------- 1 | 2 | Logo 8 | EventCloud 9 | 10 | -------------------------------------------------------------------------------- /angular/src/app/layout/sidebar-logo.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'sidebar-logo', 5 | templateUrl: './sidebar-logo.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class SidebarLogoComponent {} 9 | -------------------------------------------------------------------------------- /angular/src/app/layout/sidebar-user-panel.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | User Image 8 |
9 |
10 | {{ shownLoginName }} 11 |
12 |
13 | -------------------------------------------------------------------------------- /angular/src/app/layout/sidebar-user-panel.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | ChangeDetectionStrategy, 4 | Injector, 5 | OnInit 6 | } from '@angular/core'; 7 | import { AppComponentBase } from '@shared/app-component-base'; 8 | 9 | @Component({ 10 | selector: 'sidebar-user-panel', 11 | templateUrl: './sidebar-user-panel.component.html', 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class SidebarUserPanelComponent extends AppComponentBase 15 | implements OnInit { 16 | shownLoginName = ''; 17 | 18 | constructor(injector: Injector) { 19 | super(injector); 20 | } 21 | 22 | ngOnInit() { 23 | this.shownLoginName = this.appSession.getShownLoginName(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /angular/src/app/layout/sidebar.component.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /angular/src/app/layout/sidebar.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | ChangeDetectionStrategy, 4 | Renderer2, 5 | OnInit 6 | } from '@angular/core'; 7 | import { LayoutStoreService } from '@shared/layout/layout-store.service'; 8 | 9 | @Component({ 10 | // tslint:disable-next-line:component-selector 11 | selector: 'sidebar', 12 | templateUrl: './sidebar.component.html', 13 | changeDetection: ChangeDetectionStrategy.OnPush 14 | }) 15 | export class SidebarComponent implements OnInit { 16 | sidebarExpanded: boolean; 17 | 18 | constructor( 19 | private renderer: Renderer2, 20 | private _layoutStore: LayoutStoreService 21 | ) {} 22 | 23 | ngOnInit(): void { 24 | this._layoutStore.sidebarExpanded.subscribe((value) => { 25 | this.sidebarExpanded = value; 26 | this.toggleSidebar(); 27 | }); 28 | } 29 | 30 | toggleSidebar(): void { 31 | if (this.sidebarExpanded) { 32 | this.hideSidebar(); 33 | } else { 34 | this.showSidebar(); 35 | } 36 | } 37 | 38 | showSidebar(): void { 39 | this.renderer.removeClass(document.body, 'sidebar-collapse'); 40 | this.renderer.addClass(document.body, 'sidebar-open'); 41 | } 42 | 43 | hideSidebar(): void { 44 | this.renderer.removeClass(document.body, 'sidebar-open'); 45 | this.renderer.addClass(document.body, 'sidebar-collapse'); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /angular/src/app/tenants/create-tenant/create-tenant-dialog.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | Injector, 4 | OnInit, 5 | Output, 6 | EventEmitter 7 | } from '@angular/core'; 8 | import { BsModalRef } from 'ngx-bootstrap/modal'; 9 | import { AppComponentBase } from '@shared/app-component-base'; 10 | import { 11 | CreateTenantDto, 12 | TenantServiceProxy 13 | } from '@shared/service-proxies/service-proxies'; 14 | 15 | @Component({ 16 | templateUrl: 'create-tenant-dialog.component.html' 17 | }) 18 | export class CreateTenantDialogComponent extends AppComponentBase 19 | implements OnInit { 20 | saving = false; 21 | tenant: CreateTenantDto = new CreateTenantDto(); 22 | 23 | @Output() onSave = new EventEmitter(); 24 | 25 | constructor( 26 | injector: Injector, 27 | public _tenantService: TenantServiceProxy, 28 | public bsModalRef: BsModalRef 29 | ) { 30 | super(injector); 31 | } 32 | 33 | ngOnInit(): void { 34 | this.tenant.isActive = true; 35 | } 36 | 37 | save(): void { 38 | this.saving = true; 39 | 40 | this._tenantService.create(this.tenant).subscribe( 41 | () => { 42 | this.notify.info(this.l('SavedSuccessfully')); 43 | this.bsModalRef.hide(); 44 | this.onSave.emit(); 45 | }, 46 | () => { 47 | this.saving = false; 48 | } 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /angular/src/app/tenants/edit-tenant/edit-tenant-dialog.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | Injector, 4 | OnInit, 5 | Output, 6 | EventEmitter 7 | } from '@angular/core'; 8 | import { BsModalRef } from 'ngx-bootstrap/modal'; 9 | import { AppComponentBase } from '@shared/app-component-base'; 10 | import { 11 | TenantServiceProxy, 12 | TenantDto 13 | } from '@shared/service-proxies/service-proxies'; 14 | 15 | @Component({ 16 | templateUrl: 'edit-tenant-dialog.component.html' 17 | }) 18 | export class EditTenantDialogComponent extends AppComponentBase 19 | implements OnInit { 20 | saving = false; 21 | tenant: TenantDto = new TenantDto(); 22 | id: number; 23 | 24 | @Output() onSave = new EventEmitter(); 25 | 26 | constructor( 27 | injector: Injector, 28 | public _tenantService: TenantServiceProxy, 29 | public bsModalRef: BsModalRef 30 | ) { 31 | super(injector); 32 | } 33 | 34 | ngOnInit(): void { 35 | this._tenantService.get(this.id).subscribe((result: TenantDto) => { 36 | this.tenant = result; 37 | }); 38 | } 39 | 40 | save(): void { 41 | this.saving = true; 42 | 43 | this._tenantService.update(this.tenant).subscribe( 44 | () => { 45 | this.notify.info(this.l('SavedSuccessfully')); 46 | this.bsModalRef.hide(); 47 | this.onSave.emit(); 48 | }, 49 | () => { 50 | this.saving = false; 51 | } 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /angular/src/app/users/reset-password/reset-password.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Injector } from '@angular/core'; 2 | import { AppComponentBase } from '@shared/app-component-base'; 3 | import { 4 | UserServiceProxy, 5 | ResetPasswordDto 6 | } from '@shared/service-proxies/service-proxies'; 7 | import { BsModalRef } from 'ngx-bootstrap/modal'; 8 | 9 | @Component({ 10 | selector: 'app-reset-password', 11 | templateUrl: './reset-password.component.html' 12 | }) 13 | export class ResetPasswordDialogComponent extends AppComponentBase 14 | implements OnInit { 15 | public isLoading = false; 16 | public resetPasswordDto: ResetPasswordDto; 17 | id: number; 18 | 19 | constructor( 20 | injector: Injector, 21 | private _userService: UserServiceProxy, 22 | public bsModalRef: BsModalRef 23 | ) { 24 | super(injector); 25 | } 26 | 27 | ngOnInit() { 28 | this.isLoading = true; 29 | this.resetPasswordDto = new ResetPasswordDto(); 30 | this.resetPasswordDto.userId = this.id; 31 | this.resetPasswordDto.newPassword = Math.random() 32 | .toString(36) 33 | .substr(2, 10); 34 | this.isLoading = false; 35 | } 36 | 37 | public resetPassword(): void { 38 | this.isLoading = true; 39 | this._userService.resetPassword(this.resetPasswordDto).subscribe( 40 | () => { 41 | this.notify.info('Password Reset'); 42 | this.bsModalRef.hide(); 43 | }, 44 | () => { 45 | this.isLoading = false; 46 | } 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aspnetboilerplate/eventcloud/f18da077b42949c4ec613a1db85d3ef7cbc230bb/angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /angular/src/assets/abp-web-resources/abp.freeze-ui.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var abp = abp || {}; 4 | 5 | (function () { 6 | if (!FreezeUI || !UnFreezeUI) { 7 | return; 8 | } 9 | 10 | abp.ui.setBusy = function (elm, text, delay) { 11 | FreezeUI({ 12 | element: elm, 13 | text: text ? text : " ", 14 | delay: delay 15 | }); 16 | }; 17 | 18 | abp.ui.clearBusy = function (elm, delay) { 19 | UnFreezeUI({ 20 | element: elm, 21 | delay: delay 22 | }); 23 | }; 24 | })(); -------------------------------------------------------------------------------- /angular/src/assets/appconfig.container.json: -------------------------------------------------------------------------------- 1 | { 2 | "remoteServiceBaseUrl": "http://localhost:44311", 3 | "appBaseUrl": "http://localhost:4200", 4 | "localeMappings": [ 5 | { 6 | "from": "pt-BR", 7 | "to": "pt" 8 | }, 9 | { 10 | "from": "zh-CN", 11 | "to": "zh" 12 | }, 13 | { 14 | "from": "he-IL", 15 | "to": "he" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /angular/src/assets/appconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "remoteServiceBaseUrl": "https://localhost:44311", 3 | "appBaseUrl": "http://localhost:4200", 4 | "localeMappings": [ 5 | { 6 | "from": "pt-BR", 7 | "to": "pt" 8 | }, 9 | { 10 | "from": "zh-CN", 11 | "to": "zh" 12 | }, 13 | { 14 | "from": "he-IL", 15 | "to": "he" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /angular/src/assets/appconfig.production.json: -------------------------------------------------------------------------------- 1 | { 2 | "remoteServiceBaseUrl": "https://localhost:44311", 3 | "appBaseUrl": "http://localhost:4200", 4 | "localeMappings": [ 5 | { 6 | "from": "pt-BR", 7 | "to": "pt" 8 | }, 9 | { 10 | "from": "zh-CN", 11 | "to": "zh" 12 | }, 13 | { 14 | "from": "he-IL", 15 | "to": "he" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /angular/src/assets/freeze-ui/freeze-ui.css: -------------------------------------------------------------------------------- 1 | @keyframes spin { 2 | 0% { 3 | transform: translateZ(0) rotate(0); 4 | } 5 | 6 | 100% { 7 | transform: translateZ(0) rotate(360deg); 8 | } 9 | } 10 | 11 | .freeze-ui { 12 | position: fixed; 13 | top: 0; 14 | left: 0; 15 | width: 100%; 16 | height: 100%; 17 | z-index: 999999999; 18 | background-color: #fff; 19 | opacity: 0.8; 20 | transition: opacity 0.25s; 21 | } 22 | 23 | .freeze-ui.is-unfreezing { 24 | opacity: 0; 25 | } 26 | 27 | .freeze-ui:after { 28 | content: attr(data-text); 29 | display: block; 30 | max-width: 125px; 31 | position: absolute; 32 | top: 50%; 33 | left: 50%; 34 | transform: translate(-50%, -50%); 35 | font-size: 20px; 36 | font-family: sans-serif; 37 | color: #343a40; 38 | text-align: center; 39 | text-transform: uppercase; 40 | } 41 | 42 | .freeze-ui:before { 43 | content: ""; 44 | display: block; 45 | width: 75px; 46 | height: 75px; 47 | border-radius: 50%; 48 | border-width: 2px; 49 | border-style: solid; 50 | border-color: transparent #228ae6 #228ae6; 51 | position: absolute; 52 | top: calc(50% - 75px); 53 | left: calc(50% - 75px); 54 | will-change: transform; 55 | animation: spin 0.75s infinite ease-in-out; 56 | } 57 | -------------------------------------------------------------------------------- /angular/src/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aspnetboilerplate/eventcloud/f18da077b42949c4ec613a1db85d3ef7cbc230bb/angular/src/assets/img/logo.png -------------------------------------------------------------------------------- /angular/src/assets/img/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aspnetboilerplate/eventcloud/f18da077b42949c4ec613a1db85d3ef7cbc230bb/angular/src/assets/img/user.png -------------------------------------------------------------------------------- /angular/src/environments/environment.hmr.ts: -------------------------------------------------------------------------------- 1 | // "Hot Module Replacement" enabled environment 2 | 3 | export const environment = { 4 | production: false, 5 | hmr: true, 6 | appConfig: 'appconfig.json' 7 | }; 8 | -------------------------------------------------------------------------------- /angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | // "Production" enabled environment 2 | 3 | export const environment = { 4 | production: true, 5 | hmr: false, 6 | appConfig: 'appconfig.production.json' 7 | }; 8 | -------------------------------------------------------------------------------- /angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false, 8 | hmr: false, 9 | appConfig: 'appconfig.json' 10 | }; 11 | -------------------------------------------------------------------------------- /angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aspnetboilerplate/eventcloud/f18da077b42949c4ec613a1db85d3ef7cbc230bb/angular/src/favicon.ico -------------------------------------------------------------------------------- /angular/src/hmr.ts: -------------------------------------------------------------------------------- 1 | import { NgModuleRef, ApplicationRef } from '@angular/core'; 2 | import { createNewHosts } from '@angularclass/hmr'; 3 | 4 | export const hmrBootstrap = (module: any, bootstrap: () => Promise>) => { 5 | let ngModule: NgModuleRef; 6 | module.hot.accept(); 7 | bootstrap().then(mod => ngModule = mod); 8 | module.hot.dispose(() => { 9 | const appRef: ApplicationRef = ngModule.injector.get(ApplicationRef); 10 | const elements = appRef.components.map(c => c.location.nativeElement); 11 | const makeVisible = createNewHosts(elements); 12 | ngModule.destroy(); 13 | makeVisible(); 14 | }); 15 | }; 16 | -------------------------------------------------------------------------------- /angular/src/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | EventCloud 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | import { enableProdMode } from '@angular/core'; 3 | import { environment } from './environments/environment'; 4 | import { RootModule } from './root.module'; 5 | import { hmrBootstrap } from './hmr'; 6 | 7 | import 'moment/min/locales.min'; 8 | import 'moment-timezone'; 9 | 10 | if (environment.production) { 11 | enableProdMode(); 12 | } 13 | 14 | const bootstrap = () => { 15 | return platformBrowserDynamic().bootstrapModule(RootModule); 16 | }; 17 | 18 | /* "Hot Module Replacement" is enabled as described on 19 | * https://medium.com/@beeman/tutorial-enable-hrm-in-angular-cli-apps-1b0d13b80130#.sa87zkloh 20 | */ 21 | 22 | if (environment.hmr) { 23 | if (module['hot']) { 24 | hmrBootstrap(module, bootstrap); // HMR enabled bootstrap 25 | } else { 26 | console.error('HMR is not enabled for webpack-dev-server!'); 27 | console.log('Are you using the --hmr flag for ng serve?'); 28 | } 29 | } else { 30 | bootstrap(); // Regular bootstrap 31 | } 32 | -------------------------------------------------------------------------------- /angular/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | // This file includes polyfills needed by Angular 2 and is loaded before 2 | // the app. You can add your own extra polyfills to this file. 3 | import 'core-js/es/array'; 4 | import 'core-js/es/date'; 5 | import 'core-js/es/function'; 6 | import 'core-js/es/map'; 7 | import 'core-js/es/math'; 8 | import 'core-js/es/number'; 9 | import 'core-js/es/object'; 10 | import 'core-js/es/parse-float'; 11 | import 'core-js/es/parse-int'; 12 | import 'core-js/es/reflect'; 13 | import 'core-js/es/regexp'; 14 | import 'core-js/es/set'; 15 | import 'core-js/es/string'; 16 | import 'core-js/es/symbol'; 17 | import 'core-js/es/reflect'; 18 | import { finalize } from 'rxjs/operators'; 19 | import 'zone.js'; -------------------------------------------------------------------------------- /angular/src/root-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = [ 5 | { path: '', redirectTo: '/app/about', pathMatch: 'full' }, 6 | { 7 | path: 'account', 8 | loadChildren: () => import('account/account.module').then(m => m.AccountModule), // Lazy load account module 9 | data: { preload: true } 10 | }, 11 | { 12 | path: 'app', 13 | loadChildren: () => import('app/app.module').then(m => m.AppModule), // Lazy load account module 14 | data: { preload: true } 15 | } 16 | ]; 17 | 18 | @NgModule({ 19 | imports: [RouterModule.forRoot(routes)], 20 | exports: [RouterModule], 21 | providers: [] 22 | }) 23 | export class RootRoutingModule { } 24 | -------------------------------------------------------------------------------- /angular/src/root.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | template: `` 6 | }) 7 | export class RootComponent { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /angular/src/shared/AppConsts.ts: -------------------------------------------------------------------------------- 1 | export class AppConsts { 2 | 3 | static readonly tenancyNamePlaceHolderInUrl = '{TENANCY_NAME}'; 4 | 5 | static remoteServiceBaseUrl: string; 6 | static appBaseUrl: string; 7 | static appBaseHref: string; // returns angular's base-href parameter value if used during the publish 8 | 9 | static localeMappings: any = []; 10 | 11 | static readonly userManagement = { 12 | defaultAdminUserName: 'admin' 13 | }; 14 | 15 | static readonly localization = { 16 | defaultLocalizationSourceName: 'EventCloud' 17 | }; 18 | 19 | static readonly authorization = { 20 | encryptedAuthTokenName: 'enc_auth_token' 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /angular/src/shared/AppEnums.ts: -------------------------------------------------------------------------------- 1 | import { TenantAvailabilityState } from '@shared/service-proxies/service-proxies'; 2 | 3 | 4 | export class AppTenantAvailabilityState { 5 | static Available: number = TenantAvailabilityState._1; 6 | static InActive: number = TenantAvailabilityState._2; 7 | static NotFound: number = TenantAvailabilityState._3; 8 | } 9 | -------------------------------------------------------------------------------- /angular/src/shared/animations/routerTransition.ts: -------------------------------------------------------------------------------- 1 | import { trigger, state, animate, style, transition } from '@angular/animations'; 2 | 3 | export function appModuleAnimation() { 4 | return slideFromBottom(); 5 | } 6 | 7 | export function accountModuleAnimation() { 8 | return slideFromUp(); 9 | } 10 | 11 | export function slideFromBottom() { 12 | return trigger('routerTransition', [ 13 | state('void', style({ 'padding-top': '20px', opacity: '0' })), 14 | state('*', style({ 'padding-top': '0px', opacity: '1' })), 15 | transition(':enter', [ 16 | animate('0.33s ease-out', style({ opacity: '1', 'padding-top': '0px' })) 17 | ]) 18 | ]); 19 | } 20 | 21 | export function slideFromUp() { 22 | return trigger('routerTransition', [ 23 | state('void', style({ 'margin-top': '10px', opacity: '0' })), 24 | state('*', style({ 'margin-top': '0px', opacity: '1' })), 25 | transition(':enter', [ 26 | animate('0.3s ease-out', style({ opacity: '1', 'margin-top': '0px' })) 27 | ]) 28 | ]); 29 | } 30 | -------------------------------------------------------------------------------- /angular/src/shared/auth/auth-route-guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { PermissionCheckerService } from 'abp-ng2-module'; 3 | import { AppSessionService } from '../session/app-session.service'; 4 | 5 | import { Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 6 | 7 | @Injectable() 8 | export class AppRouteGuard { 9 | 10 | constructor( 11 | private _permissionChecker: PermissionCheckerService, 12 | private _router: Router, 13 | private _sessionService: AppSessionService, 14 | ) { } 15 | 16 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { 17 | if (!this._sessionService.user) { 18 | this._router.navigate(['/account/login']); 19 | return false; 20 | } 21 | 22 | if (!route.data || !route.data['permission']) { 23 | return true; 24 | } 25 | 26 | if (this._permissionChecker.isGranted(route.data['permission'])) { 27 | return true; 28 | } 29 | 30 | this._router.navigate([this.selectBestRoute()]); 31 | return false; 32 | } 33 | 34 | canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { 35 | return this.canActivate(route, state); 36 | } 37 | 38 | selectBestRoute(): string { 39 | if (!this._sessionService.user) { 40 | return '/account/login'; 41 | } 42 | 43 | if (this._permissionChecker.isGranted('Pages.Users')) { 44 | return '/app/admin/users'; 45 | } 46 | 47 | return '/app/home'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /angular/src/shared/components/modal/abp-modal-footer.component.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /angular/src/shared/components/modal/abp-modal-footer.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | Input, 4 | Output, 5 | EventEmitter, 6 | ChangeDetectionStrategy, 7 | Injector 8 | } from '@angular/core'; 9 | import { AppComponentBase } from '@shared/app-component-base'; 10 | 11 | @Component({ 12 | selector: 'abp-modal-footer', 13 | templateUrl: './abp-modal-footer.component.html', 14 | changeDetection: ChangeDetectionStrategy.OnPush 15 | }) 16 | export class AbpModalFooterComponent extends AppComponentBase { 17 | @Input() cancelLabel = this.l('Cancel'); 18 | @Input() cancelDisabled: boolean; 19 | @Input() saveLabel = this.l('Save'); 20 | @Input() saveDisabled: boolean; 21 | 22 | @Output() onCancelClick = new EventEmitter(); 23 | 24 | constructor(injector: Injector) { 25 | super(injector); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /angular/src/shared/components/modal/abp-modal-header.component.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /angular/src/shared/components/modal/abp-modal-header.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | Input, 4 | Output, 5 | EventEmitter, 6 | ChangeDetectionStrategy, 7 | Injector 8 | } from '@angular/core'; 9 | import { AppComponentBase } from '@shared/app-component-base'; 10 | 11 | @Component({ 12 | selector: 'abp-modal-header', 13 | templateUrl: './abp-modal-header.component.html', 14 | changeDetection: ChangeDetectionStrategy.OnPush 15 | }) 16 | export class AbpModalHeaderComponent extends AppComponentBase { 17 | @Input() title: string; 18 | 19 | @Output() onCloseClick = new EventEmitter(); 20 | 21 | constructor(injector: Injector) { 22 | super(injector); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /angular/src/shared/components/pagination/abp-pagination-controls.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, Output, EventEmitter } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'abp-pagination-controls', 5 | templateUrl: './abp-pagination-controls.component.html' 6 | }) 7 | export class AbpPaginationControlsComponent { 8 | 9 | @Input() id: string; 10 | @Input() maxSize = 7; 11 | @Input() previousLabel = 'Previous'; 12 | @Input() nextLabel = 'Next'; 13 | @Input() screenReaderPaginationLabel = 'Pagination'; 14 | @Input() screenReaderPageLabel = 'page'; 15 | @Input() screenReaderCurrentLabel = `You're on page`; 16 | @Output() pageChange: EventEmitter = new EventEmitter(); 17 | 18 | private _directionLinks = true; 19 | private _autoHide = false; 20 | 21 | @Input() 22 | get directionLinks(): boolean { 23 | return this._directionLinks; 24 | } 25 | set directionLinks(value: boolean) { 26 | this._directionLinks = !!value && value !== 'false'; 27 | } 28 | @Input() 29 | get autoHide(): boolean { 30 | return this._autoHide; 31 | } 32 | set autoHide(value: boolean) { 33 | this._autoHide = !!value && value !== 'false'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /angular/src/shared/components/validation/abp-validation.api.ts: -------------------------------------------------------------------------------- 1 | export interface AbpValidationError { 2 | name: string; 3 | localizationKey: string; 4 | propertyKey: string; 5 | } 6 | -------------------------------------------------------------------------------- /angular/src/shared/components/validation/abp-validation.summary.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | {{ getValidationErrorMessage(validationError) }} 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /angular/src/shared/directives/busy.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, ElementRef, Input } from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: '[busy]', 5 | }) 6 | export class BusyDirective { 7 | 8 | constructor(private _element: ElementRef) { } 9 | 10 | @Input() set busy(isBusy: boolean) { 11 | this.refreshState(isBusy); 12 | } 13 | 14 | refreshState(isBusy: boolean): void { 15 | if (isBusy === undefined) { 16 | return; 17 | } 18 | 19 | if (isBusy) { 20 | abp.ui.setBusy(this._element.nativeElement); 21 | } else { 22 | abp.ui.clearBusy(this._element.nativeElement); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /angular/src/shared/helpers/SignalRAspNetCoreHelper.ts: -------------------------------------------------------------------------------- 1 | import { AppConsts } from '@shared/AppConsts'; 2 | import { UtilsService } from 'abp-ng2-module'; 3 | 4 | export class SignalRAspNetCoreHelper { 5 | static initSignalR(callback?: () => void): void { 6 | const encryptedAuthToken = new UtilsService().getCookieValue(AppConsts.authorization.encryptedAuthTokenName); 7 | 8 | abp.signalr = { 9 | autoConnect: true, 10 | connect: undefined, 11 | hubs: undefined, 12 | qs: AppConsts.authorization.encryptedAuthTokenName + '=' + encodeURIComponent(encryptedAuthToken), 13 | remoteServiceBaseUrl: AppConsts.remoteServiceBaseUrl, 14 | startConnection: undefined, 15 | url: '/signalr', 16 | withUrlOptions: {} 17 | }; 18 | 19 | const script = document.createElement('script'); 20 | if (callback) { 21 | script.onload = () => { 22 | callback(); 23 | }; 24 | } 25 | script.src = AppConsts.appBaseUrl + '/assets/abp/abp.signalr-client.js'; 26 | document.head.appendChild(script); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /angular/src/shared/helpers/SubdomainTenancyNameFinder.ts: -------------------------------------------------------------------------------- 1 | import { AppConsts } from '@shared/AppConsts'; 2 | import { FormattedStringValueExtracter } from '@shared/helpers/FormattedStringValueExtracter'; 3 | 4 | export class SubdomainTenancyNameFinder { 5 | urlHasTenancyNamePlaceholder(url: string): boolean { 6 | return url.indexOf(AppConsts.tenancyNamePlaceHolderInUrl) >= 0; 7 | } 8 | 9 | getCurrentTenancyNameOrNull(rootAddress: string): string | null { 10 | if (rootAddress.indexOf(AppConsts.tenancyNamePlaceHolderInUrl) < 0) { 11 | // Web site does not support subdomain tenant name 12 | return null; 13 | } 14 | 15 | const currentRootAddress = document.location.href; 16 | 17 | const formattedStringValueExtracter = new FormattedStringValueExtracter(); 18 | const values: any[] = formattedStringValueExtracter.IsMatch(currentRootAddress, rootAddress); 19 | if (!values.length) { 20 | return null; 21 | } 22 | 23 | return values[0]; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /angular/src/shared/helpers/UrlHelper.ts: -------------------------------------------------------------------------------- 1 | export class UrlHelper { 2 | /** 3 | * The URL requested, before initial routing. 4 | */ 5 | static readonly initialUrl = location.href; 6 | 7 | static getQueryParameters(): any { 8 | return document.location.search 9 | .replace(/(^\?)/, '') 10 | .split('&') 11 | .map(function (n) { return n = n.split('='), this[n[0]] = n[1], this; }.bind({}))[0]; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /angular/src/shared/layout/layout-config.ts: -------------------------------------------------------------------------------- 1 | export class LayoutConfig { 2 | sidebarExpanded?: boolean; 3 | } 4 | -------------------------------------------------------------------------------- /angular/src/shared/layout/layout-store.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { BehaviorSubject, Observable } from 'rxjs'; 3 | import { distinctUntilChanged, pluck } from 'rxjs/operators'; 4 | import { LayoutConfig } from './layout-config'; 5 | 6 | @Injectable() 7 | export class LayoutStoreService { 8 | public readonly config$: Observable; 9 | private readonly initialLayoutConfig: LayoutConfig = { 10 | sidebarExpanded: false 11 | }; 12 | private configSource: BehaviorSubject; 13 | 14 | constructor() { 15 | this.configSource = new BehaviorSubject(this.initialLayoutConfig); 16 | this.config$ = this.configSource.asObservable(); 17 | } 18 | 19 | get sidebarExpanded(): Observable { 20 | return this.config$.pipe( 21 | pluck('sidebarExpanded'), 22 | distinctUntilChanged() 23 | ) as Observable; 24 | } 25 | 26 | public setSidebarExpanded(value: boolean): void { 27 | this.configSource.next( 28 | Object.assign(this.configSource.value, { sidebarExpanded: value }) 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /angular/src/shared/layout/menu-item.ts: -------------------------------------------------------------------------------- 1 | export class MenuItem { 2 | id: number; 3 | parentId: number; 4 | label: string; 5 | route: string; 6 | icon: string; 7 | permissionName: string; 8 | isActive?: boolean; 9 | isCollapsed?: boolean; 10 | children: MenuItem[]; 11 | 12 | constructor( 13 | label: string, 14 | route: string, 15 | icon: string, 16 | permissionName: string = null, 17 | children: MenuItem[] = null 18 | ) { 19 | this.label = label; 20 | this.route = route; 21 | this.icon = icon; 22 | this.permissionName = permissionName; 23 | this.children = children; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /angular/src/shared/multi-tenancy/tenant-resolvers/query-string-tenant-resolver.ts: -------------------------------------------------------------------------------- 1 | import { UrlHelper } from '../../helpers/UrlHelper'; 2 | 3 | export class QueryStringTenantResolver { 4 | 5 | resolve(appBaseUrl): string { 6 | let queryParams = UrlHelper.getQueryParameters(); 7 | console.log('queryParams'); 8 | console.log(queryParams); 9 | return queryParams['abp_tenancy_name']; 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /angular/src/shared/multi-tenancy/tenant-resolvers/subdomain-tenant-resolver.ts: -------------------------------------------------------------------------------- 1 | import { SubdomainTenancyNameFinder } from '@shared/helpers/SubdomainTenancyNameFinder'; 2 | 3 | export class SubdomainTenantResolver { 4 | 5 | resolve(appBaseUrl): string { 6 | const subdomainTenancyNameFinder = new SubdomainTenancyNameFinder(); 7 | return subdomainTenancyNameFinder.getCurrentTenancyNameOrNull(appBaseUrl); 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /angular/src/shared/pipes/localize.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Injector, Pipe, PipeTransform } from '@angular/core'; 2 | import { AppComponentBase } from '@shared/app-component-base'; 3 | 4 | @Pipe({ 5 | name: 'localize' 6 | }) 7 | export class LocalizePipe extends AppComponentBase implements PipeTransform { 8 | 9 | constructor(injector: Injector) { 10 | super(injector); 11 | } 12 | 13 | transform(key: string, ...args: any[]): string { 14 | return this.l(key, ...args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /angular/src/shared/service-proxies/service-proxy.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { HTTP_INTERCEPTORS } from '@angular/common/http'; 3 | import { AbpHttpInterceptor } from 'abp-ng2-module'; 4 | 5 | import * as ApiServiceProxies from './service-proxies'; 6 | 7 | @NgModule({ 8 | providers: [ 9 | ApiServiceProxies.RoleServiceProxy, 10 | ApiServiceProxies.SessionServiceProxy, 11 | ApiServiceProxies.TenantServiceProxy, 12 | ApiServiceProxies.UserServiceProxy, 13 | ApiServiceProxies.TokenAuthServiceProxy, 14 | ApiServiceProxies.AccountServiceProxy, 15 | ApiServiceProxies.ConfigurationServiceProxy, 16 | ApiServiceProxies.EventServiceProxy, 17 | { provide: HTTP_INTERCEPTORS, useClass: AbpHttpInterceptor, multi: true } 18 | ] 19 | }) 20 | export class ServiceProxyModule { } 21 | -------------------------------------------------------------------------------- /angular/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare var __karma__: any; 17 | 18 | // Prevent Karma from running prematurely. 19 | __karma__.loaded = function () {}; 20 | 21 | // First, initialize the Angular testing environment. 22 | getTestBed().initTestEnvironment( 23 | BrowserDynamicTestingModule, 24 | platformBrowserDynamicTesting(), { 25 | teardown: { destroyAfterEach: false } 26 | } 27 | ); 28 | // Finally, start Karma to run the tests. 29 | __karma__.start(); 30 | -------------------------------------------------------------------------------- /angular/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "files": ["main.ts", "polyfills.ts"], 4 | "include": ["src/**/*.d.ts", "typings.d.ts"] 5 | } -------------------------------------------------------------------------------- /angular/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": false, 4 | "downlevelIteration": true, 5 | "experimentalDecorators": true, 6 | "lib": [ "es6", "dom" ], 7 | "mapRoot": "./", 8 | "module": "esnext", 9 | "skipLibCheck": true, 10 | "moduleResolution": "node", 11 | "outDir": "../dist/out-tsc", 12 | "sourceMap": true, 13 | "target": "es2015", 14 | "typeRoots": [ 15 | "../node_modules/@types" 16 | ], 17 | "baseUrl": ".", 18 | "paths": { 19 | "@abp/*": [ "../node_modules/abp-ng2-module/dist/src/*" ], 20 | "@app/*": [ "./app/*" ], 21 | "@shared/*": [ "./shared/*" ], 22 | "@node_modules/*": [ "../node_modules/*" ], 23 | "@angular/*": ["../node_modules/@angular/*"], 24 | } 25 | }, 26 | "files": [ 27 | "main.ts", 28 | "polyfills.ts" 29 | ], 30 | "include": [ 31 | "src/**/*.d.ts", 32 | "typings.d.ts" 33 | ], 34 | "angularCompilerOptions": { 35 | "fullTemplateTypeCheck": true, 36 | "strictTemplates": true, 37 | "strictInputTypes": false, 38 | "strictAttributeTypes": false, 39 | "strictOutputEventTypes": false, 40 | "strictDomEventTypes": false, 41 | "strictLiteralTypes": false, 42 | "strictInjectionParameters": false 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /angular/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "files": ["test.ts", "polyfills.ts"], 4 | "include": ["src/**/*.d.ts", "typings.d.ts", "src/**/*.spec.ts", "**/*.spec.ts"] 5 | } -------------------------------------------------------------------------------- /angular/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | // Typings reference file, see links for more information 6 | // https://github.com/typings/typings 7 | // https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html 8 | 9 | declare var System: any; 10 | declare var Push: any; 11 | 12 | declare namespace abp { 13 | namespace ui { 14 | function setBusy(elm?: any, text?: any, delay?: any): void; 15 | function clearBusy(elm?: any, delay?: any): void; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 5 | */ 6 | { 7 | "files": [], 8 | "references": [ 9 | { 10 | "path": "./src/tsconfig.app.json" 11 | }, 12 | { 13 | "path": "./src/tsconfig.spec.json" 14 | } 15 | ], 16 | "include": ["src/**/*.ts"], 17 | } -------------------------------------------------------------------------------- /angular/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /aspnet-core/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md 26 | -------------------------------------------------------------------------------- /aspnet-core/build/build-with-ng.ps1: -------------------------------------------------------------------------------- 1 | echo " Welcome to docker build" 2 | echo "" 3 | echo "" 4 | 5 | $ABP_HOST="abp/host" 6 | $ABP_HOST_DOCKERFILE_PATH="src/EventCloud.Web.Host/Dockerfile" 7 | $ABP_NG="abp/ng" 8 | 9 | cd .. 10 | echo " Building docker image $ABP_HOST..." 11 | docker build -t $ABP_HOST -f $ABP_HOST_DOCKERFILE_PATH . 12 | echo " Done. -- Building docker image $ABP_HOST..." 13 | echo "" 14 | echo "" 15 | 16 | # echo " Pushing docker image $ABP_HOST..." 17 | # docker push $ABP_HOST 18 | # echo " Done. -- Pushing docker image $ABP_HOST..." 19 | # echo "" 20 | # echo "" 21 | 22 | cd .. 23 | cd angular/ 24 | echo " Building docker image $ABP_NG..." 25 | docker build -t $ABP_NG -f Dockerfile . 26 | echo " Done. -- Building docker image $ABP_NG..." 27 | echo "" 28 | echo "" 29 | 30 | # echo " Pushing docker image $ABP_NG..." 31 | # docker push $ABP_NG 32 | # echo " Done. -- Pushing docker image $ABP_NG..." 33 | # echo "" 34 | # echo "" 35 | -------------------------------------------------------------------------------- /aspnet-core/build/build-with-ng.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo " Welcome to docker build" 3 | echo "" 4 | echo "" 5 | 6 | ABP_HOST="abp/host" 7 | ABP_NG="abp/ng" 8 | 9 | cd .. 10 | echo " Building docker image $ABP_HOST..." 11 | docker build -t $ABP_HOST . 12 | echo " Done. -- Building docker image $ABP_HOST..." 13 | echo "" 14 | echo "" 15 | 16 | # echo " Pushing docker image $ABP_HOST..." 17 | # docker push $ABP_HOST 18 | # echo " Done. -- Pushing docker image $ABP_HOST..." 19 | # echo "" 20 | # echo "" 21 | 22 | cd .. 23 | cd angular/ 24 | echo " Building docker image $ABP_NG..." 25 | docker build -t $ABP_NG -f Dockerfile . 26 | echo " Done. -- Building docker image $ABP_NG..." 27 | echo "" 28 | echo "" 29 | 30 | # echo " Pushing docker image $ABP_NG..." 31 | # docker push $ABP_NG 32 | # echo " Done. -- Pushing docker image $ABP_NG..." 33 | # echo "" 34 | # echo "" 35 | -------------------------------------------------------------------------------- /aspnet-core/docker/ng/.gitignore: -------------------------------------------------------------------------------- 1 | Host-Logs/ -------------------------------------------------------------------------------- /aspnet-core/docker/ng/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | abp_host: 6 | image: abp/host 7 | environment: 8 | ASPNETCORE_ENVIRONMENT: "Staging" 9 | ConnectionStrings__Default: "Server=10.0.75.1; Database=EventCloudDb; User=EventCloudUser; Password=YourStrongPassword;TrustServerCertificate=True;" 10 | App__ServerRootAddress: "http://localhost:44311/" 11 | App__ClientRootAddress: "http://localhost:4200/" 12 | App__CorsOrigins: "http://localhost:4200" 13 | TZ: "America/Toronto" 14 | Kestrel__Endpoints__Http__Url: "http://+:80" 15 | ports: 16 | - "44311:80" 17 | volumes: 18 | - "./Host-Logs:/app/App_Data/Logs" 19 | restart: always 20 | 21 | abp_ng: 22 | image: abp/ng 23 | ports: 24 | - "4200:80" 25 | -------------------------------------------------------------------------------- /aspnet-core/docker/ng/down.ps1: -------------------------------------------------------------------------------- 1 | docker-compose down -v --rmi local -------------------------------------------------------------------------------- /aspnet-core/docker/ng/up.ps1: -------------------------------------------------------------------------------- 1 | docker-compose up -d -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Authorization/Accounts/Dto/IsTenantAvailableInput.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Abp.MultiTenancy; 3 | 4 | namespace EventCloud.Authorization.Accounts.Dto 5 | { 6 | public class IsTenantAvailableInput 7 | { 8 | [Required] 9 | [StringLength(AbpTenantBase.MaxTenancyNameLength)] 10 | public string TenancyName { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Authorization/Accounts/Dto/IsTenantAvailableOutput.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Authorization.Accounts.Dto 2 | { 3 | public class IsTenantAvailableOutput 4 | { 5 | public TenantAvailabilityState State { get; set; } 6 | 7 | public int? TenantId { get; set; } 8 | 9 | public IsTenantAvailableOutput() 10 | { 11 | } 12 | 13 | public IsTenantAvailableOutput(TenantAvailabilityState state, int? tenantId = null) 14 | { 15 | State = state; 16 | TenantId = tenantId; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Authorization/Accounts/Dto/RegisterInput.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | using Abp.Auditing; 4 | using Abp.Authorization.Users; 5 | using Abp.Extensions; 6 | using EventCloud.Validation; 7 | 8 | namespace EventCloud.Authorization.Accounts.Dto 9 | { 10 | public class RegisterInput : IValidatableObject 11 | { 12 | [Required] 13 | [StringLength(AbpUserBase.MaxNameLength)] 14 | public string Name { get; set; } 15 | 16 | [Required] 17 | [StringLength(AbpUserBase.MaxSurnameLength)] 18 | public string Surname { get; set; } 19 | 20 | [Required] 21 | [StringLength(AbpUserBase.MaxUserNameLength)] 22 | public string UserName { get; set; } 23 | 24 | [Required] 25 | [EmailAddress] 26 | [StringLength(AbpUserBase.MaxEmailAddressLength)] 27 | public string EmailAddress { get; set; } 28 | 29 | [Required] 30 | [StringLength(AbpUserBase.MaxPlainPasswordLength)] 31 | [DisableAuditing] 32 | public string Password { get; set; } 33 | 34 | [DisableAuditing] 35 | public string CaptchaResponse { get; set; } 36 | 37 | public IEnumerable Validate(ValidationContext validationContext) 38 | { 39 | if (!UserName.IsNullOrEmpty()) 40 | { 41 | if (!UserName.Equals(EmailAddress) && ValidationHelper.IsEmail(UserName)) 42 | { 43 | yield return new ValidationResult("Username cannot be an email address unless it's the same as your email address!"); 44 | } 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Authorization/Accounts/Dto/RegisterOutput.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Authorization.Accounts.Dto 2 | { 3 | public class RegisterOutput 4 | { 5 | public bool CanLogin { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Authorization/Accounts/Dto/TenantAvailabilityState.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Authorization.Accounts.Dto 2 | { 3 | public enum TenantAvailabilityState 4 | { 5 | Available = 1, 6 | InActive, 7 | NotFound 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Authorization/Accounts/IAccountAppService.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Abp.Application.Services; 3 | using EventCloud.Authorization.Accounts.Dto; 4 | 5 | namespace EventCloud.Authorization.Accounts 6 | { 7 | public interface IAccountAppService : IApplicationService 8 | { 9 | Task IsTenantAvailable(IsTenantAvailableInput input); 10 | 11 | Task Register(RegisterInput input); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Configuration/ConfigurationAppService.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Abp.Authorization; 3 | using Abp.Runtime.Session; 4 | using EventCloud.Configuration.Dto; 5 | 6 | namespace EventCloud.Configuration 7 | { 8 | [AbpAuthorize] 9 | public class ConfigurationAppService : EventCloudAppServiceBase, IConfigurationAppService 10 | { 11 | public async Task ChangeUiTheme(ChangeUiThemeInput input) 12 | { 13 | await SettingManager.ChangeSettingForUserAsync(AbpSession.ToUserIdentifier(), AppSettingNames.UiTheme, input.Theme); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Configuration/Dto/ChangeUiThemeInput.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace EventCloud.Configuration.Dto 4 | { 5 | public class ChangeUiThemeInput 6 | { 7 | [Required] 8 | [StringLength(32)] 9 | public string Theme { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Configuration/IConfigurationAppService.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using EventCloud.Configuration.Dto; 3 | 4 | namespace EventCloud.Configuration 5 | { 6 | public interface IConfigurationAppService 7 | { 8 | Task ChangeUiTheme(ChangeUiThemeInput input); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Configuration/Ui/UiThemeInfo.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Configuration.Ui 2 | { 3 | public class UiThemeInfo 4 | { 5 | public string Name { get; } 6 | public string CssClass { get; } 7 | 8 | public UiThemeInfo(string name, string cssClass) 9 | { 10 | Name = name; 11 | CssClass = cssClass; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Configuration/Ui/UiThemes.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace EventCloud.Configuration.Ui 4 | { 5 | public static class UiThemes 6 | { 7 | public static List All { get; } 8 | 9 | static UiThemes() 10 | { 11 | All = new List 12 | { 13 | new UiThemeInfo("Red", "red"), 14 | new UiThemeInfo("Pink", "pink"), 15 | new UiThemeInfo("Purple", "purple"), 16 | new UiThemeInfo("Deep Purple", "deep-purple"), 17 | new UiThemeInfo("Indigo", "indigo"), 18 | new UiThemeInfo("Blue", "blue"), 19 | new UiThemeInfo("Light Blue", "light-blue"), 20 | new UiThemeInfo("Cyan", "cyan"), 21 | new UiThemeInfo("Teal", "teal"), 22 | new UiThemeInfo("Green", "green"), 23 | new UiThemeInfo("Light Green", "light-green"), 24 | new UiThemeInfo("Lime", "lime"), 25 | new UiThemeInfo("Yellow", "yellow"), 26 | new UiThemeInfo("Amber", "amber"), 27 | new UiThemeInfo("Orange", "orange"), 28 | new UiThemeInfo("Deep Orange", "deep-orange"), 29 | new UiThemeInfo("Brown", "brown"), 30 | new UiThemeInfo("Grey", "grey"), 31 | new UiThemeInfo("Blue Grey", "blue-grey"), 32 | new UiThemeInfo("Black", "black") 33 | }; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/EventCloud.Application.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1.0.0.0 4 | net8.0 5 | $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; 6 | EventCloud.Application 7 | EventCloud.Application 8 | false 9 | false 10 | false 11 | EventCloud 12 | true 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/EventCloudAppServiceBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.Identity; 4 | using Abp.Application.Services; 5 | using Abp.IdentityFramework; 6 | using Abp.Runtime.Session; 7 | using EventCloud.Authorization.Users; 8 | using EventCloud.MultiTenancy; 9 | 10 | namespace EventCloud 11 | { 12 | /// 13 | /// Derive your application services from this class. 14 | /// 15 | public abstract class EventCloudAppServiceBase : ApplicationService 16 | { 17 | public TenantManager TenantManager { get; set; } 18 | 19 | public UserManager UserManager { get; set; } 20 | 21 | protected EventCloudAppServiceBase() 22 | { 23 | LocalizationSourceName = EventCloudConsts.LocalizationSourceName; 24 | } 25 | 26 | protected virtual async Task GetCurrentUserAsync() 27 | { 28 | var user = await UserManager.FindByIdAsync(AbpSession.GetUserId().ToString()); 29 | if (user == null) 30 | { 31 | throw new Exception("There is no current user!"); 32 | } 33 | 34 | return user; 35 | } 36 | 37 | protected virtual Task GetCurrentTenantAsync() 38 | { 39 | return TenantManager.GetByIdAsync(AbpSession.GetTenantId()); 40 | } 41 | 42 | protected virtual void CheckErrors(IdentityResult identityResult) 43 | { 44 | identityResult.CheckErrors(LocalizationManager); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/EventCloudApplicationModule.cs: -------------------------------------------------------------------------------- 1 | using Abp.AutoMapper; 2 | using Abp.Modules; 3 | using Abp.Reflection.Extensions; 4 | using EventCloud.Authorization; 5 | 6 | namespace EventCloud 7 | { 8 | [DependsOn( 9 | typeof(EventCloudCoreModule), 10 | typeof(AbpAutoMapperModule))] 11 | public class EventCloudApplicationModule : AbpModule 12 | { 13 | public override void PreInitialize() 14 | { 15 | Configuration.Authorization.Providers.Add(); 16 | } 17 | 18 | public override void Initialize() 19 | { 20 | var thisAssembly = typeof(EventCloudApplicationModule).GetAssembly(); 21 | 22 | IocManager.RegisterAssemblyByConvention(thisAssembly); 23 | 24 | Configuration.Modules.AbpAutoMapper().Configurators.Add( 25 | // Scan the assembly for classes which inherit from AutoMapper.Profile 26 | cfg => cfg.AddMaps(thisAssembly) 27 | ); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Events/Dto/CreateEventInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace EventCloud.Events.Dto 5 | { 6 | public class CreateEventInput 7 | { 8 | [Required] 9 | [StringLength(Event.MaxTitleLength)] 10 | public string Title { get; set; } 11 | 12 | [StringLength(Event.MaxDescriptionLength)] 13 | public string Description { get; set; } 14 | 15 | public DateTime Date { get; set; } 16 | 17 | [Range(0, int.MaxValue)] 18 | public int MaxRegistrationCount { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Events/Dto/EventDetailOutput.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services.Dto; 2 | using Abp.AutoMapper; 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace EventCloud.Events.Dto 7 | { 8 | [AutoMapFrom(typeof(Event))] 9 | public class EventDetailOutput : FullAuditedEntityDto 10 | { 11 | public string Title { get; set; } 12 | 13 | public string Description { get; set; } 14 | 15 | public DateTime Date { get; set; } 16 | 17 | public bool IsCancelled { get; set; } 18 | 19 | public virtual int MaxRegistrationCount { get; protected set; } 20 | 21 | public int RegistrationsCount { get; set; } 22 | 23 | public ICollection Registrations { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Events/Dto/EventListDto.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services.Dto; 2 | using Abp.AutoMapper; 3 | using System; 4 | 5 | namespace EventCloud.Events.Dto 6 | { 7 | [AutoMapFrom(typeof(Event))] 8 | public class EventListDto : FullAuditedEntityDto 9 | { 10 | public string Title { get; set; } 11 | 12 | public string Description { get; set; } 13 | 14 | public DateTime Date { get; set; } 15 | 16 | public bool IsCancelled { get; set; } 17 | 18 | public virtual int MaxRegistrationCount { get; protected set; } 19 | 20 | public int RegistrationsCount { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Events/Dto/EventRegisterOutput.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Events.Dto 2 | { 3 | public class EventRegisterOutput 4 | { 5 | public int RegistrationId { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Events/Dto/EventRegistrationDto.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services.Dto; 2 | using Abp.AutoMapper; 3 | using System; 4 | 5 | namespace EventCloud.Events.Dto 6 | { 7 | [AutoMapFrom(typeof(EventRegistration))] 8 | public class EventRegistrationDto : CreationAuditedEntityDto 9 | { 10 | public virtual Guid EventId { get; protected set; } 11 | 12 | public virtual long UserId { get; protected set; } 13 | 14 | public virtual string UserName { get; protected set; } 15 | 16 | public virtual string UserSurname { get; protected set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Events/Dto/GetEventListInput.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Events.Dto 2 | { 3 | public class GetEventListInput 4 | { 5 | public bool IncludeCanceledEvents { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Events/IEventAppService.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services; 2 | using Abp.Application.Services.Dto; 3 | using EventCloud.Events.Dto; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace EventCloud.Events 11 | { 12 | public interface IEventAppService : IApplicationService 13 | { 14 | Task> GetListAsync(GetEventListInput input); 15 | 16 | Task GetDetailAsync(EntityDto input); 17 | 18 | Task CreateAsync(CreateEventInput input); 19 | 20 | Task CancelAsync(EntityDto input); 21 | 22 | Task RegisterAsync(EntityDto input); 23 | 24 | Task CancelRegistrationAsync(EntityDto input); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/MultiTenancy/Dto/CreateTenantDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Abp.Authorization.Users; 3 | using Abp.AutoMapper; 4 | using Abp.MultiTenancy; 5 | 6 | namespace EventCloud.MultiTenancy.Dto 7 | { 8 | [AutoMapTo(typeof(Tenant))] 9 | public class CreateTenantDto 10 | { 11 | [Required] 12 | [StringLength(AbpTenantBase.MaxTenancyNameLength)] 13 | [RegularExpression(AbpTenantBase.TenancyNameRegex)] 14 | public string TenancyName { get; set; } 15 | 16 | [Required] 17 | [StringLength(AbpTenantBase.MaxNameLength)] 18 | public string Name { get; set; } 19 | 20 | [Required] 21 | [StringLength(AbpUserBase.MaxEmailAddressLength)] 22 | public string AdminEmailAddress { get; set; } 23 | 24 | [StringLength(AbpTenantBase.MaxConnectionStringLength)] 25 | public string ConnectionString { get; set; } 26 | 27 | public bool IsActive {get; set;} 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/MultiTenancy/Dto/PagedTenantResultRequestDto.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services.Dto; 2 | 3 | namespace EventCloud.MultiTenancy.Dto 4 | { 5 | public class PagedTenantResultRequestDto : PagedResultRequestDto 6 | { 7 | public string Keyword { get; set; } 8 | public bool? IsActive { get; set; } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/MultiTenancy/Dto/TenantDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Abp.Application.Services.Dto; 3 | using Abp.AutoMapper; 4 | using Abp.MultiTenancy; 5 | 6 | namespace EventCloud.MultiTenancy.Dto 7 | { 8 | [AutoMapFrom(typeof(Tenant))] 9 | public class TenantDto : EntityDto 10 | { 11 | [Required] 12 | [StringLength(AbpTenantBase.MaxTenancyNameLength)] 13 | [RegularExpression(AbpTenantBase.TenancyNameRegex)] 14 | public string TenancyName { get; set; } 15 | 16 | [Required] 17 | [StringLength(AbpTenantBase.MaxNameLength)] 18 | public string Name { get; set; } 19 | 20 | public bool IsActive {get; set;} 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/MultiTenancy/ITenantAppService.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services; 2 | using EventCloud.MultiTenancy.Dto; 3 | 4 | namespace EventCloud.MultiTenancy 5 | { 6 | public interface ITenantAppService : IAsyncCrudAppService 7 | { 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("EventCloud.Application")] 10 | [assembly: AssemblyTrademark("")] 11 | 12 | // Setting ComVisible to false makes the types in this assembly not visible 13 | // to COM components. If you need to access a type in this assembly from 14 | // COM, set the ComVisible attribute to true on that type. 15 | [assembly: ComVisible(false)] 16 | 17 | // The following GUID is for the ID of the typelib if this project is exposed to COM 18 | [assembly: Guid("3870c648-4aea-4b85-ba3f-f2f63b96136a")] 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/CreateRoleDto.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | using Abp.Authorization.Roles; 4 | using EventCloud.Authorization.Roles; 5 | 6 | namespace EventCloud.Roles.Dto 7 | { 8 | public class CreateRoleDto 9 | { 10 | [Required] 11 | [StringLength(AbpRoleBase.MaxNameLength)] 12 | public string Name { get; set; } 13 | 14 | [Required] 15 | [StringLength(AbpRoleBase.MaxDisplayNameLength)] 16 | public string DisplayName { get; set; } 17 | 18 | public string NormalizedName { get; set; } 19 | 20 | [StringLength(Role.MaxDescriptionLength)] 21 | public string Description { get; set; } 22 | 23 | public List GrantedPermissions { get; set; } 24 | 25 | public CreateRoleDto() 26 | { 27 | GrantedPermissions = new List(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/FlatPermissionDto.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Roles.Dto 2 | { 3 | public class FlatPermissionDto 4 | { 5 | public string Name { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | 9 | public string Description { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/GetRoleForEditOutput.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace EventCloud.Roles.Dto 4 | { 5 | public class GetRoleForEditOutput 6 | { 7 | public RoleEditDto Role { get; set; } 8 | 9 | public List Permissions { get; set; } 10 | 11 | public List GrantedPermissionNames { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/GetRolesInput.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Roles.Dto 2 | { 3 | public class GetRolesInput 4 | { 5 | public string Permission { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/PagedRoleResultRequestDto.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services.Dto; 2 | 3 | namespace EventCloud.Roles.Dto 4 | { 5 | public class PagedRoleResultRequestDto : PagedResultRequestDto 6 | { 7 | public string Keyword { get; set; } 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/PermissionDto.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services.Dto; 2 | using Abp.AutoMapper; 3 | using Abp.Authorization; 4 | 5 | namespace EventCloud.Roles.Dto 6 | { 7 | [AutoMapFrom(typeof(Permission))] 8 | public class PermissionDto : EntityDto 9 | { 10 | public string Name { get; set; } 11 | 12 | public string DisplayName { get; set; } 13 | 14 | public string Description { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/RoleDto.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | using Abp.Application.Services.Dto; 4 | using Abp.Authorization.Roles; 5 | using Abp.AutoMapper; 6 | using EventCloud.Authorization.Roles; 7 | 8 | namespace EventCloud.Roles.Dto 9 | { 10 | public class RoleDto : EntityDto 11 | { 12 | [Required] 13 | [StringLength(AbpRoleBase.MaxNameLength)] 14 | public string Name { get; set; } 15 | 16 | [Required] 17 | [StringLength(AbpRoleBase.MaxDisplayNameLength)] 18 | public string DisplayName { get; set; } 19 | 20 | public string NormalizedName { get; set; } 21 | 22 | [StringLength(Role.MaxDescriptionLength)] 23 | public string Description { get; set; } 24 | 25 | public List GrantedPermissions { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/RoleEditDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Abp.Application.Services.Dto; 3 | using Abp.Authorization.Roles; 4 | using EventCloud.Authorization.Roles; 5 | 6 | namespace EventCloud.Roles.Dto 7 | { 8 | public class RoleEditDto: EntityDto 9 | { 10 | [Required] 11 | [StringLength(AbpRoleBase.MaxNameLength)] 12 | public string Name { get; set; } 13 | 14 | [Required] 15 | [StringLength(AbpRoleBase.MaxDisplayNameLength)] 16 | public string DisplayName { get; set; } 17 | 18 | [StringLength(Role.MaxDescriptionLength)] 19 | public string Description { get; set; } 20 | 21 | public bool IsStatic { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/RoleListDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Abp.Application.Services.Dto; 3 | using Abp.Domain.Entities.Auditing; 4 | 5 | namespace EventCloud.Roles.Dto 6 | { 7 | public class RoleListDto : EntityDto, IHasCreationTime 8 | { 9 | public string Name { get; set; } 10 | 11 | public string DisplayName { get; set; } 12 | 13 | public bool IsStatic { get; set; } 14 | 15 | public bool IsDefault { get; set; } 16 | 17 | public DateTime CreationTime { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/Dto/RoleMapProfile.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using AutoMapper; 3 | using Abp.Authorization; 4 | using Abp.Authorization.Roles; 5 | using EventCloud.Authorization.Roles; 6 | 7 | namespace EventCloud.Roles.Dto 8 | { 9 | public class RoleMapProfile : Profile 10 | { 11 | public RoleMapProfile() 12 | { 13 | // Role and permission 14 | CreateMap().ConvertUsing(r => r.Name); 15 | CreateMap().ConvertUsing(r => r.Name); 16 | 17 | CreateMap(); 18 | 19 | CreateMap(); 20 | 21 | CreateMap().ForMember(x => x.GrantedPermissions, 22 | opt => opt.MapFrom(x => x.Permissions.Where(p => p.IsGranted))); 23 | 24 | CreateMap(); 25 | CreateMap(); 26 | CreateMap(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Roles/IRoleAppService.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Abp.Application.Services; 3 | using Abp.Application.Services.Dto; 4 | using EventCloud.Roles.Dto; 5 | 6 | namespace EventCloud.Roles 7 | { 8 | public interface IRoleAppService : IAsyncCrudAppService 9 | { 10 | Task> GetAllPermissions(); 11 | 12 | Task GetRoleForEdit(EntityDto input); 13 | 14 | Task> GetRolesAsync(GetRolesInput input); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Sessions/Dto/ApplicationInfoDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace EventCloud.Sessions.Dto 5 | { 6 | public class ApplicationInfoDto 7 | { 8 | public string Version { get; set; } 9 | 10 | public DateTime ReleaseDate { get; set; } 11 | 12 | public Dictionary Features { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Sessions/Dto/GetCurrentLoginInformationsOutput.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Sessions.Dto 2 | { 3 | public class GetCurrentLoginInformationsOutput 4 | { 5 | public ApplicationInfoDto Application { get; set; } 6 | 7 | public UserLoginInfoDto User { get; set; } 8 | 9 | public TenantLoginInfoDto Tenant { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Sessions/Dto/TenantLoginInfoDto.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services.Dto; 2 | using Abp.AutoMapper; 3 | using EventCloud.MultiTenancy; 4 | 5 | namespace EventCloud.Sessions.Dto 6 | { 7 | [AutoMapFrom(typeof(Tenant))] 8 | public class TenantLoginInfoDto : EntityDto 9 | { 10 | public string TenancyName { get; set; } 11 | 12 | public string Name { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Sessions/Dto/UserLoginInfoDto.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services.Dto; 2 | using Abp.AutoMapper; 3 | using EventCloud.Authorization.Users; 4 | 5 | namespace EventCloud.Sessions.Dto 6 | { 7 | [AutoMapFrom(typeof(User))] 8 | public class UserLoginInfoDto : EntityDto 9 | { 10 | public string Name { get; set; } 11 | 12 | public string Surname { get; set; } 13 | 14 | public string UserName { get; set; } 15 | 16 | public string EmailAddress { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Sessions/ISessionAppService.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Abp.Application.Services; 3 | using EventCloud.Sessions.Dto; 4 | 5 | namespace EventCloud.Sessions 6 | { 7 | public interface ISessionAppService : IApplicationService 8 | { 9 | Task GetCurrentLoginInformations(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Sessions/SessionAppService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using Abp.Auditing; 4 | using EventCloud.Sessions.Dto; 5 | 6 | namespace EventCloud.Sessions 7 | { 8 | public class SessionAppService : EventCloudAppServiceBase, ISessionAppService 9 | { 10 | [DisableAuditing] 11 | public async Task GetCurrentLoginInformations() 12 | { 13 | var output = new GetCurrentLoginInformationsOutput 14 | { 15 | Application = new ApplicationInfoDto 16 | { 17 | Version = AppVersionHelper.Version, 18 | ReleaseDate = AppVersionHelper.ReleaseDate, 19 | Features = new Dictionary() 20 | } 21 | }; 22 | 23 | if (AbpSession.TenantId.HasValue) 24 | { 25 | output.Tenant = ObjectMapper.Map(await GetCurrentTenantAsync()); 26 | } 27 | 28 | if (AbpSession.UserId.HasValue) 29 | { 30 | output.User = ObjectMapper.Map(await GetCurrentUserAsync()); 31 | } 32 | 33 | return output; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Users/Dto/ChangePasswordDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace EventCloud.Users.Dto 4 | { 5 | public class ChangePasswordDto 6 | { 7 | [Required] 8 | public string CurrentPassword { get; set; } 9 | 10 | [Required] 11 | public string NewPassword { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Users/Dto/ChangeUserLanguageDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace EventCloud.Users.Dto 4 | { 5 | public class ChangeUserLanguageDto 6 | { 7 | [Required] 8 | public string LanguageName { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Users/Dto/CreateUserDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Abp.Auditing; 3 | using Abp.Authorization.Users; 4 | using Abp.AutoMapper; 5 | using Abp.Runtime.Validation; 6 | using EventCloud.Authorization.Users; 7 | 8 | namespace EventCloud.Users.Dto 9 | { 10 | [AutoMapTo(typeof(User))] 11 | public class CreateUserDto : IShouldNormalize 12 | { 13 | [Required] 14 | [StringLength(AbpUserBase.MaxUserNameLength)] 15 | public string UserName { get; set; } 16 | 17 | [Required] 18 | [StringLength(AbpUserBase.MaxNameLength)] 19 | public string Name { get; set; } 20 | 21 | [Required] 22 | [StringLength(AbpUserBase.MaxSurnameLength)] 23 | public string Surname { get; set; } 24 | 25 | [Required] 26 | [EmailAddress] 27 | [StringLength(AbpUserBase.MaxEmailAddressLength)] 28 | public string EmailAddress { get; set; } 29 | 30 | public bool IsActive { get; set; } 31 | 32 | public string[] RoleNames { get; set; } 33 | 34 | [Required] 35 | [StringLength(AbpUserBase.MaxPlainPasswordLength)] 36 | [DisableAuditing] 37 | public string Password { get; set; } 38 | 39 | public void Normalize() 40 | { 41 | if (RoleNames == null) 42 | { 43 | RoleNames = new string[0]; 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Users/Dto/PagedUserResultRequestDto.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Services.Dto; 2 | using System; 3 | 4 | namespace EventCloud.Users.Dto 5 | { 6 | //custom PagedResultRequestDto 7 | public class PagedUserResultRequestDto : PagedResultRequestDto 8 | { 9 | public string Keyword { get; set; } 10 | public bool? IsActive { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Users/Dto/ResetPasswordDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace EventCloud.Users.Dto 4 | { 5 | public class ResetPasswordDto 6 | { 7 | [Required] 8 | public string AdminPassword { get; set; } 9 | 10 | [Required] 11 | public long UserId { get; set; } 12 | 13 | [Required] 14 | public string NewPassword { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Users/Dto/UserDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using Abp.Application.Services.Dto; 4 | using Abp.Authorization.Users; 5 | using Abp.AutoMapper; 6 | using EventCloud.Authorization.Users; 7 | 8 | namespace EventCloud.Users.Dto 9 | { 10 | [AutoMapFrom(typeof(User))] 11 | public class UserDto : EntityDto 12 | { 13 | [Required] 14 | [StringLength(AbpUserBase.MaxUserNameLength)] 15 | public string UserName { get; set; } 16 | 17 | [Required] 18 | [StringLength(AbpUserBase.MaxNameLength)] 19 | public string Name { get; set; } 20 | 21 | [Required] 22 | [StringLength(AbpUserBase.MaxSurnameLength)] 23 | public string Surname { get; set; } 24 | 25 | [Required] 26 | [EmailAddress] 27 | [StringLength(AbpUserBase.MaxEmailAddressLength)] 28 | public string EmailAddress { get; set; } 29 | 30 | public bool IsActive { get; set; } 31 | 32 | public string FullName { get; set; } 33 | 34 | public DateTime? LastLoginTime { get; set; } 35 | 36 | public DateTime CreationTime { get; set; } 37 | 38 | public string[] RoleNames { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Users/Dto/UserMapProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using EventCloud.Authorization.Users; 3 | 4 | namespace EventCloud.Users.Dto 5 | { 6 | public class UserMapProfile : Profile 7 | { 8 | public UserMapProfile() 9 | { 10 | CreateMap(); 11 | CreateMap() 12 | .ForMember(x => x.Roles, opt => opt.Ignore()) 13 | .ForMember(x => x.CreationTime, opt => opt.Ignore()); 14 | 15 | CreateMap(); 16 | CreateMap().ForMember(x => x.Roles, opt => opt.Ignore()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Application/Users/IUserAppService.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Abp.Application.Services; 3 | using Abp.Application.Services.Dto; 4 | using EventCloud.Roles.Dto; 5 | using EventCloud.Users.Dto; 6 | 7 | namespace EventCloud.Users 8 | { 9 | public interface IUserAppService : IAsyncCrudAppService 10 | { 11 | Task DeActivate(EntityDto user); 12 | Task Activate(EntityDto user); 13 | Task> GetRoles(); 14 | Task ChangeLanguage(ChangeUserLanguageDto input); 15 | 16 | Task ChangePassword(ChangePasswordDto input); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/AppVersionHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Abp.Reflection.Extensions; 4 | 5 | namespace EventCloud 6 | { 7 | /// 8 | /// Central point for application version. 9 | /// 10 | public class AppVersionHelper 11 | { 12 | /// 13 | /// Gets current version of the application. 14 | /// It's also shown in the web page. 15 | /// 16 | public const string Version = "8.0.0.0"; 17 | 18 | /// 19 | /// Gets release (last build) date of the application. 20 | /// It's shown in the web page. 21 | /// 22 | public static DateTime ReleaseDate => LzyReleaseDate.Value; 23 | 24 | private static readonly Lazy LzyReleaseDate = new Lazy(() => new FileInfo(typeof(AppVersionHelper).GetAssembly().Location).LastWriteTime); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/EventCloudAuthorizationProvider.cs: -------------------------------------------------------------------------------- 1 | using Abp.Authorization; 2 | using Abp.Localization; 3 | using Abp.MultiTenancy; 4 | 5 | namespace EventCloud.Authorization 6 | { 7 | public class EventCloudAuthorizationProvider : AuthorizationProvider 8 | { 9 | public override void SetPermissions(IPermissionDefinitionContext context) 10 | { 11 | context.CreatePermission(PermissionNames.Pages_Users, L("Users")); 12 | context.CreatePermission(PermissionNames.Pages_Users_Activation, L("UsersActivation")); 13 | context.CreatePermission(PermissionNames.Pages_Roles, L("Roles")); 14 | context.CreatePermission(PermissionNames.Pages_Events, L("Events"), multiTenancySides: MultiTenancySides.Tenant); 15 | context.CreatePermission(PermissionNames.Pages_Tenants, L("Tenants"), multiTenancySides: MultiTenancySides.Host); 16 | } 17 | 18 | private static ILocalizableString L(string name) 19 | { 20 | return new LocalizableString(name, EventCloudConsts.LocalizationSourceName); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/LoginManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using Abp.Authorization; 3 | using Abp.Authorization.Users; 4 | using Abp.Configuration; 5 | using Abp.Configuration.Startup; 6 | using Abp.Dependency; 7 | using Abp.Domain.Repositories; 8 | using Abp.Domain.Uow; 9 | using Abp.Zero.Configuration; 10 | using EventCloud.Authorization.Roles; 11 | using EventCloud.Authorization.Users; 12 | using EventCloud.MultiTenancy; 13 | 14 | namespace EventCloud.Authorization 15 | { 16 | public class LogInManager : AbpLogInManager 17 | { 18 | public LogInManager( 19 | UserManager userManager, 20 | IMultiTenancyConfig multiTenancyConfig, 21 | IRepository tenantRepository, 22 | IUnitOfWorkManager unitOfWorkManager, 23 | ISettingManager settingManager, 24 | IRepository userLoginAttemptRepository, 25 | IUserManagementConfig userManagementConfig, 26 | IIocResolver iocResolver, 27 | IPasswordHasher passwordHasher, 28 | RoleManager roleManager, 29 | UserClaimsPrincipalFactory claimsPrincipalFactory) 30 | : base( 31 | userManager, 32 | multiTenancyConfig, 33 | tenantRepository, 34 | unitOfWorkManager, 35 | settingManager, 36 | userLoginAttemptRepository, 37 | userManagementConfig, 38 | iocResolver, 39 | passwordHasher, 40 | roleManager, 41 | claimsPrincipalFactory) 42 | { 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/PermissionChecker.cs: -------------------------------------------------------------------------------- 1 | using Abp.Authorization; 2 | using EventCloud.Authorization.Roles; 3 | using EventCloud.Authorization.Users; 4 | 5 | namespace EventCloud.Authorization 6 | { 7 | public class PermissionChecker : PermissionChecker 8 | { 9 | public PermissionChecker(UserManager userManager) 10 | : base(userManager) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/PermissionNames.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Authorization 2 | { 3 | public static class PermissionNames 4 | { 5 | public const string Pages_Tenants = "Pages.Tenants"; 6 | 7 | public const string Pages_Users = "Pages.Users"; 8 | public const string Pages_Users_Activation = "Pages.Users.Activation"; 9 | 10 | public const string Pages_Roles = "Pages.Roles"; 11 | public const string Pages_Events = "Pages.Events"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/Roles/AppRoleConfig.cs: -------------------------------------------------------------------------------- 1 | using Abp.MultiTenancy; 2 | using Abp.Zero.Configuration; 3 | 4 | namespace EventCloud.Authorization.Roles 5 | { 6 | public static class AppRoleConfig 7 | { 8 | public static void Configure(IRoleManagementConfig roleManagementConfig) 9 | { 10 | // Static host roles 11 | 12 | roleManagementConfig.StaticRoles.Add( 13 | new StaticRoleDefinition( 14 | StaticRoleNames.Host.Admin, 15 | MultiTenancySides.Host 16 | ) 17 | ); 18 | 19 | // Static tenant roles 20 | 21 | roleManagementConfig.StaticRoles.Add( 22 | new StaticRoleDefinition( 23 | StaticRoleNames.Tenants.Admin, 24 | MultiTenancySides.Tenant 25 | ) 26 | ); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/Roles/Role.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Abp.Authorization.Roles; 3 | using EventCloud.Authorization.Users; 4 | 5 | namespace EventCloud.Authorization.Roles 6 | { 7 | public class Role : AbpRole 8 | { 9 | public const int MaxDescriptionLength = 5000; 10 | 11 | public Role() 12 | { 13 | } 14 | 15 | public Role(int? tenantId, string displayName) 16 | : base(tenantId, displayName) 17 | { 18 | } 19 | 20 | public Role(int? tenantId, string name, string displayName) 21 | : base(tenantId, name, displayName) 22 | { 23 | } 24 | 25 | [StringLength(MaxDescriptionLength)] 26 | public string Description {get; set;} 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/Roles/RoleManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.AspNetCore.Identity; 3 | using Microsoft.Extensions.Logging; 4 | using Abp.Authorization; 5 | using Abp.Authorization.Roles; 6 | using Abp.Domain.Repositories; 7 | using Abp.Domain.Uow; 8 | using Abp.Organizations; 9 | using Abp.Runtime.Caching; 10 | using Abp.Zero.Configuration; 11 | using EventCloud.Authorization.Users; 12 | 13 | namespace EventCloud.Authorization.Roles 14 | { 15 | public class RoleManager : AbpRoleManager 16 | { 17 | public RoleManager( 18 | RoleStore store, 19 | IEnumerable> roleValidators, 20 | ILookupNormalizer keyNormalizer, 21 | IdentityErrorDescriber errors, 22 | ILogger> logger, 23 | IPermissionManager permissionManager, 24 | ICacheManager cacheManager, 25 | IUnitOfWorkManager unitOfWorkManager, 26 | IRoleManagementConfig roleManagementConfig, 27 | IRepository organizationUnitRepository, 28 | IRepository organizationUnitRoleRepository) 29 | : base( 30 | store, 31 | roleValidators, 32 | keyNormalizer, 33 | errors, logger, 34 | permissionManager, 35 | cacheManager, 36 | unitOfWorkManager, 37 | roleManagementConfig, 38 | organizationUnitRepository, 39 | organizationUnitRoleRepository) 40 | { 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/Roles/RoleStore.cs: -------------------------------------------------------------------------------- 1 | using Abp.Authorization.Roles; 2 | using Abp.Domain.Repositories; 3 | using Abp.Domain.Uow; 4 | using EventCloud.Authorization.Users; 5 | 6 | namespace EventCloud.Authorization.Roles 7 | { 8 | public class RoleStore : AbpRoleStore 9 | { 10 | public RoleStore( 11 | IUnitOfWorkManager unitOfWorkManager, 12 | IRepository roleRepository, 13 | IRepository rolePermissionSettingRepository) 14 | : base( 15 | unitOfWorkManager, 16 | roleRepository, 17 | rolePermissionSettingRepository) 18 | { 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/Roles/StaticRoleNames.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Authorization.Roles 2 | { 3 | public static class StaticRoleNames 4 | { 5 | public static class Host 6 | { 7 | public const string Admin = "Admin"; 8 | } 9 | 10 | public static class Tenants 11 | { 12 | public const string Admin = "Admin"; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/Users/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Abp.Authorization.Users; 4 | using Abp.Extensions; 5 | 6 | namespace EventCloud.Authorization.Users 7 | { 8 | public class User : AbpUser 9 | { 10 | public const string DefaultPassword = "123qwe"; 11 | 12 | public static string CreateRandomPassword() 13 | { 14 | return Guid.NewGuid().ToString("N").Truncate(16); 15 | } 16 | 17 | public static User CreateTenantAdminUser(int tenantId, string emailAddress) 18 | { 19 | var user = new User 20 | { 21 | TenantId = tenantId, 22 | UserName = AdminUserName, 23 | Name = AdminUserName, 24 | Surname = AdminUserName, 25 | EmailAddress = emailAddress, 26 | Roles = new List() 27 | }; 28 | 29 | user.SetNormalizedNames(); 30 | 31 | return user; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/Users/UserClaimsPrincipalFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using Microsoft.Extensions.Options; 3 | using Abp.Authorization; 4 | using EventCloud.Authorization.Roles; 5 | using Abp.Domain.Uow; 6 | 7 | namespace EventCloud.Authorization.Users 8 | { 9 | public class UserClaimsPrincipalFactory : AbpUserClaimsPrincipalFactory 10 | { 11 | public UserClaimsPrincipalFactory( 12 | UserManager userManager, 13 | RoleManager roleManager, 14 | IOptions optionsAccessor, 15 | IUnitOfWorkManager unitOfWorkManager) 16 | : base( 17 | userManager, 18 | roleManager, 19 | optionsAccessor, 20 | unitOfWorkManager) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Authorization/Users/UserStore.cs: -------------------------------------------------------------------------------- 1 | using Abp.Authorization.Users; 2 | using Abp.Domain.Repositories; 3 | using Abp.Domain.Uow; 4 | using Abp.Linq; 5 | using Abp.Organizations; 6 | using EventCloud.Authorization.Roles; 7 | 8 | namespace EventCloud.Authorization.Users 9 | { 10 | public class UserStore : AbpUserStore 11 | { 12 | public UserStore( 13 | IUnitOfWorkManager unitOfWorkManager, 14 | IRepository userRepository, 15 | IRepository roleRepository, 16 | IRepository userRoleRepository, 17 | IRepository userLoginRepository, 18 | IRepository userClaimRepository, 19 | IRepository userPermissionSettingRepository, 20 | IRepository userOrganizationUnitRepository, 21 | IRepository organizationUnitRoleRepository, 22 | IRepository userTokenRepository 23 | ) 24 | : base(unitOfWorkManager, 25 | userRepository, 26 | roleRepository, 27 | userRoleRepository, 28 | userLoginRepository, 29 | userClaimRepository, 30 | userPermissionSettingRepository, 31 | userOrganizationUnitRepository, 32 | organizationUnitRoleRepository, 33 | userTokenRepository 34 | ) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Configuration/AppSettingNames.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Configuration 2 | { 3 | public static class AppSettingNames 4 | { 5 | public const string UiTheme = "App.UiTheme"; 6 | public const string MaxAllowedEventRegistrationCountInLast30DaysPerUser = "EventCloud.MaxAllowedEventRegistrationCountInLast30DaysPerUser"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Configuration/AppSettingProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Abp.Configuration; 3 | 4 | namespace EventCloud.Configuration 5 | { 6 | public class AppSettingProvider : SettingProvider 7 | { 8 | public override IEnumerable GetSettingDefinitions(SettingDefinitionProviderContext context) 9 | { 10 | return new[] 11 | { 12 | new SettingDefinition(AppSettingNames.UiTheme, "red", scopes: SettingScopes.Application | SettingScopes.Tenant | SettingScopes.User, clientVisibilityProvider: new VisibleSettingClientVisibilityProvider()), 13 | new SettingDefinition( 14 | AppSettingNames.MaxAllowedEventRegistrationCountInLast30DaysPerUser, 15 | defaultValue: "10", 16 | scopes: SettingScopes.Tenant), 17 | }; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Debugging/DebugHelper.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Debugging 2 | { 3 | public static class DebugHelper 4 | { 5 | public static bool IsDebug 6 | { 7 | get 8 | { 9 | #pragma warning disable 10 | #if DEBUG 11 | return true; 12 | #endif 13 | return false; 14 | #pragma warning restore 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Domain/Events/DomainEvents.cs: -------------------------------------------------------------------------------- 1 | using Abp.Events.Bus; 2 | 3 | namespace EventCloud.Domain.Events 4 | { 5 | public static class DomainEvents 6 | { 7 | public static IEventBus EventBus { get; set; } 8 | 9 | static DomainEvents() 10 | { 11 | EventBus = Abp.Events.Bus.EventBus.Default; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Editions/EditionManager.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Editions; 2 | using Abp.Application.Features; 3 | using Abp.Domain.Repositories; 4 | using Abp.Domain.Uow; 5 | 6 | namespace EventCloud.Editions 7 | { 8 | public class EditionManager : AbpEditionManager 9 | { 10 | public const string DefaultEditionName = "Standard"; 11 | 12 | public EditionManager( 13 | IRepository editionRepository, 14 | IAbpZeroFeatureValueStore featureValueStore, 15 | IUnitOfWorkManager unitOfWorkManager) 16 | : base(editionRepository, featureValueStore, unitOfWorkManager) 17 | { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/EventCloud.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1.0.0.0 4 | net8.0 5 | $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; 6 | EventCloud.Core 7 | EventCloud.Core 8 | false 9 | false 10 | false 11 | AbpCompanyName-EventCloud-56C2EF2F-ABD6-4EFC-AAF2-2E81C34E8FB1 12 | EventCloud 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/EventCloudConsts.cs: -------------------------------------------------------------------------------- 1 | using EventCloud.Debugging; 2 | 3 | namespace EventCloud 4 | { 5 | public class EventCloudConsts 6 | { 7 | public const string LocalizationSourceName = "EventCloud"; 8 | 9 | public const string ConnectionStringName = "Default"; 10 | 11 | public const bool MultiTenancyEnabled = true; 12 | 13 | 14 | /// 15 | /// Default pass phrase for SimpleStringCipher decrypt/encrypt operations 16 | /// 17 | public static readonly string DefaultPassPhrase = 18 | DebugHelper.IsDebug ? "gsKxGZ012HLL3MI5" : "2035f7a651644a59be7a1fd0bdc5e692"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Events/EventCancelledEvent.cs: -------------------------------------------------------------------------------- 1 | using Abp.Events.Bus.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace EventCloud.Events 9 | { 10 | public class EventCancelledEvent : EntityEventData 11 | { 12 | public EventCancelledEvent(Event entity) 13 | : base(entity) 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Events/EventDateChangedEvent.cs: -------------------------------------------------------------------------------- 1 | using Abp.Events.Bus.Entities; 2 | 3 | namespace EventCloud.Events 4 | { 5 | public class EventDateChangedEvent : EntityEventData 6 | { 7 | public EventDateChangedEvent(Event entity) 8 | : base(entity) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Events/IEventManager.cs: -------------------------------------------------------------------------------- 1 | using Abp.Domain.Services; 2 | using EventCloud.Authorization.Users; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace EventCloud.Events 10 | { 11 | public interface IEventManager : IDomainService 12 | { 13 | Task GetAsync(Guid id); 14 | 15 | Task CreateAsync(Event @event); 16 | 17 | void Cancel(Event @event); 18 | 19 | Task RegisterAsync(Event @event, User user); 20 | 21 | Task CancelRegistrationAsync(Event @event, User user); 22 | 23 | Task> GetRegisteredUsersAsync(Event @event); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Events/IEventRegistrationPolicy.cs: -------------------------------------------------------------------------------- 1 | using Abp.Domain.Services; 2 | using EventCloud.Authorization.Users; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace EventCloud.Events 10 | { 11 | public interface IEventRegistrationPolicy : IDomainService 12 | { 13 | /// 14 | /// Checks if given user can register to and throws exception if can not. 15 | /// 16 | Task CheckRegistrationAttemptAsync(Event @event, User user); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Features/FeatureValueStore.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Features; 2 | using Abp.Domain.Repositories; 3 | using Abp.Domain.Uow; 4 | using Abp.MultiTenancy; 5 | using Abp.Runtime.Caching; 6 | using EventCloud.Authorization.Users; 7 | using EventCloud.MultiTenancy; 8 | 9 | namespace EventCloud.Features 10 | { 11 | public class FeatureValueStore : AbpFeatureValueStore 12 | { 13 | public FeatureValueStore( 14 | ICacheManager cacheManager, 15 | IRepository tenantFeatureRepository, 16 | IRepository tenantRepository, 17 | IRepository editionFeatureRepository, 18 | IFeatureManager featureManager, 19 | IUnitOfWorkManager unitOfWorkManager) 20 | : base( 21 | cacheManager, 22 | tenantFeatureRepository, 23 | tenantRepository, 24 | editionFeatureRepository, 25 | featureManager, 26 | unitOfWorkManager) 27 | { 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Identity/IdentityRegistrar.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using EventCloud.Authorization; 4 | using EventCloud.Authorization.Roles; 5 | using EventCloud.Authorization.Users; 6 | using EventCloud.Editions; 7 | using EventCloud.MultiTenancy; 8 | 9 | namespace EventCloud.Identity 10 | { 11 | public static class IdentityRegistrar 12 | { 13 | public static IdentityBuilder Register(IServiceCollection services) 14 | { 15 | services.AddLogging(); 16 | 17 | return services.AddAbpIdentity() 18 | .AddAbpTenantManager() 19 | .AddAbpUserManager() 20 | .AddAbpRoleManager() 21 | .AddAbpEditionManager() 22 | .AddAbpUserStore() 23 | .AddAbpRoleStore() 24 | .AddAbpLogInManager() 25 | .AddAbpSignInManager() 26 | .AddAbpSecurityStampValidator() 27 | .AddAbpUserClaimsPrincipalFactory() 28 | .AddPermissionChecker() 29 | .AddDefaultTokenProviders(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Identity/SecurityStampValidator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authentication; 2 | using Microsoft.AspNetCore.Identity; 3 | using Microsoft.Extensions.Options; 4 | using Abp.Authorization; 5 | using EventCloud.Authorization.Roles; 6 | using EventCloud.Authorization.Users; 7 | using EventCloud.MultiTenancy; 8 | using Microsoft.Extensions.Logging; 9 | using Abp.Domain.Uow; 10 | 11 | namespace EventCloud.Identity 12 | { 13 | public class SecurityStampValidator : AbpSecurityStampValidator 14 | { 15 | public SecurityStampValidator( 16 | IOptions options, 17 | SignInManager signInManager, 18 | ILoggerFactory loggerFactory, 19 | IUnitOfWorkManager unitOfWorkManager) 20 | : base(options, signInManager, loggerFactory, unitOfWorkManager) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Identity/SignInManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authentication; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Identity; 4 | using Microsoft.Extensions.Logging; 5 | using Microsoft.Extensions.Options; 6 | using Abp.Authorization; 7 | using Abp.Authorization.Users; 8 | using Abp.Configuration; 9 | using Abp.Domain.Uow; 10 | using EventCloud.Authorization.Roles; 11 | using EventCloud.Authorization.Users; 12 | using EventCloud.MultiTenancy; 13 | 14 | namespace EventCloud.Identity 15 | { 16 | public class SignInManager : AbpSignInManager 17 | { 18 | public SignInManager( 19 | UserManager userManager, 20 | IHttpContextAccessor contextAccessor, 21 | UserClaimsPrincipalFactory claimsFactory, 22 | IOptions optionsAccessor, 23 | ILogger> logger, 24 | IUnitOfWorkManager unitOfWorkManager, 25 | ISettingManager settingManager, 26 | IAuthenticationSchemeProvider schemes, 27 | IUserConfirmation userConfirmation) 28 | : base(userManager, contextAccessor, claimsFactory, optionsAccessor, logger, unitOfWorkManager, settingManager, schemes, userConfirmation) 29 | { 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Localization/EventCloudLocalizationConfigurer.cs: -------------------------------------------------------------------------------- 1 | using Abp.Configuration.Startup; 2 | using Abp.Localization.Dictionaries; 3 | using Abp.Localization.Dictionaries.Xml; 4 | using Abp.Reflection.Extensions; 5 | 6 | namespace EventCloud.Localization 7 | { 8 | public static class EventCloudLocalizationConfigurer 9 | { 10 | public static void Configure(ILocalizationConfiguration localizationConfiguration) 11 | { 12 | localizationConfiguration.Sources.Add( 13 | new DictionaryBasedLocalizationSource(EventCloudConsts.LocalizationSourceName, 14 | new XmlEmbeddedFileLocalizationDictionaryProvider( 15 | typeof(EventCloudLocalizationConfigurer).GetAssembly(), 16 | "EventCloud.Localization.SourceFiles" 17 | ) 18 | ) 19 | ); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/MultiTenancy/Tenant.cs: -------------------------------------------------------------------------------- 1 | using Abp.MultiTenancy; 2 | using EventCloud.Authorization.Users; 3 | 4 | namespace EventCloud.MultiTenancy 5 | { 6 | public class Tenant : AbpTenant 7 | { 8 | public Tenant() 9 | { 10 | } 11 | 12 | public Tenant(string tenancyName, string name) 13 | : base(tenancyName, name) 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/MultiTenancy/TenantManager.cs: -------------------------------------------------------------------------------- 1 | using Abp.Application.Features; 2 | using Abp.Domain.Repositories; 3 | using Abp.MultiTenancy; 4 | using EventCloud.Authorization.Users; 5 | using EventCloud.Editions; 6 | 7 | namespace EventCloud.MultiTenancy 8 | { 9 | public class TenantManager : AbpTenantManager 10 | { 11 | public TenantManager( 12 | IRepository tenantRepository, 13 | IRepository tenantFeatureRepository, 14 | EditionManager editionManager, 15 | IAbpZeroFeatureValueStore featureValueStore) 16 | : base( 17 | tenantRepository, 18 | tenantFeatureRepository, 19 | editionManager, 20 | featureValueStore) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("EventCloud.Core")] 10 | [assembly: AssemblyTrademark("")] 11 | 12 | // Setting ComVisible to false makes the types in this assembly not visible 13 | // to COM components. If you need to access a type in this assembly from 14 | // COM, set the ComVisible attribute to true on that type. 15 | [assembly: ComVisible(false)] 16 | 17 | // The following GUID is for the ID of the typelib if this project is exposed to COM 18 | [assembly: Guid("0fa75a5b-ab83-4fd0-b545-279774c01e87")] 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Timing/AppTimes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Abp.Dependency; 3 | 4 | namespace EventCloud.Timing 5 | { 6 | public class AppTimes : ISingletonDependency 7 | { 8 | /// 9 | /// Gets the startup time of the application. 10 | /// 11 | public DateTime StartupTime { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Core/Validation/ValidationHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | using Abp.Extensions; 3 | 4 | namespace EventCloud.Validation 5 | { 6 | public static class ValidationHelper 7 | { 8 | public const string EmailRegex = @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"; 9 | 10 | public static bool IsEmail(string value) 11 | { 12 | if (value.IsNullOrEmpty()) 13 | { 14 | return false; 15 | } 16 | 17 | var regex = new Regex(EmailRegex); 18 | return regex.IsMatch(value); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/EntityFrameworkCore/AbpZeroDbMigrator.cs: -------------------------------------------------------------------------------- 1 | using Abp.Domain.Uow; 2 | using Abp.EntityFrameworkCore; 3 | using Abp.MultiTenancy; 4 | using Abp.Zero.EntityFrameworkCore; 5 | 6 | namespace EventCloud.EntityFrameworkCore 7 | { 8 | public class AbpZeroDbMigrator : AbpZeroDbMigrator 9 | { 10 | public AbpZeroDbMigrator( 11 | IUnitOfWorkManager unitOfWorkManager, 12 | IDbPerTenantConnectionStringResolver connectionStringResolver, 13 | IDbContextResolver dbContextResolver) 14 | : base( 15 | unitOfWorkManager, 16 | connectionStringResolver, 17 | dbContextResolver) 18 | { 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/EntityFrameworkCore/EventCloudDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Abp.Zero.EntityFrameworkCore; 3 | using EventCloud.Authorization.Roles; 4 | using EventCloud.Authorization.Users; 5 | using EventCloud.MultiTenancy; 6 | using EventCloud.Events; 7 | 8 | namespace EventCloud.EntityFrameworkCore 9 | { 10 | public class EventCloudDbContext : AbpZeroDbContext 11 | { 12 | /* Define a DbSet for each entity of the application */ 13 | public virtual DbSet Events { get; set; } 14 | 15 | public virtual DbSet EventRegistrations { get; set; } 16 | 17 | public EventCloudDbContext(DbContextOptions options) 18 | : base(options) 19 | { 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/EntityFrameworkCore/EventCloudDbContextConfigurer.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Common; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace EventCloud.EntityFrameworkCore 5 | { 6 | public static class EventCloudDbContextConfigurer 7 | { 8 | public static void Configure(DbContextOptionsBuilder builder, string connectionString) 9 | { 10 | builder.UseSqlServer(connectionString); 11 | } 12 | 13 | public static void Configure(DbContextOptionsBuilder builder, DbConnection connection) 14 | { 15 | builder.UseSqlServer(connection); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/EntityFrameworkCore/EventCloudDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Design; 3 | using Microsoft.Extensions.Configuration; 4 | using EventCloud.Configuration; 5 | using EventCloud.Web; 6 | 7 | namespace EventCloud.EntityFrameworkCore 8 | { 9 | /* This class is needed to run "dotnet ef ..." commands from command line on development. Not used anywhere else */ 10 | public class EventCloudDbContextFactory : IDesignTimeDbContextFactory 11 | { 12 | public EventCloudDbContext CreateDbContext(string[] args) 13 | { 14 | var builder = new DbContextOptionsBuilder(); 15 | 16 | /* 17 | You can provide an environmentName parameter to the AppConfigurations.Get method. 18 | In this case, AppConfigurations will try to read appsettings.{environmentName}.json. 19 | Use Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") method or from string[] args to get environment if necessary. 20 | https://docs.microsoft.com/en-us/ef/core/cli/dbcontext-creation?tabs=dotnet-core-cli#args 21 | */ 22 | var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); 23 | 24 | EventCloudDbContextConfigurer.Configure(builder, configuration.GetConnectionString(EventCloudConsts.ConnectionStringName)); 25 | 26 | return new EventCloudDbContext(builder.Options); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/EntityFrameworkCore/Repositories/EventCloudRepositoryBase.cs: -------------------------------------------------------------------------------- 1 | using Abp.Domain.Entities; 2 | using Abp.Domain.Repositories; 3 | using Abp.EntityFrameworkCore; 4 | using Abp.EntityFrameworkCore.Repositories; 5 | 6 | namespace EventCloud.EntityFrameworkCore.Repositories 7 | { 8 | /// 9 | /// Base class for custom repositories of the application. 10 | /// 11 | /// Entity type 12 | /// Primary key type of the entity 13 | public abstract class EventCloudRepositoryBase : EfCoreRepositoryBase 14 | where TEntity : class, IEntity 15 | { 16 | protected EventCloudRepositoryBase(IDbContextProvider dbContextProvider) 17 | : base(dbContextProvider) 18 | { 19 | } 20 | 21 | // Add your common methods for all repositories 22 | } 23 | 24 | /// 25 | /// Base class for custom repositories of the application. 26 | /// This is a shortcut of for primary key. 27 | /// 28 | /// Entity type 29 | public abstract class EventCloudRepositoryBase : EventCloudRepositoryBase, IRepository 30 | where TEntity : class, IEntity 31 | { 32 | protected EventCloudRepositoryBase(IDbContextProvider dbContextProvider) 33 | : base(dbContextProvider) 34 | { 35 | } 36 | 37 | // Do not add any method here, add to the class above (since this inherits it)!!! 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/EntityFrameworkCore/Seed/Host/DefaultSettingsCreator.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Microsoft.EntityFrameworkCore; 3 | using Abp.Configuration; 4 | using Abp.Localization; 5 | using Abp.MultiTenancy; 6 | using Abp.Net.Mail; 7 | 8 | namespace EventCloud.EntityFrameworkCore.Seed.Host 9 | { 10 | public class DefaultSettingsCreator 11 | { 12 | private readonly EventCloudDbContext _context; 13 | 14 | public DefaultSettingsCreator(EventCloudDbContext context) 15 | { 16 | _context = context; 17 | } 18 | 19 | public void Create() 20 | { 21 | int? tenantId = null; 22 | 23 | if (EventCloudConsts.MultiTenancyEnabled == false) 24 | { 25 | tenantId = MultiTenancyConsts.DefaultTenantId; 26 | } 27 | 28 | // Emailing 29 | AddSettingIfNotExists(EmailSettingNames.DefaultFromAddress, "admin@mydomain.com", tenantId); 30 | AddSettingIfNotExists(EmailSettingNames.DefaultFromDisplayName, "mydomain.com mailer", tenantId); 31 | 32 | // Languages 33 | AddSettingIfNotExists(LocalizationSettingNames.DefaultLanguage, "en", tenantId); 34 | } 35 | 36 | private void AddSettingIfNotExists(string name, string value, int? tenantId = null) 37 | { 38 | if (_context.Settings.IgnoreQueryFilters().Any(s => s.Name == name && s.TenantId == tenantId && s.UserId == null)) 39 | { 40 | return; 41 | } 42 | 43 | _context.Settings.Add(new Setting(tenantId, null, name, value)); 44 | _context.SaveChanges(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/EntityFrameworkCore/Seed/Host/InitialHostDbBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.EntityFrameworkCore.Seed.Host 2 | { 3 | public class InitialHostDbBuilder 4 | { 5 | private readonly EventCloudDbContext _context; 6 | 7 | public InitialHostDbBuilder(EventCloudDbContext context) 8 | { 9 | _context = context; 10 | } 11 | 12 | public void Create() 13 | { 14 | new DefaultEditionCreator(_context).Create(); 15 | new DefaultLanguagesCreator(_context).Create(); 16 | new HostRoleAndUserCreator(_context).Create(); 17 | new DefaultSettingsCreator(_context).Create(); 18 | 19 | _context.SaveChanges(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/EntityFrameworkCore/Seed/Tenants/DefaultTenantBuilder.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Microsoft.EntityFrameworkCore; 3 | using Abp.MultiTenancy; 4 | using EventCloud.Editions; 5 | using EventCloud.MultiTenancy; 6 | 7 | namespace EventCloud.EntityFrameworkCore.Seed.Tenants 8 | { 9 | public class DefaultTenantBuilder 10 | { 11 | private readonly EventCloudDbContext _context; 12 | 13 | public DefaultTenantBuilder(EventCloudDbContext context) 14 | { 15 | _context = context; 16 | } 17 | 18 | public void Create() 19 | { 20 | CreateDefaultTenant(); 21 | } 22 | 23 | private void CreateDefaultTenant() 24 | { 25 | // Default tenant 26 | 27 | var defaultTenant = _context.Tenants.IgnoreQueryFilters().FirstOrDefault(t => t.TenancyName == AbpTenantBase.DefaultTenantName); 28 | if (defaultTenant == null) 29 | { 30 | defaultTenant = new Tenant(AbpTenantBase.DefaultTenantName, AbpTenantBase.DefaultTenantName); 31 | 32 | var defaultEdition = _context.Editions.IgnoreQueryFilters().FirstOrDefault(e => e.Name == EditionManager.DefaultEditionName); 33 | if (defaultEdition != null) 34 | { 35 | defaultTenant.EditionId = defaultEdition.Id; 36 | } 37 | 38 | _context.Tenants.Add(defaultTenant); 39 | _context.SaveChanges(); 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/EventCloud.EntityFrameworkCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0 4 | $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; 5 | EventCloud 6 | true 7 | true 8 | true 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | all 19 | runtime; build; native; contentfiles; analyzers 20 | 21 | 22 | all 23 | runtime; build; native; contentfiles; analyzers; buildtransitive 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20170621153937_Added_Description_And_IsActive_To_Role.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Added_Description_And_IsActive_To_Role : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "Description", 11 | table: "AbpRoles", 12 | maxLength: 5000, 13 | nullable: true); 14 | 15 | migrationBuilder.AddColumn( 16 | name: "IsActive", 17 | table: "AbpRoles", 18 | nullable: false, 19 | defaultValue: false); 20 | } 21 | 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "Description", 26 | table: "AbpRoles"); 27 | 28 | migrationBuilder.DropColumn( 29 | name: "IsActive", 30 | table: "AbpRoles"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20170703134115_Remove_IsActive_From_Role.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Remove_IsActive_From_Role : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.DropColumn( 10 | name: "IsActive", 11 | table: "AbpRoles"); 12 | } 13 | 14 | protected override void Down(MigrationBuilder migrationBuilder) 15 | { 16 | migrationBuilder.AddColumn( 17 | name: "IsActive", 18 | table: "AbpRoles", 19 | nullable: false, 20 | defaultValue: false); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20170804083601_Upgraded_To_Abp_v2.2.2.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Upgraded_To_Abp_v222 : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "IsDeleted", 11 | table: "AbpUserOrganizationUnits", 12 | nullable: false, 13 | defaultValue: false); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "IsDeleted", 20 | table: "AbpUserOrganizationUnits"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20180731132139_Upgrade_ABP_3.8.1.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Upgrade_ABP_381 : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AlterColumn( 10 | name: "LoginProvider", 11 | table: "AbpUserTokens", 12 | maxLength: 128, 13 | nullable: true, 14 | oldClrType: typeof(string), 15 | oldMaxLength: 64, 16 | oldNullable: true); 17 | } 18 | 19 | protected override void Down(MigrationBuilder migrationBuilder) 20 | { 21 | migrationBuilder.AlterColumn( 22 | name: "LoginProvider", 23 | table: "AbpUserTokens", 24 | maxLength: 64, 25 | nullable: true, 26 | oldClrType: typeof(string), 27 | oldMaxLength: 128, 28 | oldNullable: true); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20180927062608_Upgrade_ABP_3.8.3.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | namespace EventCloud.Migrations 5 | { 6 | public partial class Upgrade_ABP_383 : Migration 7 | { 8 | protected override void Up(MigrationBuilder migrationBuilder) 9 | { 10 | migrationBuilder.AddColumn( 11 | name: "ExpireDate", 12 | table: "AbpUserTokens", 13 | nullable: true); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "ExpireDate", 20 | table: "AbpUserTokens"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20181013103914_Upgraded_To_Abp_v3_9_0.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Upgraded_To_Abp_v3_9_0 : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AlterColumn( 10 | name: "Surname", 11 | table: "AbpUsers", 12 | maxLength: 64, 13 | nullable: false, 14 | oldClrType: typeof(string), 15 | oldMaxLength: 32); 16 | 17 | migrationBuilder.AlterColumn( 18 | name: "Name", 19 | table: "AbpUsers", 20 | maxLength: 64, 21 | nullable: false, 22 | oldClrType: typeof(string), 23 | oldMaxLength: 32); 24 | } 25 | 26 | protected override void Down(MigrationBuilder migrationBuilder) 27 | { 28 | migrationBuilder.AlterColumn( 29 | name: "Surname", 30 | table: "AbpUsers", 31 | maxLength: 32, 32 | nullable: false, 33 | oldClrType: typeof(string), 34 | oldMaxLength: 64); 35 | 36 | migrationBuilder.AlterColumn( 37 | name: "Name", 38 | table: "AbpUsers", 39 | maxLength: 32, 40 | nullable: false, 41 | oldClrType: typeof(string), 42 | oldMaxLength: 64); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20190703062215_Upgraded_To_Abp_4_7_0.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Upgraded_To_Abp_4_7_0 : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.DropIndex( 10 | name: "IX_AbpSettings_TenantId_Name", 11 | table: "AbpSettings"); 12 | 13 | migrationBuilder.CreateIndex( 14 | name: "IX_AbpSettings_TenantId_Name_UserId", 15 | table: "AbpSettings", 16 | columns: new[] { "TenantId", "Name", "UserId" }, 17 | unique: true); 18 | } 19 | 20 | protected override void Down(MigrationBuilder migrationBuilder) 21 | { 22 | migrationBuilder.DropIndex( 23 | name: "IX_AbpSettings_TenantId_Name_UserId", 24 | table: "AbpSettings"); 25 | 26 | migrationBuilder.CreateIndex( 27 | name: "IX_AbpSettings_TenantId_Name", 28 | table: "AbpSettings", 29 | columns: new[] { "TenantId", "Name" }); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20190719143908_Upgraded_To_Abp_4_8_0.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Upgraded_To_Abp_4_8_0 : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AlterColumn( 10 | name: "LanguageName", 11 | table: "AbpLanguageTexts", 12 | maxLength: 128, 13 | nullable: false, 14 | oldClrType: typeof(string), 15 | oldMaxLength: 10); 16 | 17 | migrationBuilder.AlterColumn( 18 | name: "Name", 19 | table: "AbpLanguages", 20 | maxLength: 128, 21 | nullable: false, 22 | oldClrType: typeof(string), 23 | oldMaxLength: 10); 24 | } 25 | 26 | protected override void Down(MigrationBuilder migrationBuilder) 27 | { 28 | migrationBuilder.AlterColumn( 29 | name: "LanguageName", 30 | table: "AbpLanguageTexts", 31 | maxLength: 10, 32 | nullable: false, 33 | oldClrType: typeof(string), 34 | oldMaxLength: 128); 35 | 36 | migrationBuilder.AlterColumn( 37 | name: "Name", 38 | table: "AbpLanguages", 39 | maxLength: 10, 40 | nullable: false, 41 | oldClrType: typeof(string), 42 | oldMaxLength: 128); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20191216011543_Upgraded_To_Abp_5_1_0.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Upgraded_To_Abp_5_1_0 : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AlterColumn( 10 | name: "UserNameOrEmailAddress", 11 | table: "AbpUserLoginAttempts", 12 | maxLength: 256, 13 | nullable: true, 14 | oldClrType: typeof(string), 15 | oldMaxLength: 255, 16 | oldNullable: true); 17 | 18 | migrationBuilder.AlterColumn( 19 | name: "Value", 20 | table: "AbpSettings", 21 | nullable: true, 22 | oldClrType: typeof(string), 23 | oldMaxLength: 2000, 24 | oldNullable: true); 25 | } 26 | 27 | protected override void Down(MigrationBuilder migrationBuilder) 28 | { 29 | migrationBuilder.AlterColumn( 30 | name: "UserNameOrEmailAddress", 31 | table: "AbpUserLoginAttempts", 32 | maxLength: 255, 33 | nullable: true, 34 | oldClrType: typeof(string), 35 | oldMaxLength: 256, 36 | oldNullable: true); 37 | 38 | migrationBuilder.AlterColumn( 39 | name: "Value", 40 | table: "AbpSettings", 41 | maxLength: 2000, 42 | nullable: true, 43 | oldClrType: typeof(string), 44 | oldNullable: true); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20200604091046_Upgraded_To_Abp_5_9.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Upgraded_To_Abp_5_9 : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.DropIndex( 10 | name: "IX_AbpOrganizationUnits_TenantId_Code", 11 | table: "AbpOrganizationUnits"); 12 | 13 | migrationBuilder.CreateIndex( 14 | name: "IX_AbpOrganizationUnits_TenantId_Code", 15 | table: "AbpOrganizationUnits", 16 | columns: new[] { "TenantId", "Code" }); 17 | } 18 | 19 | protected override void Down(MigrationBuilder migrationBuilder) 20 | { 21 | migrationBuilder.DropIndex( 22 | name: "IX_AbpOrganizationUnits_TenantId_Code", 23 | table: "AbpOrganizationUnits"); 24 | 25 | migrationBuilder.CreateIndex( 26 | name: "IX_AbpOrganizationUnits_TenantId_Code", 27 | table: "AbpOrganizationUnits", 28 | columns: new[] { "TenantId", "Code" }, 29 | unique: true, 30 | filter: "[TenantId] IS NOT NULL"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20201112121732_Upgraded_To_ABP_6_0.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Upgraded_To_ABP_6_0 : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "NewValueHash", 11 | table: "AbpEntityPropertyChanges", 12 | type: "nvarchar(max)", 13 | nullable: true); 14 | 15 | migrationBuilder.AddColumn( 16 | name: "OriginalValueHash", 17 | table: "AbpEntityPropertyChanges", 18 | type: "nvarchar(max)", 19 | nullable: true); 20 | 21 | migrationBuilder.AddColumn( 22 | name: "DisplayName", 23 | table: "AbpDynamicProperties", 24 | type: "nvarchar(max)", 25 | nullable: true); 26 | } 27 | 28 | protected override void Down(MigrationBuilder migrationBuilder) 29 | { 30 | migrationBuilder.DropColumn( 31 | name: "NewValueHash", 32 | table: "AbpEntityPropertyChanges"); 33 | 34 | migrationBuilder.DropColumn( 35 | name: "OriginalValueHash", 36 | table: "AbpEntityPropertyChanges"); 37 | 38 | migrationBuilder.DropColumn( 39 | name: "DisplayName", 40 | table: "AbpDynamicProperties"); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20210628103231_Upgrade_To_ABP_6_4_rc1.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace EventCloud.Migrations 4 | { 5 | public partial class Upgrade_To_ABP_6_4_rc1 : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.CreateIndex( 10 | name: "IX_AbpUserLogins_ProviderKey_TenantId", 11 | table: "AbpUserLogins", 12 | columns: new[] { "ProviderKey", "TenantId" }, 13 | unique: true, 14 | filter: "[TenantId] IS NOT NULL"); 15 | } 16 | 17 | protected override void Down(MigrationBuilder migrationBuilder) 18 | { 19 | migrationBuilder.DropIndex( 20 | name: "IX_AbpUserLogins_ProviderKey_TenantId", 21 | table: "AbpUserLogins"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.EntityFrameworkCore/Migrations/20220622074714_Upgrade_To_ABP_7.3.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EventCloud.Migrations 6 | { 7 | public partial class Upgrade_To_ABP_73 : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "TargetNotifiers", 13 | table: "AbpUserNotifications", 14 | type: "nvarchar(max)", 15 | nullable: true); 16 | 17 | migrationBuilder.AddColumn( 18 | name: "TargetNotifiers", 19 | table: "AbpNotifications", 20 | type: "nvarchar(max)", 21 | nullable: true); 22 | } 23 | 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.DropColumn( 27 | name: "TargetNotifiers", 28 | table: "AbpUserNotifications"); 29 | 30 | migrationBuilder.DropColumn( 31 | name: "TargetNotifiers", 32 | table: "AbpNotifications"); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Migrator/DependencyInjection/ServiceCollectionRegistrar.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Castle.Windsor.MsDependencyInjection; 3 | using Abp.Dependency; 4 | using EventCloud.Identity; 5 | 6 | namespace EventCloud.Migrator.DependencyInjection 7 | { 8 | public static class ServiceCollectionRegistrar 9 | { 10 | public static void Register(IIocManager iocManager) 11 | { 12 | var services = new ServiceCollection(); 13 | 14 | IdentityRegistrar.Register(services); 15 | 16 | WindsorRegistrationHelper.CreateServiceProvider(iocManager.IocContainer, services); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Migrator/EventCloud.Migrator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0 4 | $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; 5 | EventCloud.Migrator 6 | Exe 7 | EventCloud.Migrator 8 | false 9 | false 10 | false 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Migrator/Log.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Castle.Core.Logging; 3 | using Abp.Dependency; 4 | using Abp.Timing; 5 | 6 | namespace EventCloud.Migrator 7 | { 8 | public class Log : ITransientDependency 9 | { 10 | public ILogger Logger { get; set; } 11 | 12 | public Log() 13 | { 14 | Logger = NullLogger.Instance; 15 | } 16 | 17 | public void Write(string text) 18 | { 19 | Console.WriteLine(Clock.Now.ToString("yyyy-MM-dd HH:mm:ss") + " | " + text); 20 | Logger.Info(text); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Migrator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("EventCloud.Migrator")] 10 | [assembly: AssemblyTrademark("")] 11 | 12 | // Setting ComVisible to false makes the types in this assembly not visible 13 | // to COM components. If you need to access a type in this assembly from 14 | // COM, set the ComVisible attribute to true on that type. 15 | [assembly: ComVisible(false)] 16 | 17 | // The following GUID is for the ID of the typelib if this project is exposed to COM 18 | [assembly: Guid("880b3591-e057-46fe-b525-10bd83828b93")] 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Migrator/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "Default": "Server=localhost; Database=EventCloudDb; Trusted_Connection=True; TrustServerCertificate=True;" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Migrator/log4net.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Authentication/External/ExternalAuthConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Abp.Dependency; 3 | 4 | namespace EventCloud.Authentication.External 5 | { 6 | public class ExternalAuthConfiguration : IExternalAuthConfiguration, ISingletonDependency 7 | { 8 | public List Providers { get; } 9 | 10 | public ExternalAuthConfiguration() 11 | { 12 | Providers = new List(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Authentication/External/ExternalAuthProviderApiBase.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Abp.Dependency; 3 | 4 | namespace EventCloud.Authentication.External 5 | { 6 | public abstract class ExternalAuthProviderApiBase : IExternalAuthProviderApi, ITransientDependency 7 | { 8 | public ExternalLoginProviderInfo ProviderInfo { get; set; } 9 | 10 | public void Initialize(ExternalLoginProviderInfo providerInfo) 11 | { 12 | ProviderInfo = providerInfo; 13 | } 14 | 15 | public async Task IsValidUser(string userId, string accessCode) 16 | { 17 | var userInfo = await GetUserInfo(accessCode); 18 | return userInfo.ProviderKey == userId; 19 | } 20 | 21 | public abstract Task GetUserInfo(string accessCode); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Authentication/External/ExternalAuthUserInfo.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Authentication.External 2 | { 3 | public class ExternalAuthUserInfo 4 | { 5 | public string ProviderKey { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public string EmailAddress { get; set; } 10 | 11 | public string Surname { get; set; } 12 | 13 | public string Provider { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Authentication/External/ExternalLoginProviderInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EventCloud.Authentication.External 4 | { 5 | public class ExternalLoginProviderInfo 6 | { 7 | public string Name { get; set; } 8 | 9 | public string ClientId { get; set; } 10 | 11 | public string ClientSecret { get; set; } 12 | 13 | public Type ProviderApiType { get; set; } 14 | 15 | public ExternalLoginProviderInfo(string name, string clientId, string clientSecret, Type providerApiType) 16 | { 17 | Name = name; 18 | ClientId = clientId; 19 | ClientSecret = clientSecret; 20 | ProviderApiType = providerApiType; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Authentication/External/IExternalAuthConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace EventCloud.Authentication.External 4 | { 5 | public interface IExternalAuthConfiguration 6 | { 7 | List Providers { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Authentication/External/IExternalAuthManager.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace EventCloud.Authentication.External 4 | { 5 | public interface IExternalAuthManager 6 | { 7 | Task IsValidUser(string provider, string providerKey, string providerAccessCode); 8 | 9 | Task GetUserInfo(string provider, string accessCode); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Authentication/External/IExternalAuthProviderApi.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace EventCloud.Authentication.External 4 | { 5 | public interface IExternalAuthProviderApi 6 | { 7 | ExternalLoginProviderInfo ProviderInfo { get; } 8 | 9 | Task IsValidUser(string userId, string accessCode); 10 | 11 | Task GetUserInfo(string accessCode); 12 | 13 | void Initialize(ExternalLoginProviderInfo providerInfo); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Authentication/JwtBearer/JwtTokenMiddleware.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authentication; 2 | using Microsoft.AspNetCore.Authentication.JwtBearer; 3 | using Microsoft.AspNetCore.Builder; 4 | 5 | namespace EventCloud.Authentication.JwtBearer 6 | { 7 | public static class JwtTokenMiddleware 8 | { 9 | public static IApplicationBuilder UseJwtTokenMiddleware(this IApplicationBuilder app, string schema = JwtBearerDefaults.AuthenticationScheme) 10 | { 11 | return app.Use(async (ctx, next) => 12 | { 13 | if (ctx.User.Identity?.IsAuthenticated != true) 14 | { 15 | var result = await ctx.AuthenticateAsync(schema); 16 | if (result.Succeeded && result.Principal != null) 17 | { 18 | ctx.User = result.Principal; 19 | } 20 | } 21 | 22 | await next(); 23 | }); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Authentication/JwtBearer/TokenAuthConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.IdentityModel.Tokens; 3 | 4 | namespace EventCloud.Authentication.JwtBearer 5 | { 6 | public class TokenAuthConfiguration 7 | { 8 | public SymmetricSecurityKey SecurityKey { get; set; } 9 | 10 | public string Issuer { get; set; } 11 | 12 | public string Audience { get; set; } 13 | 14 | public SigningCredentials SigningCredentials { get; set; } 15 | 16 | public TimeSpan Expiration { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Configuration/HostingEnvironmentExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.Hosting; 4 | 5 | namespace EventCloud.Configuration 6 | { 7 | public static class HostingEnvironmentExtensions 8 | { 9 | public static IConfigurationRoot GetAppConfiguration(this IWebHostEnvironment env) 10 | { 11 | return AppConfigurations.Get(env.ContentRootPath, env.EnvironmentName, env.IsDevelopment()); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Controllers/EventCloudControllerBase.cs: -------------------------------------------------------------------------------- 1 | using Abp.AspNetCore.Mvc.Controllers; 2 | using Abp.IdentityFramework; 3 | using Microsoft.AspNetCore.Identity; 4 | 5 | namespace EventCloud.Controllers 6 | { 7 | public abstract class EventCloudControllerBase: AbpController 8 | { 9 | protected EventCloudControllerBase() 10 | { 11 | LocalizationSourceName = EventCloudConsts.LocalizationSourceName; 12 | } 13 | 14 | protected void CheckErrors(IdentityResult identityResult) 15 | { 16 | identityResult.CheckErrors(LocalizationManager); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Models/TokenAuth/AuthenticateModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Abp.Auditing; 3 | using Abp.Authorization.Users; 4 | 5 | namespace EventCloud.Models.TokenAuth 6 | { 7 | public class AuthenticateModel 8 | { 9 | [Required] 10 | [StringLength(AbpUserBase.MaxEmailAddressLength)] 11 | public string UserNameOrEmailAddress { get; set; } 12 | 13 | [Required] 14 | [StringLength(AbpUserBase.MaxPlainPasswordLength)] 15 | [DisableAuditing] 16 | public string Password { get; set; } 17 | 18 | public bool RememberClient { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Models/TokenAuth/AuthenticateResultModel.cs: -------------------------------------------------------------------------------- 1 | namespace EventCloud.Models.TokenAuth 2 | { 3 | public class AuthenticateResultModel 4 | { 5 | public string AccessToken { get; set; } 6 | 7 | public string EncryptedAccessToken { get; set; } 8 | 9 | public int ExpireInSeconds { get; set; } 10 | 11 | public long UserId { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("EventCloud.Web.Core")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("EventCloud.Web.Core")] 12 | [assembly: AssemblyCopyright("Copyright © 2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("22cfe0d2-8dca-42d7-ad7d-784c3862493f")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/Controllers/AntiForgeryController.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Abp.Web.Security.AntiForgery; 3 | using Microsoft.AspNetCore.Antiforgery; 4 | using EventCloud.Controllers; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace EventCloud.Web.Host.Controllers 8 | { 9 | public class AntiForgeryController : EventCloudControllerBase 10 | { 11 | private readonly IAntiforgery _antiforgery; 12 | private readonly IAbpAntiForgeryManager _antiForgeryManager; 13 | 14 | public AntiForgeryController(IAntiforgery antiforgery, IAbpAntiForgeryManager antiForgeryManager) 15 | { 16 | _antiforgery = antiforgery; 17 | _antiForgeryManager = antiForgeryManager; 18 | } 19 | 20 | public void GetToken() 21 | { 22 | _antiforgery.SetCookieTokenAndHeader(HttpContext); 23 | } 24 | 25 | public void SetCookie() 26 | { 27 | _antiForgeryManager.SetCookie(HttpContext); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build 2 | 3 | WORKDIR /src 4 | COPY ["src/EventCloud.Web.Host/EventCloud.Web.Host.csproj", "src/EventCloud.Web.Host/"] 5 | COPY ["src/EventCloud.Web.Core/EventCloud.Web.Core.csproj", "src/EventCloud.Web.Core/"] 6 | COPY ["src/EventCloud.Application/EventCloud.Application.csproj", "src/EventCloud.Application/"] 7 | COPY ["src/EventCloud.Core/EventCloud.Core.csproj", "src/EventCloud.Core/"] 8 | COPY ["src/EventCloud.EntityFrameworkCore/EventCloud.EntityFrameworkCore.csproj", "src/EventCloud.EntityFrameworkCore/"] 9 | WORKDIR "/src/src/EventCloud.Web.Host" 10 | RUN dotnet restore 11 | 12 | WORKDIR /src 13 | COPY ["src/EventCloud.Web.Host", "src/EventCloud.Web.Host"] 14 | COPY ["src/EventCloud.Web.Core", "src/EventCloud.Web.Core"] 15 | COPY ["src/EventCloud.Application", "src/EventCloud.Application"] 16 | COPY ["src/EventCloud.Core", "src/EventCloud.Core"] 17 | COPY ["src/EventCloud.EntityFrameworkCore", "src/EventCloud.EntityFrameworkCore"] 18 | WORKDIR "/src/src/EventCloud.Web.Host" 19 | RUN dotnet publish -c Release -o /publish --no-restore 20 | 21 | FROM mcr.microsoft.com/dotnet/aspnet:7.0 22 | EXPOSE 80 23 | WORKDIR /app 24 | COPY --from=build /publish . 25 | ENTRYPOINT ["dotnet", "EventCloud.Web.Host.dll"] 26 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44311/", 7 | "sslPort": 44311 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "EventCloud.Web.Host": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "https://localhost:44311/", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "applicationUrl": "https://localhost:44311/" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/Startup/EventCloudWebHostModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Abp.Modules; 4 | using Abp.Reflection.Extensions; 5 | using EventCloud.Configuration; 6 | 7 | namespace EventCloud.Web.Host.Startup 8 | { 9 | [DependsOn( 10 | typeof(EventCloudWebCoreModule))] 11 | public class EventCloudWebHostModule: AbpModule 12 | { 13 | private readonly IWebHostEnvironment _env; 14 | private readonly IConfigurationRoot _appConfiguration; 15 | 16 | public EventCloudWebHostModule(IWebHostEnvironment env) 17 | { 18 | _env = env; 19 | _appConfiguration = env.GetAppConfiguration(); 20 | } 21 | 22 | public override void Initialize() 23 | { 24 | IocManager.RegisterAssemblyByConvention(typeof(EventCloudWebHostModule).GetAssembly()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/Startup/Program.cs: -------------------------------------------------------------------------------- 1 | using Abp.AspNetCore.Dependency; 2 | using Abp.Dependency; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.Hosting; 5 | 6 | namespace EventCloud.Web.Host.Startup 7 | { 8 | public class Program 9 | { 10 | public static void Main(string[] args) 11 | { 12 | CreateHostBuilder(args).Build().Run(); 13 | } 14 | 15 | internal static IHostBuilder CreateHostBuilder(string[] args) => 16 | Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args) 17 | .ConfigureWebHostDefaults(webBuilder => 18 | { 19 | webBuilder.UseStartup(); 20 | }) 21 | .UseCastleWindsor(IocManager.Instance.IocContainer); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/appsettings.Staging.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "Default": "Server=10.0.75.1; Database=EventCloudDb; User=sa; Password=123qwe;" 4 | }, 5 | "App": { 6 | "ServerRootAddress": "http://localhost:9902/", 7 | "CorsOrigins": "http://localhost:9902" 8 | } 9 | } -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "Default": "Server=localhost; Database=EventCloudDb; Trusted_Connection=True; TrustServerCertificate=True;" 4 | }, 5 | "App": { 6 | "ServerRootAddress": "https://localhost:44311/", 7 | "ClientRootAddress": "http://localhost:4200/", 8 | "CorsOrigins": "http://localhost:4200,http://localhost:8080,http://localhost:8081,http://localhost:3000" 9 | }, 10 | "Authentication": { 11 | "JwtBearer": { 12 | "IsEnabled": "true", 13 | "SecurityKey": "EventCloud_1B0FB602150444365SA26D2A19", 14 | "Issuer": "EventCloud", 15 | "Audience": "EventCloud" 16 | } 17 | }, 18 | "Kestrel": { 19 | "Endpoints": { 20 | "Http": { 21 | "Url": "https://localhost:44311/" 22 | } 23 | } 24 | }, 25 | "Swagger": { 26 | "ShowSummaries": false 27 | } 28 | } -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/log4net.Production.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /aspnet-core/src/EventCloud.Web.Host/log4net.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /aspnet-core/test/EventCloud.Tests/DependencyInjection/ServiceCollectionRegistrar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Castle.MicroKernel.Registration; 5 | using Castle.Windsor.MsDependencyInjection; 6 | using Abp.Dependency; 7 | using EventCloud.EntityFrameworkCore; 8 | using EventCloud.Identity; 9 | 10 | namespace EventCloud.Tests.DependencyInjection 11 | { 12 | public static class ServiceCollectionRegistrar 13 | { 14 | public static void Register(IIocManager iocManager) 15 | { 16 | var services = new ServiceCollection(); 17 | 18 | IdentityRegistrar.Register(services); 19 | 20 | services.AddEntityFrameworkInMemoryDatabase(); 21 | 22 | var serviceProvider = WindsorRegistrationHelper.CreateServiceProvider(iocManager.IocContainer, services); 23 | 24 | var builder = new DbContextOptionsBuilder(); 25 | builder.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseInternalServiceProvider(serviceProvider); 26 | 27 | iocManager.IocContainer.Register( 28 | Component 29 | .For>() 30 | .Instance(builder.Options) 31 | .LifestyleSingleton() 32 | ); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /aspnet-core/test/EventCloud.Tests/MultiTenantFactAttribute.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | 3 | namespace EventCloud.Tests 4 | { 5 | public sealed class MultiTenantFactAttribute : FactAttribute 6 | { 7 | public MultiTenantFactAttribute() 8 | { 9 | if (!EventCloudConsts.MultiTenancyEnabled) 10 | { 11 | Skip = "MultiTenancy is disabled."; 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /aspnet-core/test/EventCloud.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("EventCloud.Tests")] 10 | [assembly: AssemblyTrademark("")] 11 | 12 | // Setting ComVisible to false makes the types in this assembly not visible 13 | // to COM components. If you need to access a type in this assembly from 14 | // COM, set the ComVisible attribute to true on that type. 15 | [assembly: ComVisible(false)] 16 | 17 | // The following GUID is for the ID of the typelib if this project is exposed to COM 18 | [assembly: Guid("0d4c5d00-c144-4213-a007-4b8944113ab1")] 19 | -------------------------------------------------------------------------------- /aspnet-core/test/EventCloud.Tests/Sessions/SessionAppService_Tests.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Shouldly; 3 | using Xunit; 4 | using EventCloud.Sessions; 5 | 6 | namespace EventCloud.Tests.Sessions 7 | { 8 | public class SessionAppService_Tests : EventCloudTestBase 9 | { 10 | private readonly ISessionAppService _sessionAppService; 11 | 12 | public SessionAppService_Tests() 13 | { 14 | _sessionAppService = Resolve(); 15 | } 16 | 17 | [MultiTenantFact] 18 | public async Task Should_Get_Current_User_When_Logged_In_As_Host() 19 | { 20 | // Arrange 21 | LoginAsHostAdmin(); 22 | 23 | // Act 24 | var output = await _sessionAppService.GetCurrentLoginInformations(); 25 | 26 | // Assert 27 | var currentUser = await GetCurrentUserAsync(); 28 | output.User.ShouldNotBe(null); 29 | output.User.Name.ShouldBe(currentUser.Name); 30 | output.User.Surname.ShouldBe(currentUser.Surname); 31 | 32 | output.Tenant.ShouldBe(null); 33 | } 34 | 35 | [Fact] 36 | public async Task Should_Get_Current_User_And_Tenant_When_Logged_In_As_Tenant() 37 | { 38 | // Act 39 | var output = await _sessionAppService.GetCurrentLoginInformations(); 40 | 41 | // Assert 42 | var currentUser = await GetCurrentUserAsync(); 43 | var currentTenant = await GetCurrentTenantAsync(); 44 | 45 | output.User.ShouldNotBe(null); 46 | output.User.Name.ShouldBe(currentUser.Name); 47 | 48 | output.Tenant.ShouldNotBe(null); 49 | output.Tenant.Name.ShouldBe(currentTenant.Name); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /aspnet-core/test/EventCloud.Tests/Users/UserAppService_Tests.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.EntityFrameworkCore; 3 | using Shouldly; 4 | using Xunit; 5 | using Abp.Application.Services.Dto; 6 | using EventCloud.Users; 7 | using EventCloud.Users.Dto; 8 | 9 | namespace EventCloud.Tests.Users 10 | { 11 | public class UserAppService_Tests : EventCloudTestBase 12 | { 13 | private readonly IUserAppService _userAppService; 14 | 15 | public UserAppService_Tests() 16 | { 17 | _userAppService = Resolve(); 18 | } 19 | 20 | [Fact] 21 | public async Task GetUsers_Test() 22 | { 23 | // Act 24 | var output = await _userAppService.GetAllAsync(new PagedUserResultRequestDto{MaxResultCount=20, SkipCount=0} ); 25 | 26 | // Assert 27 | output.Items.Count.ShouldBeGreaterThan(0); 28 | } 29 | 30 | [Fact] 31 | public async Task CreateUser_Test() 32 | { 33 | // Act 34 | await _userAppService.CreateAsync( 35 | new CreateUserDto 36 | { 37 | EmailAddress = "john@volosoft.com", 38 | IsActive = true, 39 | Name = "John", 40 | Surname = "Nash", 41 | Password = "123qwe", 42 | UserName = "john.nash" 43 | }); 44 | 45 | await UsingDbContextAsync(async context => 46 | { 47 | var johnNashUser = await context.Users.FirstOrDefaultAsync(u => u.UserName == "john.nash"); 48 | johnNashUser.ShouldNotBeNull(); 49 | }); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /aspnet-core/test/EventCloud.Web.Tests/Controllers/HomeController_Tests.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using EventCloud.Models.TokenAuth; 3 | using EventCloud.Web.Controllers; 4 | using Shouldly; 5 | using Xunit; 6 | 7 | namespace EventCloud.Web.Tests.Controllers 8 | { 9 | public class HomeController_Tests: EventCloudWebTestBase 10 | { 11 | [Fact] 12 | public async Task Index_Test() 13 | { 14 | await AuthenticateAsync(null, new AuthenticateModel 15 | { 16 | UserNameOrEmailAddress = "admin", 17 | Password = "123qwe" 18 | }); 19 | 20 | //Act 21 | var response = await GetResponseAsStringAsync( 22 | GetUrl(nameof(HomeController.Index)) 23 | ); 24 | 25 | //Assert 26 | response.ShouldNotBeNullOrEmpty(); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /aspnet-core/test/EventCloud.Web.Tests/EventCloud.Web.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1.0.0.0 4 | net8.0 5 | $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; 6 | EventCloud.Web.Tests 7 | EventCloud.Web.Tests 8 | true 9 | false 10 | false 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | all 25 | runtime; build; native; contentfiles; analyzers 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /aspnet-core/test/EventCloud.Web.Tests/EventCloudWebTestModule.cs: -------------------------------------------------------------------------------- 1 | using Abp.AspNetCore; 2 | using Abp.AspNetCore.TestBase; 3 | using Abp.Modules; 4 | using Abp.Reflection.Extensions; 5 | using EventCloud.EntityFrameworkCore; 6 | using EventCloud.Web.Startup; 7 | using Microsoft.AspNetCore.Mvc.ApplicationParts; 8 | 9 | namespace EventCloud.Web.Tests 10 | { 11 | [DependsOn( 12 | typeof(EventCloudWebMvcModule), 13 | typeof(AbpAspNetCoreTestBaseModule) 14 | )] 15 | public class EventCloudWebTestModule : AbpModule 16 | { 17 | public EventCloudWebTestModule(EventCloudEntityFrameworkModule abpProjectNameEntityFrameworkModule) 18 | { 19 | abpProjectNameEntityFrameworkModule.SkipDbContextRegistration = true; 20 | } 21 | 22 | public override void PreInitialize() 23 | { 24 | Configuration.UnitOfWork.IsTransactional = false; //EF Core InMemory DB does not support transactions. 25 | } 26 | 27 | public override void Initialize() 28 | { 29 | IocManager.RegisterAssemblyByConvention(typeof(EventCloudWebTestModule).GetAssembly()); 30 | } 31 | 32 | public override void PostInitialize() 33 | { 34 | IocManager.Resolve() 35 | .AddApplicationPartsIfNotAddedBefore(typeof(EventCloudWebMvcModule).Assembly); 36 | } 37 | } 38 | } --------------------------------------------------------------------------------