├── .github └── workflows │ └── dotnetcore.yml ├── .gitignore ├── LICENSE ├── README.md └── src ├── .editorconfig ├── Basic ├── Senparc.Scf.AreaBase │ ├── Admin │ │ ├── AdminPageModelBase.cs │ │ ├── AdminXscfModulePageModelBase.cs │ │ └── Filters │ │ │ ├── AdminAuthorizeAttribute.cs │ │ │ ├── AuthenticationAsyncPageFilterAttribute.cs │ │ │ ├── AuthenticationResultFilterAttribute.cs │ │ │ └── CustomerResourceAttribute.cs │ └── Senparc.Scf.AreaBase.csproj ├── Senparc.Scf.Core.Tests │ ├── Senparc.Scf.Core.Tests.csproj │ ├── TestBase.cs │ ├── UnitTestHelper.cs │ └── appsettings.json ├── Senparc.Scf.Core │ ├── AjaxReturnModel.cs │ ├── Area │ │ └── AreaData.cs │ ├── Areas │ │ ├── AreaPageMenuItem.cs │ │ ├── AreaRegister.cs │ │ └── IAreaRegister.cs │ ├── AssembleScan │ │ ├── AssembleScanHelper.cs │ │ └── AssembleScanItem.cs │ ├── AutoMapper │ │ └── SystemProfile.cs │ ├── Cache │ │ ├── AreaDataCache.cs │ │ ├── BaseCache │ │ │ ├── BaseCache.cs │ │ │ ├── BaseDictionary │ │ │ │ ├── BaseDictionaryCache.cs │ │ │ │ └── BaseStringDictionary │ │ │ │ │ └── BaseStringDictionaryCache.cs │ │ │ └── ICacheData.cs │ │ ├── CacheDataMessageQueue │ │ │ ├── BaseCacheBindable.cs │ │ │ ├── CacheDataMessageQueue.cs │ │ │ └── CacheDataMessageQueueItem.cs │ │ ├── CommonCacheAttribute.cs │ │ ├── CommonDataCache.cs │ │ ├── EntityCache │ │ │ ├── FullAccountCache.cs │ │ │ └── FullSystemConfigCache.cs │ │ ├── Extensions │ │ │ ├── BaseCacheExtensions.cs │ │ │ └── ObjectCacheStrategyExtensions.cs │ │ ├── Interface │ │ │ ├── IBaseCache.cs │ │ │ ├── IBaseCacheStrategy.cs │ │ │ └── ICommonDataCache.cs │ │ ├── MethodCache.cs │ │ ├── MobileLoginCodeCache.cs │ │ ├── QueueCache │ │ │ ├── DemoLoginKeyCache.cs │ │ │ ├── OAuthCodeCache.cs │ │ │ ├── PhoneCheckCodeCache.cs │ │ │ ├── QrCodeBaseData.cs │ │ │ ├── QrCodeGroupCache.cs │ │ │ ├── QrCodeLoginCache.cs │ │ │ ├── QrCodeRegCache.cs │ │ │ ├── QueueCache.cs │ │ │ ├── QueueCacheData.cs │ │ │ └── WeixinCheckCodeCache.cs │ │ └── SendEmailCache.cs │ ├── Config │ │ ├── SenparcDatabaseConfigs.cs │ │ ├── SiteConfig.Core.cs │ │ └── XmlConfig.cs │ ├── DI │ │ ├── AutoDITypeAttribute.cs │ │ └── IAutoDI.cs │ ├── Email │ │ ├── AutoSendLogEmail.cs │ │ ├── SendEmail.cs │ │ ├── SendEmailParameters.Core.cs │ │ └── SendEmailParameters.cs │ ├── Enums.Core.cs │ ├── Exceptions │ │ ├── SCFExceptionBase.cs │ │ ├── ScfModuleException.cs │ │ └── ScfUninstallException.cs │ ├── Extensions │ │ ├── AuthorizeAttributeExtensions.cs │ │ ├── EntityFrameworkExtensions.cs │ │ ├── EntityTypeProvider.cs │ │ ├── ObjectExtensions.cs │ │ └── ObjectQueryExtensions.cs │ ├── Models │ │ ├── DataBaseModel │ │ │ ├── Account.cs │ │ │ ├── AccountPayLog.cs │ │ │ ├── Dto │ │ │ │ ├── AdminUserInfoDto.cs │ │ │ │ ├── Base │ │ │ │ │ ├── DtoBase.cs │ │ │ │ │ ├── IDtoBase.cs │ │ │ │ │ └── QueryDtoBase.cs │ │ │ │ ├── SysButtonDto.cs │ │ │ │ ├── SysMenuDto.cs │ │ │ │ ├── SysPermissionDto.cs │ │ │ │ ├── SysRoleAdminUserInfoDto.cs │ │ │ │ ├── SysRoleDto.cs │ │ │ │ └── XscfModuleDto.cs │ │ │ ├── Mapping │ │ │ │ ├── AccountConfigurationMapping.cs │ │ │ │ ├── AccountPayLogConfigurationMapping.cs │ │ │ │ ├── Base │ │ │ │ │ ├── BlankEntityTypeConfiguration.cs │ │ │ │ │ └── ConfigurationMappingBase.cs │ │ │ │ ├── PointsLogConfigurationMapping.cs │ │ │ │ └── XscfModuleAccountConfigurationMapping.cs │ │ │ ├── PointsLog.cs │ │ │ ├── SysButton.cs │ │ │ ├── SysMenu.cs │ │ │ ├── SysPermission.cs │ │ │ ├── SysRole.cs │ │ │ ├── SysRoleAdminUserInfo.cs │ │ │ ├── SystemConfig.cs │ │ │ └── XscfModule.cs │ │ ├── EntityBase │ │ │ ├── EntityBase.cs │ │ │ ├── IEntityBase.cs │ │ │ └── ISoftDelete.cs │ │ ├── EntitySetKeys.cs │ │ ├── ExtensionEntity.Core.cs │ │ ├── ExtensionEntity.Extension.cs │ │ ├── IValidatorEnvironment.cs │ │ ├── SenparcCoreSetting.Core.cs │ │ ├── SenparcEntities │ │ │ ├── ISenparcEntities.cs │ │ │ └── SenparcEntitiesBase.cs │ │ ├── SmsTemplateEntity │ │ │ ├── SmsTemplate_Base.cs │ │ │ └── SmsTemplate_Custom.cs │ │ ├── SqlFinanceData │ │ │ └── SqlBaseFinanceData.cs │ │ ├── VD │ │ │ ├── BaseVD.cs │ │ │ ├── CommonVD.cs │ │ │ └── Razor │ │ │ │ └── PageModelBase.cs │ │ ├── WeixinTemplate │ │ │ ├── WeixinTemplateBase.cs │ │ │ └── WeixinTemplate_AuthNotice.cs │ │ └── readme.md │ ├── Register.cs │ ├── Senparc.Scf.Core.csproj │ ├── Utility │ │ ├── CacheEntity │ │ │ ├── AutoSetCacheAttribute.cs │ │ │ └── FullEntityCache.cs │ │ ├── CheckCodeHandle.cs │ │ ├── CommonWebParts.cs │ │ ├── ReflectorUtility.cs │ │ └── XmlDataContext.cs │ ├── Validator │ │ └── Validator.cs │ └── WorkContext │ │ ├── AdminWorkContext.cs │ │ └── Provider │ │ ├── AdminWorkContextProvider.cs │ │ └── IAdminWorkContextProvider.cs ├── Senparc.Scf.Log │ ├── LogUtility.cs │ ├── NLogExtension.Core.cs │ └── Senparc.Scf.Log.csproj ├── Senparc.Scf.Mvc.UI │ ├── CustomBindingHelperExtentions.cs │ ├── HtmlExtension.Core.cs │ ├── Senparc.Scf.Mvc.UI.csproj │ ├── UIHelpers │ │ ├── CurrentBsMenuExtensions.cs │ │ ├── CurrentMenuExtensions.cs │ │ ├── GridViewActionExtension.cs │ │ ├── GridViewExtension.cs │ │ ├── HtmlExtensionUtility.cs │ │ ├── OnClickSpanExtension.cs │ │ ├── PagerBarExtension.cs │ │ └── RepeaterExtension.cs │ └── backend │ │ ├── BackendTemplateExtension.cs │ │ ├── ContentBox.cs │ │ └── ShowMessageBox.cs ├── Senparc.Scf.Repository │ ├── BaseRepoisitory │ │ ├── ClientRepositoryBase.cs │ │ ├── DataBase.cs │ │ ├── IRepositoryBase.cs │ │ └── RepositoryBase.cs │ ├── Senparc.Scf.Repository.csproj │ ├── System │ │ └── SysButtonRespository.cs │ └── XscfModuleRepository.cs ├── Senparc.Scf.SMS │ ├── Enums.cs │ ├── ReplyMessage.cs │ ├── ReplyMessageCollection.cs │ ├── Senparc.Scf.SMS.csproj │ └── SmsPlatform │ │ ├── SmsPlatform.cs │ │ ├── SmsPlatformFactory.cs │ │ ├── SmsPlatform_Fissoft.cs │ │ ├── SmsPlatform_JunMei.cs │ │ └── SmsSetting.cs ├── Senparc.Scf.Service │ ├── Senparc.Scf.Service.csproj │ ├── ServiceBase │ │ ├── AutoDetectChangeContext │ │ │ ├── AutoDetectChangeContext.cs │ │ │ └── AutoDetectChangeContextExtension.cs │ │ ├── ClientServiceBase.cs │ │ ├── DtoServiceBase.cs │ │ ├── IServiceBase.cs │ │ ├── ServiceBase.cs │ │ └── ServiceDataBase.cs │ ├── SignalrHubs │ │ └── SignalrTicker.cs │ └── System │ │ ├── SysButtonService.cs │ │ ├── SysMenuService.cs │ │ ├── SysPermissionService.cs │ │ ├── SysRoleAdminUserInfoService.cs │ │ ├── SysRoleService.cs │ │ ├── SystemConfigServiceBase.cs │ │ └── XscfModuleService.cs ├── Senparc.Scf.Utility │ ├── AESEncryptionUtility.cs │ ├── DIExtension │ │ ├── Extensions.cs │ │ └── readme.md │ ├── ExpressionExtension │ │ ├── SenparcExpressionHelper.cs │ │ ├── SenparcExpressionModifier.cs │ │ └── SenparcIQueryableExtension.cs │ ├── Extensions │ │ ├── DateTimeExtensions.cs │ │ ├── IntegerExtensions.cs │ │ └── StringExtensions.cs │ ├── FileUtility.cs │ ├── Helpers │ │ └── ReflectionHelper.cs │ ├── IPData.cs │ ├── ModelStateDictionaryExtension.cs │ ├── RequestExtension.cs │ ├── Senparc.Core.Utility │ │ ├── DateTimeUtility.cs │ │ ├── DesUtility.cs │ │ ├── Extensions.cs │ │ ├── IoUtility.cs │ │ ├── MD5.cs │ │ ├── Server.cs │ │ └── W3wp.cs │ ├── Senparc.Scf.Utility.csproj │ ├── SenparcHttpContext.cs │ └── StreamExtensions │ │ └── WriteOnlyStreamWrapper.cs ├── Senparc.Scf.XscfBase.Tests │ ├── FunctionBaseTest.cs │ ├── RegisterTest.cs │ └── Senparc.Scf.XscfBase.Tests.csproj └── Senparc.Scf.XscfBase │ ├── Attributes │ ├── XscfAutoConfigurationMappingAttribute.cs │ ├── XscfMethodAttribute.cs │ ├── XscfOrderAttribute.cs │ └── XscfRegisterAttribute.cs │ ├── AutoMapper │ └── XscfModuleProfile.cs │ ├── Database │ ├── SenparcDesignTimeDbContextFactoryBase.cs │ └── XscfDatabaseDbContext.cs │ ├── Exceptions │ ├── ScfModuleException.cs │ └── XscfFunctionException.cs │ ├── Functions │ ├── EnumType.cs │ ├── FunctionBase.cs │ ├── FunctionHelper.cs │ ├── FunctionResult.cs │ └── Parameters │ │ ├── FunctionParameterInfo.cs │ │ ├── FunctionParameterLoadDataBase.cs │ │ └── SelectionList.cs │ ├── Interfaces │ ├── Functions │ │ ├── IFunctionParameter.cs │ │ └── IXscfFunction.cs │ ├── IXscfDatabase.cs │ ├── IXscfMiddleware.cs │ ├── IXscfRazorRuntimeCompilation.cs │ ├── IXscfRegister.cs │ └── IXscfThread.cs │ ├── Register.cs │ ├── Senparc.Scf.XscfBase.csproj │ ├── Threads │ ├── ThreadInfo.cs │ └── XscfThreadBuilder.cs │ └── XscfRegisterBase.cs ├── Directory.Build.props ├── Extensions ├── Senparc.Xscf.Application │ ├── Functions │ │ └── LaunchApp.cs │ ├── Register.cs │ └── Senparc.Xscf.Application.csproj ├── Senparc.Xscf.ChangeNamespace.Tests │ ├── APP_Data │ │ └── src │ │ │ ├── Senparc.Areas.Admin │ │ │ ├── Areas │ │ │ │ ├── Admin │ │ │ │ │ └── Pages │ │ │ │ │ │ ├── AdminUserInfo │ │ │ │ │ │ ├── AuthorizationPage.cshtml │ │ │ │ │ │ ├── AuthorizationPage.cshtml.cs │ │ │ │ │ │ ├── Edit.cshtml │ │ │ │ │ │ ├── Edit.cshtml.cs │ │ │ │ │ │ ├── Index.cshtml │ │ │ │ │ │ └── Index.cshtml.cs │ │ │ │ │ │ ├── Index.cshtml │ │ │ │ │ │ ├── Index.cshtml.cs │ │ │ │ │ │ ├── Login.cshtml │ │ │ │ │ │ ├── Login.cshtml.cs │ │ │ │ │ │ ├── Menu │ │ │ │ │ │ ├── Edit.cshtml │ │ │ │ │ │ ├── Edit.cshtml.cs │ │ │ │ │ │ ├── Index.cshtml │ │ │ │ │ │ └── Index.cshtml.cs │ │ │ │ │ │ ├── Role │ │ │ │ │ │ ├── Edit.cshtml │ │ │ │ │ │ ├── Edit.cshtml.cs │ │ │ │ │ │ ├── Index.cshtml │ │ │ │ │ │ ├── Index.cshtml.cs │ │ │ │ │ │ ├── Permission.cshtml │ │ │ │ │ │ └── Permission.cshtml.cs │ │ │ │ │ │ ├── Shared │ │ │ │ │ │ ├── _ContentLayout.cshtml │ │ │ │ │ │ ├── _Empty.cshtml │ │ │ │ │ │ ├── _HeaderPartial.cshtml │ │ │ │ │ │ ├── _Layout.cshtml │ │ │ │ │ │ └── _MenuPartial.cshtml │ │ │ │ │ │ ├── _ViewImports.cshtml │ │ │ │ │ │ └── _ViewStart.cshtml │ │ │ │ └── readme.md │ │ │ ├── BaseAdminPageModel.cs │ │ │ ├── Filters │ │ │ │ ├── AdminAuthorizeAttribute.cs │ │ │ │ ├── AuthenticationResultFilterAttribute.cs │ │ │ │ └── CustomerResourceFilterAttribute.cs │ │ │ ├── Register.cs │ │ │ ├── Senparc.Areas.Admin.csproj │ │ │ └── TagHelpers │ │ │ │ └── AuthorizationMenuTagHelper.cs │ │ │ ├── Senparc.Service │ │ │ ├── AccountPayLogService.cs │ │ │ ├── AccountService.cs │ │ │ ├── AdminUserInfoService.cs │ │ │ ├── EncryptionService.cs │ │ │ ├── EncryptionServiceBase.cs │ │ │ ├── FeedBackService.cs │ │ │ ├── OperationQueue │ │ │ │ ├── OperationQueue.cs │ │ │ │ ├── OperationQueueItem.cs │ │ │ │ └── OperationQueueService.cs │ │ │ ├── PointsLogService.cs │ │ │ ├── ProjectBiddingService.cs │ │ │ ├── ProjectDemandService.cs │ │ │ ├── ProjectKindService.cs │ │ │ ├── ProjectPayLogService.cs │ │ │ ├── Senparc.Service.csproj │ │ │ ├── ServiceBase │ │ │ │ └── ClientServiceBase.cs │ │ │ ├── SmsRecordService.cs │ │ │ ├── System │ │ │ │ ├── SysButtonService.cs │ │ │ │ ├── SysMenuService.cs │ │ │ │ ├── SysPermissionService.cs │ │ │ │ ├── SysRoleAdminUserInfoService.cs │ │ │ │ └── SysRoleService.cs │ │ │ ├── SystemConfigService.cs │ │ │ └── Weixin │ │ │ │ └── WeixinService.cs │ │ │ └── Senparc.Web │ │ │ ├── BootStrapper │ │ │ └── AutoMapperBootStrapper.cs │ │ │ ├── DbContext │ │ │ └── SenparcDbContextFactory.cs │ │ │ ├── Dockerfile │ │ │ ├── Hubs │ │ │ └── ReloadPageHub.cs │ │ │ ├── Migrations │ │ │ ├── 20190203165718_Created_Base_Tables.Designer.cs │ │ │ ├── 20190203165718_Created_Base_Tables.cs │ │ │ ├── 20190814082914_Create_RoleInfo_Table.Designer.cs │ │ │ ├── 20190814082914_Create_RoleInfo_Table.cs │ │ │ ├── 20190814090531_Global_Remark_Field.Designer.cs │ │ │ ├── 20190814090531_Global_Remark_Field.cs │ │ │ ├── 20200204103009_Update-SysMenuDto.Designer.cs │ │ │ ├── 20200204103009_Update-SysMenuDto.cs │ │ │ ├── 20200207154427_Create_XscfModule.Designer.cs │ │ │ ├── 20200207154427_Create_XscfModule.cs │ │ │ └── SenparcEntitiesModelSnapshot.cs │ │ │ ├── Models │ │ │ └── ErrorViewModel.cs │ │ │ ├── Pages │ │ │ ├── Error.cshtml │ │ │ ├── Error.cshtml.cs │ │ │ ├── Index.cshtml │ │ │ ├── Index.cshtml.cs │ │ │ ├── Install │ │ │ │ ├── Index.cshtml │ │ │ │ └── Index.cshtml.cs │ │ │ ├── Privacy.cshtml │ │ │ ├── Privacy.cshtml.cs │ │ │ ├── Shared │ │ │ │ ├── _CookieConsentPartial.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ └── _ValidationScriptsPartial.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── Register.cs │ │ │ ├── Senparc.Web.csproj │ │ │ ├── Startup.cs │ │ │ ├── appsettings.json │ │ │ ├── global.json │ │ │ ├── gulpfile.js │ │ │ ├── libman.json │ │ │ ├── log4net.config │ │ │ ├── logs │ │ │ └── log4net │ │ │ │ ├── logs_20200207 │ │ │ │ └── log.txt │ │ │ │ ├── logs_20200208 │ │ │ │ └── log.txt │ │ │ │ └── logs_20200209 │ │ │ │ └── log.txt │ │ │ ├── package-lock.bak.son │ │ │ ├── package.json │ │ │ ├── scripts │ │ │ ├── app.js │ │ │ └── app.ts │ │ │ ├── tsconfig.json │ │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── Admin │ │ │ │ ├── Shared │ │ │ │ │ └── _Layout.css │ │ │ │ ├── adminlogin │ │ │ │ │ └── logo.png │ │ │ │ ├── base │ │ │ │ │ ├── pagecss.css │ │ │ │ │ └── senparc-login.css │ │ │ │ ├── menuEdit.css │ │ │ │ └── styles.css │ │ │ ├── User │ │ │ │ ├── base │ │ │ │ │ └── pagecss.css │ │ │ │ └── styles.css │ │ │ ├── WX │ │ │ │ ├── base │ │ │ │ │ └── base.css │ │ │ │ └── styles.css │ │ │ ├── site.css │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── Admin │ │ │ │ ├── Avatar │ │ │ │ │ ├── NeuChar.png │ │ │ │ │ └── default.png │ │ │ │ ├── Logo.png │ │ │ │ └── base │ │ │ │ │ ├── AdminLogin │ │ │ │ │ └── admin_login.jpg │ │ │ │ │ └── head │ │ │ │ │ ├── logo_128x128.png │ │ │ │ │ ├── logo_230x55.png │ │ │ │ │ └── logo_70x55.png │ │ │ ├── Shared │ │ │ │ └── SCFLogo │ │ │ │ │ ├── logo_128x128.png │ │ │ │ │ ├── logo_230x55.png │ │ │ │ │ └── logo_70x55.png │ │ │ ├── logo-login-0.png │ │ │ ├── logo-login-scf.png │ │ │ ├── logo-login.png │ │ │ └── logo-square-scf.jpg │ │ │ ├── js │ │ │ ├── Admin │ │ │ │ ├── Pages │ │ │ │ │ ├── AdminUserInfo │ │ │ │ │ │ ├── AuthorizationPage.js │ │ │ │ │ │ ├── Edit.js │ │ │ │ │ │ └── Index.js │ │ │ │ │ ├── Index │ │ │ │ │ │ └── Index.js │ │ │ │ │ ├── Menu │ │ │ │ │ │ └── Edit.js │ │ │ │ │ └── Role │ │ │ │ │ │ └── Permission.js │ │ │ │ ├── base.js │ │ │ │ └── global.js │ │ │ ├── element-ui_2.5.4 │ │ │ │ ├── index.js │ │ │ │ └── theme │ │ │ │ │ ├── fonts │ │ │ │ │ ├── element-icons.ttf │ │ │ │ │ └── element-icons.woff │ │ │ │ │ └── index.css │ │ │ ├── gentelella-custom │ │ │ │ ├── custom.js │ │ │ │ └── custom.min.js │ │ │ └── site.js │ │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ ├── LICENSE │ │ │ │ └── dist │ │ │ │ │ ├── css │ │ │ │ │ ├── bootstrap-grid.css │ │ │ │ │ ├── bootstrap-grid.min.css │ │ │ │ │ ├── bootstrap-reboot.css │ │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ │ ├── bootstrap.css │ │ │ │ │ └── bootstrap.min.css │ │ │ │ │ └── js │ │ │ │ │ ├── bootstrap.bundle.js │ │ │ │ │ ├── bootstrap.bundle.min.js │ │ │ │ │ ├── bootstrap.js │ │ │ │ │ └── bootstrap.min.js │ │ │ ├── jquery-validation-unobtrusive │ │ │ │ ├── LICENSE.txt │ │ │ │ ├── jquery.validate.unobtrusive.js │ │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ ├── jquery-validation │ │ │ │ ├── LICENSE.md │ │ │ │ └── dist │ │ │ │ │ ├── additional-methods.js │ │ │ │ │ ├── additional-methods.min.js │ │ │ │ │ ├── jquery.validate.js │ │ │ │ │ └── jquery.validate.min.js │ │ │ └── jquery │ │ │ │ ├── LICENSE.txt │ │ │ │ └── dist │ │ │ │ ├── jquery.js │ │ │ │ └── jquery.min.js │ │ │ └── scripts │ │ │ └── app.js │ ├── ChangeNameSpaceTest.cs │ └── Senparc.Xscf.ChangeNamespace.Tests.csproj ├── Senparc.Xscf.ChangeNamespace │ ├── Entities │ │ └── MeetRule.cs │ ├── Functions │ │ ├── ChangeNameSpace.cs │ │ ├── DownloadSourceCode.cs │ │ └── RestoreNameSpace.cs │ ├── Register.cs │ ├── Senparc.Xscf.ChangeNamespace.csproj │ └── readme.md ├── Senparc.Xscf.DatabaseToolkit │ └── Senparc.Xscf.DatabaseToolkit │ │ ├── App_Data │ │ └── DataBase │ │ │ └── SenparcConfig.config │ │ ├── Functions │ │ ├── BackupDatabase.cs │ │ ├── CheckUpdate.cs │ │ ├── ExportSQL.cs │ │ ├── SetConfig.cs │ │ └── UpdateDatabase.cs │ │ ├── Migrations │ │ ├── 20200326162920_Add_SetConfig.Designer.cs │ │ ├── 20200326162920_Add_SetConfig.cs │ │ ├── 20200328162338_Add_DbConfig_LastBackupTime.Designer.cs │ │ ├── 20200328162338_Add_DbConfig_LastBackupTime.cs │ │ └── DatabaseToolkitEntitiesModelSnapshot.cs │ │ ├── Models │ │ ├── DataBaseModel │ │ │ └── DbConfig.cs │ │ ├── DatabaseToolkitEntities.cs │ │ └── SenparcDbContextFactory.cs │ │ ├── Register.Database.cs │ │ ├── Register.RazorRuntime.cs │ │ ├── Register.Thread.cs │ │ ├── Register.cs │ │ └── Senparc.Xscf.DatabaseToolkit.csproj ├── Senparc.Xscf.Terminal │ ├── Description.txt │ ├── Functions │ │ └── Terminal.cs │ ├── Register.cs │ └── Senparc.Xscf.Terminal.csproj └── readme.md ├── ScfPackageSources.sln └── Senparc.IntegrationSample.Tests └── Senparc.IntegrationSample ├── Pages ├── Error.cshtml ├── Error.cshtml.cs ├── Index.cshtml ├── Index.cshtml.cs ├── Privacy.cshtml ├── Privacy.cshtml.cs ├── Shared │ ├── _Layout.cshtml │ └── _ValidationScriptsPartial.cshtml ├── _ViewImports.cshtml └── _ViewStart.cshtml ├── Program.cs ├── Properties └── launchSettings.json ├── Senparc.IntegrationSample.csproj ├── Startup.cs ├── appsettings.Development.json ├── appsettings.json └── wwwroot ├── css └── site.css ├── favicon.ico ├── js └── site.js └── lib ├── bootstrap ├── LICENSE └── dist │ ├── css │ ├── bootstrap-grid.css │ ├── bootstrap-grid.min.css │ ├── bootstrap-reboot.css │ ├── bootstrap-reboot.min.css │ ├── bootstrap.css │ └── bootstrap.min.css │ └── js │ ├── bootstrap.bundle.js │ ├── bootstrap.bundle.min.js │ ├── bootstrap.js │ └── bootstrap.min.js ├── jquery-validation-unobtrusive ├── LICENSE.txt ├── jquery.validate.unobtrusive.js └── jquery.validate.unobtrusive.min.js ├── jquery-validation ├── LICENSE.md └── dist │ ├── additional-methods.js │ ├── additional-methods.min.js │ ├── jquery.validate.js │ └── jquery.validate.min.js └── jquery ├── LICENSE.txt └── dist ├── jquery.js └── jquery.min.js /.github/workflows/dotnetcore.yml: -------------------------------------------------------------------------------- 1 | name: .NET Core 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Setup .NET Core 13 | uses: actions/setup-dotnet@v1 14 | with: 15 | dotnet-version: 3.1.100 16 | - name: Build with dotnet 17 | run: dotnet build src/ScfPackageSources.sln --configuration Release 18 | 19 | # - name: Publish NuGet 20 | # uses: rohith/publish-nuget@v2.0.0 21 | # with: 22 | # # Filepath of the project to be packaged, relative to root of repository 23 | # PROJECT_FILE_PATH: /**/*.csproj 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | /.vs 54 | /src/Basic/.vs/ScfPackageSources.Basic/v16 55 | *.user 56 | bin/ 57 | obj/ 58 | **/ProjectFileManager 59 | /src/BuildOutPut 60 | /src/.vs 61 | /src/Basic/.vs/ScfPackageSources.Basic/DesignTimeBuild 62 | /src/Extensions/Senparc.Xscf.DatabaseToolkit/Senparc.Xscf.DatabaseToolkit/App_Data/SenparcTraceLog 63 | /src/Basic/Senparc.Scf.XscfBase.Tests/App_Data/SenparcTraceLog/*.log 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > ## 注意:当前项目已停止更新,请移步:https://github.com/NeuCharFramework/NcfPackageSources 2 | 3 | 4 | 5 | # ScfPackageSources 6 | 7 | | | .NET Core | CI/CD 8 | |--------------|-----------------|--------------- 9 | | Basic | ![.NET Core](https://github.com/SenparcCoreFramework/ScfPackageSources/workflows/.NET%20Core/badge.svg) | [![Build status](https://mysenparc.visualstudio.com/SenparcCoreFramework/_apis/build/status/SenparcCoreFramework-ASP.NET%20Core-CI)](https://mysenparc.visualstudio.com/SenparcCoreFramework/_build/latest?definitionId=41) 10 | | Extensions | ![.NET Core](https://github.com/SenparcCoreFramework/ScfPackageSources/workflows/.NET%20Core/badge.svg) | [![Build status](https://mysenparc.visualstudio.com/SenparcCoreFramework/_apis/build/status/SenparcCoreFramework-ASP.NET%20Core-CI)](https://mysenparc.visualstudio.com/SenparcCoreFramework/_build/latest?definitionId=41) 11 | 12 | 13 | ## 说明 14 | 本项目为 [SCF(SenparcCoreFramework)](https://github.com/SenparcCoreFramework/SCF) 模板官方包的源码。 15 | 16 | 17 | | 文件夹 | 说明 | 18 | |--------------|-----------------| 19 | | src/Basic | 必须安装的基础官方库,以 `Separc.Scf.` 开头 20 | | src/Extensions | 可选的扩展包,以 `Senparc.Xscf.` 开头 21 | 22 | ## 欢迎贡献代码! 23 | -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS1712: 类型参数在 XML 注释中没有匹配的 typeparam 标记(但其他类型参数有) 4 | dotnet_diagnostic.CS1712.severity = none 5 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.AreaBase/Admin/Filters/AdminAuthorizeAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Senparc.Scf.Core.Config; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.AreaBase.Admin.Filters 8 | { 9 | /// 10 | /// 当前 Area 授权处理特性 11 | /// 12 | public class AdminAuthorizeAttribute : AuthorizeAttribute 13 | { 14 | //AuthorizeAttribute 可以和 MVC 通用:https://docs.microsoft.com/en-us/aspnet/core/razor-pages/filter?view=aspnetcore-2.2 15 | public static string AuthenticationScheme => SiteConfig.ScfAdminAuthorizeScheme; 16 | 17 | public AdminAuthorizeAttribute() 18 | { 19 | base.AuthenticationSchemes = AuthenticationScheme; 20 | } 21 | public AdminAuthorizeAttribute(string policy) : this() 22 | { 23 | this.Policy = policy; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.AreaBase/Admin/Filters/CustomerResourceAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Microsoft.AspNetCore.Mvc.Filters; 5 | 6 | namespace Senparc.Scf.AreaBase.Admin.Filters 7 | { 8 | public class CustomerResourceAttribute : Attribute 9 | { 10 | public string[] ResourceCodes { get; set; } 11 | 12 | public CustomerResourceAttribute(params string[] resuouceCodes) 13 | { 14 | ResourceCodes = resuouceCodes; 15 | } 16 | } 17 | 18 | /// 19 | /// 不进行权限校验 20 | /// 21 | public class IgnoreAuthAttribute: Attribute, IFilterMetadata 22 | { 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core.Tests/Senparc.Scf.Core.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | PreserveNewest 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core.Tests/TestBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Basic/Senparc.Scf.Core.Tests/TestBase.cs -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core.Tests/UnitTestHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.Core.Tests 7 | { 8 | public static class UnitTestHelper 9 | { 10 | /// 11 | /// 根目录地址 12 | /// 13 | public static string RootPath => Path.GetFullPath("..\\..\\..\\"); 14 | 15 | 16 | /// 17 | /// 检查关键字存在 18 | /// 19 | /// 20 | /// 21 | /// 22 | public static bool CheckKeywordsExist(string filePath, params string[] keywords) 23 | { 24 | using (var fs = new FileStream(filePath, FileMode.Open)) 25 | { 26 | using (var sr = new StreamReader(fs)) 27 | { 28 | var content = sr.ReadToEnd(); 29 | foreach (var item in keywords) 30 | { 31 | if (!content.Contains(item)) 32 | { 33 | return false; 34 | } 35 | } 36 | return true; 37 | } 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core.Tests/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | }, 8 | //CO2NET 设置 9 | "SenparcSetting": { 10 | "IsDebug": true, 11 | "DefaultCacheNamespace": "DefaultCacheTest" 12 | }, 13 | //Senparc.Weixin SDK 设置 14 | "SenparcWeixinSetting": { 15 | //微信全局 16 | "IsDebug": true, 17 | //公众号 18 | "Token": "weixin", 19 | "EncodingAESKey": "", 20 | "WeixinAppId": "WeixinAppId", 21 | "WeixinAppSecret": "WeixinAppSecret", 22 | //小程序 23 | "WxOpenAppId": "WxOpenAppId", 24 | "WxOpenAppSecret": "WxOpenAppSecret", 25 | //企业微信 26 | "WeixinCorpId": "WeixinCorpId", 27 | "WeixinCorpSecret": "WeixinCorpSecret", 28 | 29 | //微信支付 30 | //微信支付V2(旧版) 31 | "WeixinPay_PartnerId": "WeixinPay_PartnerId", 32 | "WeixinPay_Key": "WeixinPay_Key", 33 | "WeixinPay_AppId": "WeixinPay_AppId", 34 | "WeixinPay_AppKey": "WeixinPay_AppKey", 35 | "WeixinPay_TenpayNotify": "WeixinPay_TenpayNotify", 36 | //微信支付V3(新版) 37 | "TenPayV3_MchId": "TenPayV3_MchId", 38 | "TenPayV3_Key": "TenPayV3_Key", 39 | "TenPayV3_AppId": "TenPayV3_AppId", 40 | "TenPayV3_AppSecret": "TenPayV3_AppId", 41 | "TenPayV3_TenpayNotify": "TenPayV3_TenpayNotify", 42 | 43 | //开放平台 44 | "Component_Appid": "Component_Appid", 45 | "Component_Secret": "Component_Secret", 46 | "Component_Token": "Component_Token", 47 | "Component_EncodingAESKey": "Component_EncodingAESKey", 48 | 49 | //分布式缓存 50 | "Cache_Redis_Configuration": "Redis配置", //Redis配置 localhost:6379 51 | "Cache_Memcached_Configuration": "Memcached配置" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/AjaxReturnModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core 6 | { 7 | 8 | /// 9 | /// ajax返回模型 10 | /// 11 | public class AjaxReturnModel 12 | { 13 | public bool Success { get; set; } 14 | 15 | public string Msg { get; set; } 16 | } 17 | 18 | /// 19 | /// ajax返回模型 20 | /// 21 | /// 返回的对象 22 | public class AjaxReturnModel : AjaxReturnModel 23 | { 24 | public T Data { get; set; } 25 | 26 | public AjaxReturnModel() 27 | { 28 | 29 | } 30 | 31 | public AjaxReturnModel(T data) : this() 32 | { 33 | this.Data = data; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Areas/AreaPageMenuItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.Areas 6 | { 7 | /// 8 | /// Area 页面菜单项 9 | /// 10 | public class AreaPageMenuItem 11 | { 12 | public string Url { get; set; } 13 | public string Name { get; set; } 14 | public string Icon { get; set; } 15 | 16 | public AreaPageMenuItem(string url, string name, string icon) 17 | { 18 | Url = url; 19 | Name = name; 20 | Icon = icon; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Areas/IAreaRegister.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.Areas 8 | { 9 | /// 10 | /// Area 的 Register 接口 11 | /// 12 | public interface IAreaRegister 13 | { 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | /// 20 | IMvcBuilder AuthorizeConfig(IMvcBuilder builder, IWebHostEnvironment env); 21 | 22 | /// 23 | /// 如果提供了 UI 界面,必须指定一个首页,如:Admin/ 24 | /// 注意:此选项需要配合 XscfRegister 使用才有效,否则请忽略 25 | /// 26 | string HomeUrl { get; } 27 | 28 | /// 29 | /// 菜单项 30 | /// 31 | List AareaPageMenuItems { get; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/AssembleScan/AssembleScanItem.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Exceptions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Reflection; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.AssembleScan 8 | { 9 | public class AssembleScanItem 10 | { 11 | /// 12 | /// 扫描是否结束 13 | /// 14 | public bool ScanFinished { get; set; } 15 | 16 | /// 17 | /// 扫描是否成功 18 | /// 19 | public bool ScanSuccessed { get; set; } 20 | 21 | private Action _action; 22 | 23 | public AssembleScanItem(Action action) 24 | { 25 | _action = action ?? throw new ArgumentNullException("action"); 26 | } 27 | 28 | private object _lock { get; set; } = new object(); 29 | /// 30 | /// 执行扫描 31 | /// 32 | /// 33 | public void Run(Assembly assembly) 34 | { 35 | lock (_lock) 36 | { 37 | try 38 | { 39 | _action(assembly); 40 | ScanSuccessed &= true; 41 | } 42 | catch (Exception ex) 43 | { 44 | ScanSuccessed = false; 45 | new SCFExceptionBase("执行程序集扫描出错", ex); 46 | } 47 | finally 48 | { 49 | } 50 | } 51 | } 52 | 53 | public void Finished() 54 | { 55 | ScanFinished = true; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/AutoMapper/SystemProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Microsoft.AspNetCore.Mvc.Rendering; 3 | using Senparc.Scf.Core.Models; 4 | using Senparc.Scf.Core.Models.DataBaseModel; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace Senparc.Scf.Core.AutoMapper 10 | { 11 | /// 12 | /// AutoMapp 的 Profile 13 | /// 14 | public class SystemProfile : Profile 15 | { 16 | public SystemProfile() 17 | { 18 | CreateMap().ForMember(_ => _.Text, opt => opt.MapFrom(_ => _.MenuName)) 19 | .ForMember(_ => _.Value, opt => opt.MapFrom(_ => _.Id)); 20 | CreateMap(); 21 | CreateMap().ForMember(_ => _.IsMenu, opt => opt.MapFrom(_ => true)); 22 | CreateMap().ForMember(_ => _.IsMenu, opt => opt.MapFrom(_ => false)) 23 | .ForMember(_ => _.MenuName, opt => opt.MapFrom(_ => _.ButtonName)) 24 | .ForMember(_ => _.ParentId, opt => opt.MapFrom(_ => _.MenuId)) 25 | .ForMember(_ => _.Sort, opt => opt.MapFrom(_ => 0)) 26 | .ForMember(_ => _.Url, opt => opt.MapFrom(_ => _.Url)) 27 | .ForMember(_ => _.Visible, opt => opt.MapFrom(_ => true)) 28 | .ForMember(_ => _.Id, opt => opt.MapFrom(_ => _.Id)) 29 | .ForMember(_ => _.ResourceCode, opt => opt.MapFrom(_ => _.OpearMark)); 30 | CreateMap(); 31 | 32 | CreateMap(); 33 | CreateMap(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/BaseCache/ICacheData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache 4 | { 5 | public interface ICacheData 6 | { 7 | /// 8 | /// 缓存键 9 | /// 10 | string Key { get; } 11 | 12 | DateTime CacheTime { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/CacheDataMessageQueue/CacheDataMessageQueueItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache 4 | { 5 | /// 6 | /// CacheDataMessageQueue消息列队项 7 | /// 8 | public class CacheDataMessageQueueItem 9 | { 10 | /// 11 | /// 列队项唯一标识 12 | /// 13 | public string Key { get; set; } 14 | /// 15 | /// 列队项目命中触发时执行的委托 16 | /// 17 | public Action Action { get; set; } 18 | /// 19 | /// 此实例对象的创建时间 20 | /// 21 | public DateTime AddTime { get; set; } 22 | /// 23 | /// 项目说明(主要用于调试) 24 | /// 25 | public string Description { get; set; } 26 | 27 | /// 28 | /// 初始化SenparcMessageQueue消息列队项 29 | /// 30 | /// 31 | /// 32 | /// 33 | public CacheDataMessageQueueItem(string key, Action action, string description = null) 34 | { 35 | Key = key; 36 | Action = action; 37 | Description = description; 38 | AddTime = DateTime.Now; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/CommonCacheAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache 4 | { 5 | [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] 6 | public class CommonCacheAttribute : Attribute 7 | { 8 | 9 | public override bool IsDefaultAttribute() 10 | { 11 | return base.IsDefaultAttribute(); 12 | } 13 | 14 | public override bool Equals(object obj) 15 | { 16 | return base.Equals(obj); 17 | } 18 | 19 | public override bool Match(object obj) 20 | { 21 | return base.Match(obj); 22 | } 23 | 24 | public override int GetHashCode() 25 | { 26 | return base.GetHashCode(); 27 | } 28 | 29 | public CommonCacheAttribute() 30 | { 31 | //System.Web.HttpContext.Current.Response.Write(this.GetType()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/CommonDataCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache 4 | { 5 | public class CommonDataCache : BaseCache, ICommonDataCache where T : class,new() 6 | { 7 | public const string CACHE_KEY = "__CommonDataCache"; 8 | string _key; 9 | Func _fun; 10 | 11 | /// 12 | /// 公用缓存模块,默认超时时间:1440分钟(1天) 13 | /// 14 | /// 全局唯一Key(只需要确保在CommonDataCache模块内唯一) 15 | /// 16 | public CommonDataCache(string key, Func fun) 17 | :this(key, 1440, fun) 18 | { 19 | } 20 | 21 | /// 22 | /// 公用缓存模块 23 | /// 24 | /// 全局唯一Key(只需要确保在CommonDataCache模块内唯一) 25 | /// 缓存时间(分钟) 26 | /// 27 | public CommonDataCache(string key, int timeout, Func fun) 28 | : base(CACHE_KEY + key) 29 | { 30 | _key = CACHE_KEY + key; 31 | base.TimeOut = timeout; 32 | this._fun = fun; 33 | } 34 | 35 | public override T Update() 36 | { 37 | base.SetData(_fun(), base.TimeOut, null); 38 | return base.Data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/Extensions/ObjectCacheStrategyExtensions.cs: -------------------------------------------------------------------------------- 1 | using Senparc.CO2NET.Cache; 2 | using Senparc.CO2NET.Cache.CsRedis; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Senparc.Scf.Core.Cache.Extensions 9 | { 10 | public static class ObjectCacheStrategyExtensions 11 | { 12 | public static IList GetAllByPrefix(this IBaseObjectCacheStrategy obj, string key) 13 | { 14 | if (obj is RedisObjectCacheStrategy) 15 | { 16 | var _obj = obj as RedisObjectCacheStrategy; 17 | return _obj.GetAllByPrefix(key); 18 | } 19 | throw new Exception("未实现或缓存不支持前缀方式获取缓存!"); 20 | } 21 | 22 | public static async Task> GetAllByPrefixAsync(this IBaseObjectCacheStrategy obj, string key) 23 | { 24 | if (obj is RedisObjectCacheStrategy) 25 | { 26 | var _obj = obj as RedisObjectCacheStrategy; 27 | return await _obj.GetAllByPrefixAsync(key); 28 | } 29 | throw new Exception("未实现或缓存不支持前缀方式获取缓存!"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/Interface/IBaseCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Senparc.CO2NET.Cache; 3 | using Senparc.Scf.Core.DI; 4 | 5 | namespace Senparc.Scf.Core.Cache 6 | { 7 | public interface IBaseCache : IAutoDI 8 | where T : class, new() 9 | { 10 | IBaseObjectCacheStrategy Cache { get; set; } 11 | /// 12 | /// Data不能在Update()方法中调用,否则会引发循环调用。Update()方法中应该使用SetData()方法 13 | /// 14 | T Data { get; set; } 15 | DateTime CacheTime { get; set; } 16 | DateTime CacheTimeOut { get; set; } 17 | void RemoveCache(); 18 | void SetData(T value, int timeOut, BaseCache.UpdateWithBataBase updateWithDatabases); 19 | T Update(); 20 | void UpdateToDatabase(T obj); 21 | 22 | ///// 23 | ///// 更新到缓存 24 | ///// 25 | ///// 26 | ///// 27 | ///// 28 | //bool UpdateToCache(string key, T obj); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/Interface/IBaseCacheStrategy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Senparc.CO2NET.Cache; 4 | 5 | namespace Senparc.Scf.Core.Cache 6 | { 7 | 8 | //public interface IBaseCacheStrategy 9 | //{ 10 | // /// 11 | // /// 开始一个同步锁 12 | // /// 13 | // /// 14 | // /// 15 | // /// 16 | // /// 17 | // /// 18 | // ICacheLock BeginCacheLock(string resourceName, string key, int retryCount = 0, 19 | // TimeSpan retryDelay = new TimeSpan()); 20 | 21 | //} 22 | 23 | /// 24 | /// 公共缓存策略接口 25 | /// 26 | public interface IScfCacheStrategy : IBaseObjectCacheStrategy 27 | { 28 | /// 29 | /// 整个Cache集合的Key 30 | /// 31 | string CacheSetKey { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/Interface/ICommonDataCache.cs: -------------------------------------------------------------------------------- 1 | namespace Senparc.Scf.Core.Cache 2 | { 3 | public interface ICommonDataCache : IBaseCache where T : class, new() 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/MethodCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Senparc.CO2NET.Cache; 3 | 4 | namespace Senparc.Scf.Core.Cache 5 | { 6 | public static class MethodCache 7 | { 8 | public static T GetMethodCache(string cacheKey, Func func, int timeoutSeconds) where T : class 9 | { 10 | 11 | cacheKey = cacheKey.ToUpper(); 12 | 13 | var cache = CacheStrategyFactory.GetObjectCacheStrategyInstance(); 14 | 15 | T result; 16 | 17 | if (!cache.CheckExisted(cacheKey)) 18 | { 19 | cache.Set(cacheKey, func(), //每次储存的是重新执行过的最新的结果 20 | TimeSpan.FromSeconds(timeoutSeconds)); 21 | } 22 | 23 | result = cache.Get(cacheKey);//输出结果 24 | 25 | return result; 26 | } 27 | 28 | public static T GetMethodCache(string cacheKey, Func func) where T : class 29 | { 30 | return GetMethodCache(cacheKey, func, 60 * 60); 31 | } 32 | 33 | /// 34 | /// 清除缓存 35 | /// 36 | /// 37 | public static void ClearMethodCache(string cacheKey) where T : class //虽然这边的T不需要传入,不过为了拿到CacheStrategy仍然需要提供 38 | { 39 | cacheKey = cacheKey.ToUpper(); 40 | 41 | var cache = CacheStrategyFactory.GetObjectCacheStrategyInstance(); 42 | 43 | cache.RemoveFromCache(cacheKey); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/QueueCache/DemoLoginKeyCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache 4 | { 5 | [Serializable] 6 | public class DemoLoginKeyCacheData 7 | { 8 | public string OpenId { get; set; } 9 | public DateTime AddTime { get; set; } 10 | public QrCodeLoginDataType QrCodeLoginDataType { get; set; } 11 | public DemoLoginKeyCacheData(string openId, QrCodeLoginDataType qrCodeLoginDataType) 12 | { 13 | OpenId = openId; 14 | QrCodeLoginDataType = qrCodeLoginDataType; 15 | AddTime = DateTime.Now; 16 | } 17 | } 18 | 19 | /// 20 | /// 登录许可缓存(缓存数据:UserId) 21 | /// 22 | public interface IDemoLoginKeyCache : IQueueCache 23 | { 24 | 25 | } 26 | 27 | [Serializable] 28 | public class DemoLoginKeyCache : QueueCache, IDemoLoginKeyCache 29 | { 30 | private const string cacheKey = "DemoLoginKeyCache"; 31 | private const int timeoutSeconds = 5 * 60; 32 | public DemoLoginKeyCache() 33 | : base(cacheKey, timeoutSeconds) 34 | { 35 | 36 | } 37 | 38 | public override QueueCacheData Get(string key, bool removeDataWhenExist = true) 39 | { 40 | var value = base.Get(key,removeDataWhenExist); 41 | if (value != null) 42 | { 43 | base.Remove(key);//一次性有效 44 | } 45 | return value; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/QueueCache/OAuthCodeCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache 4 | { 5 | [Serializable] 6 | public class OAuthCodeData 7 | { 8 | 9 | public int AccountId { get; set; } 10 | public int AppId { get; set; } 11 | public string AppKey { get; set; } 12 | public string AppSecret { get; set; } 13 | 14 | public OAuthCodeData(int accountId, int appId, string appKey, string appSecret) 15 | { 16 | AccountId = accountId; 17 | AppId = appId; 18 | AppKey = appKey; 19 | AppSecret = appSecret; 20 | } 21 | } 22 | 23 | /// 24 | /// 登录许可缓存(缓存数据:UserId) 25 | /// 26 | public interface IOAuthCodeCache : IQueueCache 27 | { 28 | 29 | } 30 | 31 | [Serializable] 32 | public class OAuthCodeCache : QueueCache, IOAuthCodeCache 33 | { 34 | private const string cacheKey = "OAuthCodeCache"; 35 | private const int timeoutSeconds = 5 * 60; 36 | public OAuthCodeCache() 37 | : base(cacheKey, timeoutSeconds) 38 | { 39 | 40 | } 41 | 42 | public override string CreateKey() 43 | { 44 | return Guid.NewGuid().ToString("n"); 45 | } 46 | 47 | public override QueueCacheData Get(string key, bool removeDataWhenExist = true) 48 | { 49 | var value = base.Get(key, removeDataWhenExist); 50 | if (value != null) 51 | { 52 | base.Remove(key);//一次性有效 53 | } 54 | return value; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/QueueCache/PhoneCheckCodeCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache 4 | { 5 | [Serializable] 6 | public class PhoneCheckCodeData 7 | { 8 | public string Phone { get; set; } 9 | 10 | public PhoneCheckCodeData(string phone) 11 | { 12 | Phone = phone; 13 | } 14 | } 15 | 16 | ///// 17 | ///// 手机验证码 18 | ///// 19 | //public interface IPhoneCheckCodeCache : IQueueCache 20 | //{ 21 | 22 | //} 23 | 24 | /// 25 | /// 手机验证码 26 | /// 27 | [Serializable] 28 | public class PhoneCheckCodeCache : QueueCache/*, IPhoneCheckCodeCache*/ 29 | { 30 | private const string cacheKey = "PhoneCheckCodeCache"; 31 | private const int timeoutSeconds = 10 * 60; 32 | public PhoneCheckCodeCache() 33 | : base(cacheKey, timeoutSeconds) 34 | { 35 | 36 | } 37 | 38 | public override string CreateKey() 39 | { 40 | string key = new Random().Next(100000,999999).ToString("######"); 41 | return key; 42 | } 43 | 44 | public override QueueCacheData Get(string key, bool removeDataWhenExist = true) 45 | { 46 | var value = base.Get(key, removeDataWhenExist); 47 | if (value != null) 48 | { 49 | base.Remove(key);//一次性有效 50 | } 51 | return value; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/QueueCache/QrCodeBaseData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache 4 | { 5 | /// 6 | /// 二维码缓存[暂未使用] 7 | /// 8 | [Serializable] 9 | public class QrCodeBaseData 10 | { 11 | /// 12 | /// 即SceneId的字 13 | /// 14 | public string Key { get; set; } 15 | public int SceneId { get; set; } 16 | public string Ticket { get; set; } 17 | public DateTime ExpireTime { get; set; } 18 | public Guid Guid { get; set; } 19 | /// 20 | /// 验证通过 21 | /// 22 | public bool CheckPassed { get; set; } 23 | public string UserName { get; set; } 24 | 25 | public QrCodeBaseData(int sceneId, int expireSeconds, string ticket, Guid guid) 26 | { 27 | SceneId = sceneId; 28 | Key = sceneId.ToString(); 29 | Ticket = ticket; 30 | ExpireTime = DateTime.Now.AddSeconds(expireSeconds - 5); 31 | Guid = guid; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/QueueCache/QueueCacheData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache 4 | { 5 | [Serializable] 6 | public class QueueCacheData 7 | { 8 | public string Key { get; set; } 9 | 10 | public DateTime LastActiveTime { get; set; } 11 | 12 | public T Data { get; set; } 13 | 14 | public QueueCacheData(string key) 15 | { 16 | Key = key; 17 | LastActiveTime = DateTime.Now; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Cache/QueueCache/WeixinCheckCodeCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Cache.QueueCache 4 | { 5 | //public interface IWeixinCheckCodeCache : IQueueCache> 6 | //{ 7 | //} 8 | 9 | [Serializable] 10 | public class WeixinCheckCodeCache : QueueCache>/*, IWeixinCheckCodeCache*/ 11 | { 12 | private const string cacheKey = "WeixinCheckCodeCache"; 13 | private const int timeoutSeconds = 3 * 60; 14 | public WeixinCheckCodeCache() 15 | : base(cacheKey, timeoutSeconds) 16 | { 17 | 18 | } 19 | 20 | public override QueueCacheData> Get(string key, bool removeDataWhenExist = true) 21 | { 22 | var value = base.Get(key, removeDataWhenExist); 23 | if (value != null) 24 | { 25 | base.Remove(key);//一次性有效 26 | } 27 | return value; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/DI/AutoDITypeAttribute.cs: -------------------------------------------------------------------------------- 1 | using Senparc.CO2NET; 2 | using Senparc.Scf.Core.Enums; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.DI 8 | { 9 | /// 10 | /// 自动依赖注入特性标签 11 | /// 12 | public class AutoDITypeAttribute : Attribute 13 | { 14 | public DILifecycleType DILifecycleType { get; set; } = DILifecycleType.Scoped; 15 | 16 | public AutoDITypeAttribute() { } 17 | 18 | public AutoDITypeAttribute(DILifecycleType diLifecycleType) 19 | { 20 | DILifecycleType = diLifecycleType; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/DI/IAutoDI.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.Core.DI 7 | { 8 | /// 9 | /// 所有需要自动扫描进行依赖注入的基础接口 10 | /// 默认 DI 使用 AddScoped 方法,如果需要强制使用其他方法,请在子类上使用 [AutoDIType(typeName)] 特性标签 11 | /// 12 | public interface IAutoDI 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Email/AutoSendLogEmail.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Linq; 3 | 4 | namespace Senparc.Scf.Core.Email 5 | { 6 | using Senparc.Scf.Core.Enums; 7 | 8 | public static class AutoSendLogEmail 9 | { 10 | public static void SendLogEmail(Exception e) 11 | { 12 | XDocument doc = new XDocument(); 13 | doc.Root.Add(new XElement("ErrorLogo", 14 | new XElement("Time", DateTime.Now), 15 | new XElement("Exception Message", e.Message), 16 | new XElement("InnerException", e.InnerException), 17 | new XElement("StackTrace", e.StackTrace) 18 | )); 19 | SendEmail sendExceptionEmail = new SendEmail(SendEmailType.CustomEmail); 20 | SendEmailParameter_CustomEmail sendEmailParam = new SendEmailParameter_CustomEmail("zsu@senparc.com", "[后台运行]", "Senparc运行错误", doc.ToString()); 21 | sendExceptionEmail.Send(sendEmailParam, true, true, EmailAccountType.Default); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Email/SendEmailParameters.Core.cs: -------------------------------------------------------------------------------- 1 | using Senparc.CO2NET.Extensions; 2 | using Senparc.Scf.Core.Extensions; 3 | 4 | namespace Senparc.Scf.Core.Email 5 | { 6 | public class SendEmailParameter 7 | { 8 | public string ToEmail { get; set; } 9 | public string UserName { get; set; } 10 | public string UserNameUrlEncode { get { return UserName.UrlEncode(); } } 11 | //public string Year { get { return DateTime.Now.Year.ToString(); } } 12 | } 13 | 14 | /// 15 | /// 测试邮件发送 16 | /// 17 | public class SendEmailParameter_Test : SendEmailParameter 18 | { 19 | public string TestType { get; set; } 20 | public string Domain { get; set; } 21 | public string EmailType { get; set; } 22 | public SendEmailParameter_Test(string toEmail, string userName, string testType, string domain, string emailType) 23 | { 24 | ToEmail = toEmail; UserName = userName; TestType = testType; Domain = domain; EmailType = emailType; 25 | } 26 | } 27 | 28 | /// 29 | /// 自定义邮件 30 | /// 31 | public class SendEmailParameter_CustomEmail : SendEmailParameter 32 | { 33 | public string Title { get; set; } 34 | public string Content { get; set; } 35 | public SendEmailParameter_CustomEmail(string toEmail, string userName, string title, string content) 36 | { 37 | ToEmail = toEmail; UserName = userName; 38 | Title = title; Content = content; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Exceptions/SCFExceptionBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.Exceptions 6 | { 7 | public class SCFExceptionBase : CO2NET.Exceptions.BaseException 8 | { 9 | public SCFExceptionBase(string message, bool logged = false) : base(message, logged) 10 | { 11 | } 12 | 13 | public SCFExceptionBase(string message, Exception inner, bool logged = false) : base(message, inner, logged) 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Exceptions/ScfModuleException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.Exceptions 6 | { 7 | public class ScfModuleException : SCFExceptionBase 8 | { 9 | //public IXscfRegister XscfRegister; 10 | public ScfModuleException(string message, bool logged = false) : base(message, logged) 11 | { 12 | } 13 | 14 | public ScfModuleException(string message, Exception inner, bool logged = false) : base(message, inner, logged) 15 | { 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Exceptions/ScfUninstallException.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Exceptions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.Core 7 | { 8 | /// 9 | /// SCF 未安装 10 | /// 11 | public class ScfUninstallException : SCFExceptionBase 12 | { 13 | public ScfUninstallException(string message, bool logged = false) : base(message, logged) 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Extensions/AuthorizeAttributeExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | 3 | namespace Senparc.Scf.Core.Extensions 4 | { 5 | 6 | //TODO: 独立到各个模块中 7 | 8 | public class UserAuthorizeAttribute : AuthorizeAttribute 9 | { 10 | public const string AuthenticationScheme = "ScfUserAuthorizeScheme"; 11 | public UserAuthorizeAttribute(string policy) : this() 12 | { 13 | this.Policy = policy; 14 | } 15 | public UserAuthorizeAttribute() 16 | { 17 | base.AuthenticationSchemes = AuthenticationScheme; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Extensions/EntityFrameworkExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Linq.Expressions; 5 | 6 | namespace Senparc.Scf.Core.Extensions 7 | { 8 | public class EntityFrameworkExtensions 9 | { 10 | public static Expression> BuildContainsExpression(Expression> valueSelector, IEnumerable values) 11 | { 12 | if (null == valueSelector) 13 | { 14 | throw new ArgumentNullException(nameof(valueSelector)); 15 | } 16 | 17 | if (null == values) 18 | { 19 | throw new ArgumentNullException(nameof(values)); 20 | } 21 | 22 | ParameterExpression p = valueSelector.Parameters.Single(); 23 | 24 | // p => valueSelector(p) == values[0] || valueSelector(p) == ... 25 | 26 | if (!values.Any()) 27 | { 28 | return e => false; 29 | } 30 | 31 | var equals = values.Select(value => (Expression)Expression.Equal(valueSelector.Body, Expression.Constant(value, typeof(TValue)))); 32 | 33 | var body = equals.Aggregate((accumulate, equal) => Expression.Or(accumulate, equal)); 34 | 35 | return Expression.Lambda>(body, p); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Extensions/EntityTypeProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using Microsoft.Extensions.DependencyModel; 6 | 7 | namespace Senparc.Scf.Core.Models 8 | { 9 | public interface IEntityTypeProvider 10 | { 11 | IEnumerable GetEntityTypes(Type type); 12 | } 13 | 14 | public class DefaultEntityTypeProvider : IEntityTypeProvider 15 | { 16 | private static IList _entityTypeCache; 17 | public IEnumerable GetEntityTypes(Type type) 18 | { 19 | if (_entityTypeCache != null) 20 | { 21 | return _entityTypeCache.ToList(); 22 | } 23 | 24 | _entityTypeCache = (from assembly in GetReferencingAssemblies() 25 | from definedType in assembly.DefinedTypes 26 | where definedType.BaseType == type 27 | select definedType.AsType()).ToList(); 28 | return _entityTypeCache; 29 | } 30 | 31 | private static IEnumerable GetReferencingAssemblies() 32 | { 33 | var dependencies = DependencyContext.Default.RuntimeLibraries; 34 | return from library in dependencies 35 | select Assembly.Load(new AssemblyName(library.Name)); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Extensions/ObjectExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Senparc.Scf.Core.Extensions 2 | { 3 | public static class ObjectExtensions 4 | { 5 | /// 6 | /// 判断对象是否为null 7 | /// 8 | /// 9 | /// 10 | public static bool IsNull(object obj) 11 | { 12 | return obj == null; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/AccountPayLog.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Senparc.Scf.Core.Models 6 | { 7 | [Serializable] 8 | public partial class AccountPayLog : EntityBase 9 | { 10 | public AccountPayLog() 11 | { 12 | this.PointsLogs = new HashSet(); 13 | } 14 | 15 | 16 | public int AccountId { get; set; } 17 | 18 | public string OrderNumber { get; set; } 19 | 20 | public decimal TotalPrice { get; set; } 21 | 22 | public decimal PayMoney { get; set; } 23 | 24 | public decimal? UsedPoints { get; set; } 25 | 26 | public System.DateTime CompleteTime { get; set; } 27 | 28 | public string AddIp { get; set; } 29 | 30 | public decimal GetPoints { get; set; } 31 | 32 | public byte Status { get; set; } 33 | 34 | public string Description { get; set; } 35 | 36 | public byte? Type { get; set; } 37 | public string TradeNumber { get; set; } 38 | public string PrepayId { get; set; } 39 | public int PayType { get; set; } 40 | public int OrderType { get; set; } 41 | public string PayParam { get; set; } 42 | public decimal Price { get; set; } 43 | public decimal Fee { get; set; } 44 | 45 | public virtual ICollection PointsLogs { get; set; } 46 | public virtual Account Account { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Dto/AdminUserInfoDto.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Models.DataBaseModel; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.Models 8 | { 9 | /// 10 | /// AdminUserInfo 创建和更新 11 | /// 12 | public class AdminUserInfoDto : DtoBase 13 | { 14 | public int Id { get; set; } 15 | public string UserName { get; set; } 16 | public string Password { get; set; } 17 | 18 | public string Note { get; set; } 19 | 20 | public string RealName { get; set; } 21 | 22 | public string Phone { get; set; } 23 | } 24 | 25 | public class CreateOrUpdate_AdminUserInfoDto : AdminUserInfoDto 26 | { 27 | [Required] 28 | [StringLength(20)] 29 | new public string UserName { get; set; } 30 | new public string Password { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Dto/Base/DtoBase.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.Models 8 | { 9 | /// 10 | /// 数据库 Dto 基类 11 | /// 12 | public class DtoBase: IDtoBase 13 | { 14 | /// 15 | /// 是否软删除 16 | /// 17 | public bool Flag { get; set; } 18 | 19 | /// 20 | /// 21 | /// 22 | [MaxLength(150)] 23 | public string AdminRemark { get; set; } 24 | 25 | /// 26 | /// 27 | /// 28 | [MaxLength(150)] 29 | public string Remark { get; set; } 30 | 31 | /// 32 | /// 添加时间 33 | /// 34 | public DateTime AddTime { get; set; } 35 | /// 36 | /// 上次更新时间 37 | /// 38 | public DateTime LastUpdateTime { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Dto/Base/IDtoBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.Core.Models 7 | { 8 | /// 9 | /// 所有 DTO 接口或类的基类 10 | /// 11 | public interface IDtoBase 12 | { 13 | /// 14 | /// 是否软删除 15 | /// 16 | bool Flag { get; set; } 17 | 18 | /// 19 | /// 20 | /// 21 | [MaxLength(150)] 22 | string AdminRemark { get; set; } 23 | 24 | /// 25 | /// 26 | /// 27 | [MaxLength(150)] 28 | string Remark { get; set; } 29 | 30 | /// 31 | /// 添加时间 32 | /// 33 | DateTime AddTime { get; set; } 34 | /// 35 | /// 上次更新时间 36 | /// 37 | DateTime LastUpdateTime { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Dto/Base/QueryDtoBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.Models.DataBaseModel.Dto.Base 6 | { 7 | public class QueryDtoBase 8 | { 9 | /// 10 | /// xxxx Desc, ddd asc 11 | /// 12 | public string OrderBy { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Dto/SysButtonDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.Core.Models.DataBaseModel 7 | { 8 | public class SysButtonDto : DtoBase 9 | { 10 | 11 | //public bool IsDeleted { get; set; } 12 | 13 | public string Id { get; set; } 14 | 15 | /// 16 | /// 菜单id 17 | /// 18 | [MaxLength(50)] 19 | public string MenuId { get; set; } 20 | 21 | /// 22 | /// 操作名称 23 | /// 24 | [MaxLength(50)] 25 | //[Required] 26 | public string ButtonName { get; set; } 27 | 28 | /// 29 | /// 操作标识 30 | /// 31 | [MaxLength(50)] 32 | public string OpearMark { get; set; } 33 | 34 | /// 35 | /// 按钮对应的请求地址 36 | /// 37 | [MaxLength(350)] 38 | public string Url { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Dto/SysPermissionDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.Models.DataBaseModel 6 | { 7 | public class SysPermissionDto : DtoBase 8 | { 9 | public string RoleId { get; set; } 10 | 11 | public string PermissionId { get; set; } 12 | 13 | public bool IsMenu { get; set; } 14 | 15 | /// 16 | /// 角色代码 17 | /// 18 | public string RoleCode { get; set; } 19 | 20 | /// 21 | /// 资源(按钮)代码 22 | /// 23 | public string ResourceCode { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Dto/SysRoleAdminUserInfoDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.Models.DataBaseModel 6 | { 7 | public class SysRoleAdminUserInfoDto : DtoBase 8 | { 9 | /// 10 | /// 角色名称 11 | /// 12 | public string RoleName { get; set; } 13 | 14 | /// 15 | /// 角色编号 16 | /// 17 | public string RoleId { get; set; } 18 | 19 | /// 20 | /// 用户编号 21 | /// 22 | public int AdminAccountId { get; set; } 23 | 24 | /// 25 | /// 当前用户是否有此角色 26 | /// 27 | public bool HasRole { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Dto/SysRoleDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.Core.Models.DataBaseModel 7 | { 8 | public class SysRoleDto : DtoBase 9 | { 10 | [MaxLength(50)] 11 | public string Id { get; set; } 12 | 13 | /// 14 | /// 角色名称 15 | /// 16 | [MaxLength(50)] 17 | public string RoleName { get; set; } 18 | 19 | /// 20 | /// 角色代码 21 | /// 22 | [MaxLength(50)] 23 | public string RoleCode { get; set; } 24 | 25 | /// 26 | /// 启用 27 | /// 28 | public bool Enabled { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Mapping/Base/BlankEntityTypeConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.Models.DataBaseModel 8 | { 9 | /// 10 | /// 空的实现 IEntityTypeConfiguration 接口的类 11 | /// 12 | /// 13 | public class BlankEntityTypeConfiguration : IEntityTypeConfiguration 14 | where TEntity : class 15 | { 16 | public void Configure(EntityTypeBuilder builder) 17 | { 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Mapping/Base/ConfigurationMappingBase.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.Models.DataBaseModel 8 | { 9 | /// 10 | /// 包含 Id(Key)的 ConfigurationMapping 基类 11 | /// 12 | /// 13 | public class ConfigurationMappingWithIdBase : ConfigurationMappingBase, IEntityTypeConfiguration 14 | where TEntity : EntityBase 15 | { 16 | /// 17 | /// 配置 实例 18 | /// 19 | /// 20 | public override void Configure(EntityTypeBuilder builder) 21 | { 22 | builder.HasKey(z => z.Id); 23 | base.Configure(builder); 24 | } 25 | } 26 | 27 | /// 28 | /// 不包含 Id(Key)的 ConfigurationMapping 基类 29 | /// 30 | public class ConfigurationMappingBase : IEntityTypeConfiguration 31 | where TEntity : EntityBase 32 | { 33 | /// 34 | /// 配置 实例 35 | /// 36 | /// 37 | public virtual void Configure(EntityTypeBuilder builder) 38 | { 39 | builder.Property(e => e.AddTime).HasColumnType("datetime").IsRequired(); 40 | builder.Property(e => e.LastUpdateTime).HasColumnType("datetime").IsRequired(); 41 | } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Mapping/PointsLogConfigurationMapping.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 3 | using Senparc.Scf.Core.Models.DataBaseModel; 4 | using System; 5 | 6 | namespace Senparc.Scf.Core.Models 7 | { 8 | public class PointsLogConfigurationMapping : ConfigurationMappingWithIdBase 9 | { 10 | public override void Configure(EntityTypeBuilder builder) 11 | { 12 | builder.Property(e => e.Points).HasColumnType("decimal(18, 2)").IsRequired(); 13 | builder.Property(e => e.BeforePoints).HasColumnType("decimal(18, 2)").IsRequired(); 14 | builder.Property(e => e.AfterPoints).HasColumnType("decimal(18, 2)").IsRequired(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/Mapping/XscfModuleAccountConfigurationMapping.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.Models.DataBaseModel 8 | { 9 | public class XscfModuleAccountConfigurationMapping : ConfigurationMappingWithIdBase 10 | { 11 | public override void Configure(EntityTypeBuilder builder) 12 | { 13 | base.Configure(builder); 14 | 15 | builder.Property(e => e.Name).HasMaxLength(100).IsRequired(); 16 | builder.Property(e => e.Uid).HasMaxLength(100).IsRequired(); 17 | builder.Property(e => e.MenuName).HasMaxLength(100); 18 | builder.Property(e => e.Version).HasMaxLength(100).IsRequired(); 19 | builder.Property(e => e.UpdateLog).HasColumnType("ntext").IsRequired(); 20 | builder.Property(e => e.AllowRemove).IsRequired(); 21 | builder.Property(e => e.MenuId).HasMaxLength(100); 22 | builder.Property(e => e.State).IsRequired(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/PointsLog.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Models; 2 | using System; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | 6 | namespace Senparc.Scf.Core.Models 7 | { 8 | [Serializable] 9 | public partial class PointsLog : EntityBase 10 | { 11 | public int AccountId { get; set; } 12 | public int? AccountPayLogId { get; set; } 13 | 14 | public decimal Points { get; set; } 15 | 16 | public decimal BeforePoints { get; set; } 17 | 18 | public decimal AfterPoints { get; set; } 19 | 20 | public string Description { get; set; } 21 | 22 | public virtual AccountPayLog AccountPayLog { get; set; } 23 | public virtual Account Account { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/SysPermission.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.Models.DataBaseModel 8 | { 9 | /// 10 | /// 角色菜单表 11 | /// 12 | public class SysPermission : EntityBase 13 | { 14 | public SysPermission() 15 | { 16 | AddTime = DateTime.Now; 17 | LastUpdateTime = DateTime.Now; 18 | } 19 | 20 | public SysPermission(SysPermissionDto item) : this() 21 | { 22 | RoleId = item.RoleId; 23 | IsMenu = item.IsMenu; 24 | PermissionId = item.PermissionId; 25 | RoleCode = item.RoleCode; 26 | ResourceCode = item.ResourceCode; 27 | } 28 | 29 | /// 30 | /// 角色代码 31 | /// 32 | [MaxLength(20)] 33 | public string RoleCode { get; set; } 34 | 35 | /// 36 | /// 资源(按钮)代码 37 | /// 38 | [MaxLength(20)] 39 | public string ResourceCode { get; set; } 40 | 41 | /// 42 | /// 角色Id 43 | /// 44 | [MaxLength(50)] 45 | public string RoleId { get; set; } 46 | 47 | /// 48 | /// 是否是菜单 49 | /// 50 | public bool IsMenu { get; set; } 51 | 52 | /// 53 | /// 权限Id(菜单或者是按钮) 54 | /// 55 | [MaxLength(50)] 56 | public string PermissionId { get; set; } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/SysRoleAdminUserInfo.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.Models.DataBaseModel 8 | { 9 | /// 10 | /// 角色人员表 11 | /// 12 | public class SysRoleAdminUserInfo : EntityBase 13 | { 14 | public SysRoleAdminUserInfo() 15 | { 16 | AddTime = DateTime.Now; 17 | LastUpdateTime = DateTime.Now; 18 | } 19 | 20 | public SysRoleAdminUserInfo(int accountId, string roleId, string roleCode) : this() 21 | { 22 | AccountId = accountId; 23 | RoleId = roleId; 24 | RoleCode = roleCode; 25 | } 26 | 27 | [MaxLength(20)] 28 | public string RoleCode { get; set; } 29 | 30 | /// 31 | /// 管理员Id 32 | /// 33 | public int AccountId { get; set; } 34 | 35 | /// 36 | /// 角色Id 37 | /// 38 | [MaxLength(50)] 39 | public string RoleId { get; set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/DataBaseModel/SystemConfig.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Models; 2 | using System; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | 6 | namespace Senparc.Scf.Core.Models 7 | { 8 | [Serializable] 9 | public partial class SystemConfig : EntityBase 10 | { 11 | [Required] 12 | [Column(TypeName = "nvarchar(100)")] 13 | public string SystemName { get; set; } 14 | 15 | [Column(TypeName = "varchar(100)")] 16 | public string MchId { get; set; } 17 | 18 | [Column(TypeName = "varchar(300)")] 19 | public string MchKey { get; set; } 20 | 21 | [Column(TypeName = "varchar(100)")] 22 | public string TenPayAppId { get; set; } 23 | 24 | /// 25 | /// 是否隐藏模块管理 26 | /// 27 | public bool? HideModuleManager { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/EntityBase/IEntityBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.Models 6 | { 7 | public interface IEntityBase : ISoftDelete 8 | { 9 | /// 10 | /// 添加时间 11 | /// 12 | DateTime AddTime { get; set; } 13 | /// 14 | /// 更新时间 15 | /// 16 | DateTime LastUpdateTime { get; set; } 17 | } 18 | 19 | public interface IEntityBase : IEntityBase 20 | { 21 | /// 22 | /// 主键 23 | /// 24 | TKey Id { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/EntityBase/ISoftDelete.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.Models 6 | { 7 | /// 8 | /// 数据库数据软删除接口 9 | /// 10 | public interface ISoftDelete 11 | { 12 | /// 13 | /// 是否软删除 14 | /// 15 | bool Flag { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/ExtensionEntity.Extension.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Utility; 2 | using System; 3 | 4 | namespace Senparc.Scf.Core.Models 5 | { 6 | //[Serializable] 7 | //public class FullSystemConfig : FullSystemConfigBase 8 | //{ 9 | // [AutoSetCache] 10 | // public string MchId { get; set; } 11 | // [AutoSetCache] 12 | // public string MchKey { get; set; } 13 | // [AutoSetCache] 14 | // public string TenPayAppId { get; set; } 15 | 16 | 17 | // public override void CreateEntity(SystemConfig entity) 18 | // { 19 | // base.CreateEntity(entity); 20 | // } 21 | //} 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/IValidatorEnvironment.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc.ModelBinding; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Core.Models 8 | { 9 | /// 10 | /// 作为需要进行视图验证的基础接口(如Controller、PageModel) 11 | /// 12 | public interface IValidatorEnvironment 13 | { 14 | /// 15 | /// Controller 及 PageModel 中的 ModelState 对象 16 | /// 17 | ModelStateDictionary ModelState { get; } 18 | 19 | /// 20 | /// HttpContext 21 | /// 22 | HttpContext HttpContext { get; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/SenparcCoreSetting.Core.cs: -------------------------------------------------------------------------------- 1 | using Senparc.CO2NET; 2 | using Senparc.Scf.Core.Enums; 3 | 4 | namespace Senparc.Scf.Core.Models 5 | { 6 | /// 7 | /// 全局可调整配置的设置 8 | /// 9 | public partial class SenparcCoreSetting 10 | { 11 | /// 12 | /// 网站是否开启 Debug 标记 13 | /// 14 | public bool IsDebug { get; set; } 15 | /// 16 | /// 是否是测试站 17 | /// 18 | public bool IsTestSite { get; set; } 19 | /// 20 | /// 对应:AppData/DataBase/SenparcConfig.config 中,所需要使用的数据库连接的 节点的 Name 21 | /// 22 | public string DatabaseName { get; set; } 23 | /// 24 | /// 缓存类型 25 | /// 26 | 27 | public CacheType CacheType { get; set; } 28 | 29 | public string MemcachedAddresses { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/SenparcEntities/ISenparcEntities.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Infrastructure; 3 | using Microsoft.EntityFrameworkCore.Internal; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace Senparc.Scf.Core.Models 9 | { 10 | public interface ISenparcEntities : IDisposable, IInfrastructure, IDbContextDependencies, IDbSetCache, /*IDbQueryCache, */IDbContextPoolable 11 | { 12 | void SetGlobalQuery(ModelBuilder builder) where T : EntityBase; 13 | 14 | /// 15 | /// 重置合并状态 16 | /// 17 | void ResetMigrate(); 18 | 19 | /// 20 | /// 执行 EF Core 的合并操作(等价于 update-database) 21 | /// 出于安全考虑,每次执行 Migrate() 方法之前,必须先执行 ResetMigrate() 开启允许 Migrate 执行的状态。 22 | /// 23 | void Migrate(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/SmsTemplateEntity/SmsTemplate_Base.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace Senparc.Scf.Core.Models 4 | { 5 | public interface ISmsTemplate_Base 6 | { 7 | string CompanyName { get; set; } 8 | 9 | string CompanyTel { get; set; } 10 | } 11 | 12 | 13 | public partial class SmsTemplate_Base : ISmsTemplate_Base 14 | { 15 | [Description("本公司名称")] 16 | public virtual string CompanyName { get; set; } 17 | 18 | [Description("本公司电话")] 19 | public virtual string CompanyTel { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/SmsTemplateEntity/SmsTemplate_Custom.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace Senparc.Scf.Core.Models 4 | { 5 | public partial class SmsTemplate_Custom : SmsTemplate_Base 6 | { 7 | [Description("联系人姓名")] 8 | public virtual string PersonName { get; set; } 9 | 10 | [Description("联系人头衔")] 11 | public virtual string PersonTitle { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/SqlFinanceData/SqlBaseFinanceData.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace Senparc.Scf.Core.Models 4 | { 5 | public interface ISqlBaseFinanceData 6 | { 7 | /// 8 | /// 强制手动更改DetectChange 9 | /// 10 | bool ManualDetectChangeObject { get; set; } 11 | DbContext BaseDataContext { get; } 12 | void CloseConnection(); 13 | } 14 | 15 | public abstract class SqlBaseFinanceData : ISqlBaseFinanceData 16 | { 17 | /// 18 | /// 强制手动更改DetectChange 19 | /// 20 | public bool ManualDetectChangeObject { get; set; } 21 | public abstract DbContext BaseDataContext { get; } 22 | 23 | public abstract void CloseConnection(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/VD/BaseVD.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Routing; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Senparc.Scf.Core.Models.VD 6 | { 7 | public interface IBaseUiVD 8 | { 9 | string UserName { get; set; } 10 | 11 | bool IsAdmin { get; set; } 12 | 13 | string CurrentMenu { get; set; } 14 | 15 | List MessagerList { get; set; } 16 | 17 | MetaCollection MetaCollection { get; set; } 18 | 19 | DateTime PageStartTime { get; set; } 20 | 21 | DateTime PageEndTime { get; set; } 22 | } 23 | 24 | 25 | public class Base_PagerVD 26 | { 27 | public int? PageIndex { get; set; } 28 | 29 | public int PageCount { get; set; } 30 | 31 | public int TotalCount { get; set; } 32 | 33 | public Base_PagerVD(int? pageIndex, int pageCount, int totalCount) 34 | { 35 | PageIndex = pageIndex; 36 | PageCount = pageCount; 37 | TotalCount = totalCount; 38 | } 39 | } 40 | 41 | public class Base_AreaXmlVD 42 | { 43 | public List Provinces { get; set; } 44 | 45 | public List Cities { get; set; } 46 | 47 | public List Districts { get; set; } 48 | 49 | public string CurrentProvince { get; set; } 50 | 51 | public string CurrentCity { get; set; } 52 | 53 | public string CurrentDistrict { get; set; } 54 | } 55 | 56 | 57 | public class LoginBarVD 58 | { 59 | public bool Logined { get; set; } 60 | 61 | public string Email { get; set; } 62 | 63 | public string DisplayName { get; set; } 64 | } 65 | 66 | 67 | 68 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/WeixinTemplate/WeixinTemplateBase.cs: -------------------------------------------------------------------------------- 1 | namespace Senparc.Scf.Core.Models.WeixinTemplate 2 | { 3 | public interface IWeixinTemplateBase 4 | { 5 | string TemplateId { get; set; } 6 | 7 | string TemplateName { get; set; } 8 | } 9 | 10 | 11 | public class WeixinTemplateBase : IWeixinTemplateBase 12 | { 13 | public string TemplateId { get; set; } 14 | 15 | public string TemplateName { get; set; } 16 | 17 | public WeixinTemplateBase(string templateId, string templateName) 18 | { 19 | TemplateId = templateId; 20 | TemplateName = templateName; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Models/readme.md: -------------------------------------------------------------------------------- 1 | ## 数据库实体 2 | 3 | 命名空间统一为:Senparc.Scf.Core.Models 4 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Utility/CacheEntity/AutoSetCacheAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Utility 4 | { 5 | [AttributeUsageAttribute(AttributeTargets.Property)] 6 | public class AutoSetCacheAttribute : Attribute 7 | { 8 | public AutoSetCacheAttribute() 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/Utility/ReflectorUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Core.Utility 4 | { 5 | public static class ReflectorUtility 6 | { 7 | public static void SetPropertyValue(object obj, Type objType, string propertyName, string value) 8 | { 9 | var prop = objType.GetProperty(propertyName); 10 | switch (prop.PropertyType.Name) 11 | { 12 | case "DateTime": 13 | prop.SetValue(obj, DateTime.Parse(value), null); 14 | break; 15 | case "DateTimeOffset": 16 | prop.SetValue(obj, DateTimeOffset.Parse(value), null); 17 | break; 18 | case "Int32": 19 | prop.SetValue(obj, int.Parse(value), null); 20 | break; 21 | case "Int64": 22 | prop.SetValue(obj, long.Parse(value), null); 23 | break; 24 | case "Single": 25 | case "float": 26 | prop.SetValue(obj, float.Parse(value), null); 27 | break; 28 | case "Double": 29 | prop.SetValue(obj, double.Parse(value), null); 30 | break; 31 | case "Boolean": 32 | prop.SetValue(obj, bool.Parse(value), null); 33 | break; 34 | default: 35 | prop.SetValue(obj, value, null); 36 | break; 37 | } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/WorkContext/AdminWorkContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.WorkContext 6 | { 7 | /// 8 | /// 管理员区域上下文 9 | /// 10 | public class AdminWorkContext 11 | { 12 | /// 13 | /// 姓名 14 | /// 15 | public string UserName { get; set; } 16 | 17 | /// 18 | /// 用户Id 19 | /// 20 | public int AdminUserId { get; set; } 21 | 22 | /// 23 | /// 拥有的角色 24 | /// 25 | public IEnumerable RoleCodes { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/WorkContext/Provider/AdminWorkContextProvider.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security.Claims; 6 | using System.Text; 7 | 8 | namespace Senparc.Scf.Core.WorkContext.Provider 9 | { 10 | public class AdminWorkContextProvider : IAdminWorkContextProvider 11 | { 12 | private readonly IHttpContextAccessor _httpContextAccessor; 13 | 14 | public AdminWorkContextProvider(IHttpContextAccessor httpContextAccessor) 15 | { 16 | this._httpContextAccessor = httpContextAccessor; 17 | } 18 | 19 | public AdminWorkContext GetAdminWorkContext() 20 | { 21 | AdminWorkContext adminWorkContext = new AdminWorkContext(); 22 | 23 | adminWorkContext.UserName = _httpContextAccessor.HttpContext.User.Claims.FirstOrDefault(_ => _.Type == ClaimTypes.Name)?.Value; 24 | bool isConvertSucess = int.TryParse(_httpContextAccessor.HttpContext.User.Claims.FirstOrDefault(_ => _.Type == ClaimTypes.NameIdentifier)?.Value, out int convertId); 25 | if (isConvertSucess) 26 | { 27 | adminWorkContext.AdminUserId = convertId; 28 | } 29 | adminWorkContext.RoleCodes = _httpContextAccessor.HttpContext.User.Claims.FirstOrDefault(_ => _.Type == ClaimTypes.Role)?.Value?.Split(",").ToList() ?? new List(); 30 | return adminWorkContext; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Core/WorkContext/Provider/IAdminWorkContextProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Senparc.Scf.Core.WorkContext.Provider 2 | { 3 | public interface IAdminWorkContextProvider 4 | { 5 | AdminWorkContext GetAdminWorkContext(); 6 | } 7 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Log/NLogExtension.Core.cs: -------------------------------------------------------------------------------- 1 | using NLog; 2 | using Senparc.Core.Extensions; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Log 8 | { 9 | public static class NLogExtension 10 | { 11 | /// 12 | /// 记录错误信息的扩展方法 13 | /// 14 | /// 15 | /// 16 | /// 17 | public static void ErrorFormat(this Logger logger, string stringFormat, params object[] args) 18 | { 19 | logger.Error(stringFormat.With(args)); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Mvc.UI/UIHelpers/CurrentBsMenuExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Rendering; 2 | using Senparc.CO2NET.Extensions; 3 | using Senparc.Scf.Core.Models.VD; 4 | 5 | namespace System.Web.Mvc 6 | { 7 | public static class CurrentBsMenuExtensions 8 | { 9 | /// 10 | /// Bootstrap当前菜单 11 | /// 12 | /// 13 | /// 14 | /// 15 | public static string CurrentBsMenu(this IHtmlHelper htmlHelper, string menuName) 16 | { 17 | if (htmlHelper.ViewData.Model is IBaseUiVD) 18 | { 19 | IBaseUiVD model = htmlHelper.ViewData.Model as IBaseUiVD; 20 | if (!model.CurrentMenu.IsNullOrEmpty()) 21 | { 22 | var parentMenuMane = model.CurrentMenu.Split('.')[0]; 23 | if (model.CurrentMenu.Equals(menuName, StringComparison.OrdinalIgnoreCase) 24 | || parentMenuMane.Equals(menuName, StringComparison.OrdinalIgnoreCase)) 25 | { 26 | return "active"; 27 | } 28 | else 29 | { 30 | return ""; 31 | } 32 | } 33 | else 34 | { 35 | return ""; 36 | } 37 | } 38 | else 39 | { 40 | return ""; 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Mvc.UI/UIHelpers/CurrentMenuExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Rendering; 2 | using Senparc.CO2NET.Extensions; 3 | using Senparc.Scf.Core.Models.VD; 4 | 5 | namespace System.Web.Mvc 6 | { 7 | public static class CurrentMenuExtensions 8 | { 9 | public static string CurrentMenu(this IHtmlHelper htmlHelper, string menuName, string currentClassName = "current active") 10 | { 11 | if (htmlHelper.ViewData.Model is IBaseUiVD) 12 | { 13 | IBaseUiVD model = htmlHelper.ViewData.Model as IBaseUiVD; 14 | if (!model.CurrentMenu.IsNullOrEmpty()) 15 | { 16 | //int indexOf = model.CurrentMenu.LastIndexOf('.'); 17 | //string parentMenuMane = model.CurrentMenu.Substring(0, indexOf); 18 | var parentMenuNane = model.CurrentMenu.Split('.')[0]; 19 | if (model.CurrentMenu.StartsWith(menuName, StringComparison.OrdinalIgnoreCase) 20 | || parentMenuNane.Equals(menuName, StringComparison.OrdinalIgnoreCase)) 21 | { 22 | return currentClassName; 23 | //return "active"; 24 | } 25 | else 26 | { 27 | return ""; 28 | } 29 | } 30 | else 31 | { 32 | return ""; 33 | } 34 | } 35 | else 36 | { 37 | return ""; 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Mvc.UI/backend/ContentBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Microsoft.AspNetCore.Mvc.Rendering; 4 | 5 | namespace Senparc.Scf.Mvc.UI 6 | { 7 | public class ContentBox : IDisposable 8 | { 9 | // Fields 10 | private bool _disposed; 11 | private readonly ViewContext _viewContext; 12 | private readonly TextWriter _writer; 13 | private bool _showDefaultTabContainer; 14 | 15 | public ContentBox(ViewContext viewContext, bool showDefaultTabContainer) 16 | { 17 | if (viewContext == null) 18 | { 19 | throw new ArgumentNullException("viewContext"); 20 | } 21 | this._viewContext = viewContext; 22 | this._writer = viewContext.Writer; 23 | this._showDefaultTabContainer = showDefaultTabContainer; 24 | } 25 | 26 | public void EndCotnentBox() 27 | { 28 | this.Dispose(true); 29 | } 30 | 31 | public void Dispose() 32 | { 33 | this.Dispose(true); 34 | GC.SuppressFinalize(this); 35 | } 36 | 37 | protected virtual void Dispose(bool disposing) 38 | { 39 | if (!this._disposed) 40 | { 41 | string contentBoxFooter = (_showDefaultTabContainer ? @" 42 | 43 | " :"") + 44 | @" 45 | 46 | 47 | 48 | "; 49 | this._disposed = true; 50 | this._writer.Write(contentBoxFooter); 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Repository/BaseRepoisitory/ClientRepositoryBase.cs: -------------------------------------------------------------------------------- 1 | using Senparc.CO2NET; 2 | using Senparc.Scf.Core.Models; 3 | using Senparc.Scf.Utility; 4 | 5 | namespace Senparc.Scf.Repository 6 | { 7 | public interface IClientRepositoryBase : IRepositoryBase where T : EntityBase // global::System.Data.Objects.DataClasses.EntityObject, new() 8 | { 9 | ISqlBaseFinanceData DB { get; } 10 | } 11 | 12 | public class ClientRepositoryBase : RepositoryBase, IClientRepositoryBase where T : EntityBase // global::System.Data.Objects.DataClasses.EntityObject, new() 13 | { 14 | public ISqlBaseFinanceData DB 15 | { 16 | get 17 | { 18 | return base.BaseDB; //as ISqlClientFinanceData; 19 | } 20 | } 21 | 22 | //public ClientRepositoryBase() : this(null) { } 23 | 24 | public ClientRepositoryBase(ISqlBaseFinanceData db) : base(db) 25 | { 26 | //System.Web.HttpContext.Current.Response.Write("-"+this.GetType().Name + "
"); 27 | var keys = EntitySetKeys.GetAllEntitySetInfo(); 28 | _entitySetName = keys[typeof(T)].SetName; 29 | } 30 | 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Repository/BaseRepoisitory/DataBase.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Models; 2 | 3 | namespace Senparc.Scf.Repository 4 | { 5 | public interface IDataBase 6 | { 7 | ISqlBaseFinanceData BaseDB { get; set; } 8 | 9 | void CloseConnection(); 10 | } 11 | 12 | 13 | public class DataBase : IDataBase 14 | { 15 | public ISqlBaseFinanceData BaseDB { get; set; } 16 | 17 | public DataBase(ISqlBaseFinanceData baseDB) 18 | { 19 | BaseDB = baseDB; 20 | } 21 | 22 | public virtual void CloseConnection() 23 | { 24 | BaseDB.CloseConnection(); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Repository/System/SysButtonRespository.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Senparc.Scf.Core.Models; 3 | using Senparc.Scf.Core.Models.DataBaseModel; 4 | using Senparc.Scf.Repository; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Linq.Expressions; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | 12 | namespace Senparc.Respository 13 | { 14 | public interface ISysButtonRespository : IClientRepositoryBase 15 | { 16 | /// 17 | /// 删除某个页面下的所有按钮 18 | /// 19 | /// 20 | /// 21 | Task DeleteButtonsByMenuId(string menuId); 22 | } 23 | 24 | public class SysButtonRespository : ClientRepositoryBase, ISysButtonRespository 25 | { 26 | private readonly SenparcEntitiesBase _senparcEntities; 27 | 28 | public SysButtonRespository(ISqlBaseFinanceData db) : base(db) 29 | { 30 | _senparcEntities = db.BaseDataContext as SenparcEntitiesBase; 31 | } 32 | 33 | /// 34 | /// 删除某个页面下的所有按钮 35 | /// 36 | /// 37 | /// 38 | public async Task DeleteButtonsByMenuId(string menuId) 39 | { 40 | return await _senparcEntities.Database.ExecuteSqlCommandAsync($"DELETE {nameof(_senparcEntities.SysButtons)} WHERE {nameof(SysButton.MenuId)} = {{0}}", menuId); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Repository/XscfModuleRepository.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Models; 2 | using Senparc.Scf.Core.Models.DataBaseModel; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.Repository 8 | { 9 | public class XscfModuleRepository : ClientRepositoryBase 10 | { 11 | public XscfModuleRepository(ISqlBaseFinanceData db) : base(db) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.SMS/Enums.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.SMS 6 | { 7 | 8 | /// 9 | /// 短信平台类型 10 | /// 11 | public enum SmsPlatformType 12 | { 13 | Unknow = -1, 14 | JunMei = 0, 15 | Fissoft = 1, 16 | SMS1 = 10, 17 | SMS2 = 20, 18 | SMS3 = 30, 19 | SMS4 = 40 20 | } 21 | 22 | 23 | /// 24 | /// 短信发送状态 25 | /// 26 | public enum SmsResult 27 | { 28 | 未知错误 = 0, 29 | 成功 = 1, 30 | 访问数据库写入数据错误 = -1, 31 | 一次发送的手机号码过多 = -3, 32 | 内容包含不合法文字 = -4, 33 | 登录账户错误 = -5, 34 | 手机号码不合法黑名单 = -9, 35 | 号码太长不能超过100条一次提交 = -10, 36 | 内容太长 = -11, 37 | 余额不足 = -13, 38 | 子号号不正确 = -14, 39 | 参数不全 = -999, 40 | 超过当天请求限制 = -998, 41 | 请在60秒后重试 = -997 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.SMS/ReplyMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.SMS 4 | { 5 | public interface IReplyMessage 6 | { 7 | int State { get; set; } 8 | int Id { get; set; } 9 | string PhoneNumber { get; set; } 10 | DateTime DateTime { get; set; } 11 | } 12 | 13 | public class ReplyMessage : IReplyMessage 14 | { 15 | public int State { get; set; } 16 | public int Id { get; set; } 17 | public string PhoneNumber { get; set; } 18 | public DateTime DateTime { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.SMS/ReplyMessageCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Senparc.Scf.SMS 4 | { 5 | public class ReplyMessageCollection 6 | { 7 | public List MsgCollection { get; set; } 8 | 9 | public ReplyMessageCollection() 10 | { 11 | MsgCollection=new List(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.SMS/SmsPlatform/SmsPlatformFactory.cs: -------------------------------------------------------------------------------- 1 |  2 | using Senparc.Scf.SMS; 3 | 4 | namespace Senparc.Scf.SMS 5 | { 6 | public static class SmsPlatformFactory 7 | { 8 | public static ISmsPlatform GetSmsPlateform(string smsAccountCorpid, string smsAccountName, 9 | string smsAccountPassword, string smsAccountSubNumber, SmsPlatformType smsPlatformType = SmsPlatformType.JunMei) 10 | { 11 | switch (smsPlatformType) 12 | { 13 | case SmsPlatformType.Fissoft: 14 | return new SmsPlatform_Fissoft(null, smsAccountCorpid, smsAccountName, smsAccountPassword, smsAccountSubNumber); 15 | default: 16 | return new SmsPlatform_JunMei(null, smsAccountCorpid, smsAccountName, smsAccountPassword, smsAccountSubNumber); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.SMS/SmsPlatform/SmsSetting.cs: -------------------------------------------------------------------------------- 1 | namespace Senparc.Scf.SMS 2 | { 3 | public class SenparcSmsSetting 4 | { 5 | public string SmsAccountCORPID { get; set; } 6 | public string SmsAccountName { get; set; } 7 | public string SmsAccountSubNumber { get; set; } 8 | public string SmsAccountPassword { get; set; } 9 | public SmsPlatformType SmsPlatformType { get; set; } 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Service/ServiceBase/AutoDetectChangeContext/AutoDetectChangeContextExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace Senparc.Scf.Service 4 | { 5 | public static class AutoDetectChangeContextExtension 6 | { 7 | /// 8 | /// 创建AutoDetectChangeContext的实例 9 | /// 10 | /// 11 | /// 12 | public static AutoDetectChangeContextWrap InstanceAutoDetectChangeContextWrap(this IServiceDataBase serviceData) 13 | { 14 | return new AutoDetectChangeContextWrap(serviceData); 15 | } 16 | 17 | /// 18 | /// 创建CloseAutoDetectChangeContext的实例 19 | /// 20 | /// AutoDetectChangeContextWrap实例 21 | /// 22 | public static CloseAutoDetectChangeContext InstanceCloseAutoDetectChangeContext(this AutoDetectChangeContextWrap wrap) 23 | { 24 | return new CloseAutoDetectChangeContext(wrap); 25 | } 26 | 27 | /// 28 | /// 创建CloseAutoDetectChangeContext的实例 29 | /// 30 | /// AutoDetectChangeContextWrap实例 31 | /// 32 | public static void ForceDetectChange(this AutoDetectChangeContextWrap wrap, object entity) 33 | { 34 | wrap.ServiceData.BaseData.BaseDB.BaseDataContext.Entry(entity).State = EntityState.Modified; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Service/ServiceBase/ClientServiceBase.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Microsoft.EntityFrameworkCore.Storage; 3 | using Senparc.Scf.Core.Models; 4 | using Senparc.Scf.Repository; 5 | using Senparc.Scf.Service; 6 | using System; 7 | 8 | namespace Senparc.Scf.Service 9 | { 10 | public interface IClientServiceBase : IServiceBase where T : EntityBase//global::System.Data.Objects.DataClasses.EntityObject, new() 11 | { 12 | IClientRepositoryBase BaseClientRepository { get; } 13 | 14 | ///// 15 | ///// 开启事务 16 | ///// 17 | ///// 18 | //IDbContextTransaction BeginTransaction(); 19 | } 20 | 21 | 22 | public class ClientServiceBase : ServiceBase, IClientServiceBase where T : EntityBase//global::System.Data.Objects.DataClasses.EntityObject, new() 23 | { 24 | public IClientRepositoryBase BaseClientRepository 25 | { 26 | get 27 | { 28 | return RepositoryBase as IClientRepositoryBase; 29 | } 30 | } 31 | 32 | public ClientServiceBase(IClientRepositoryBase repo, IServiceProvider serviceProvider) 33 | : base(repo, serviceProvider) 34 | { 35 | 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Service/ServiceBase/ServiceDataBase.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Repository; 2 | 3 | namespace Senparc.Scf.Service 4 | { 5 | public interface IServiceDataBase 6 | { 7 | IDataBase BaseData { get; set; } 8 | void CloseConnection(); 9 | } 10 | 11 | 12 | public class ServiceDataBase : IServiceDataBase 13 | { 14 | public IDataBase BaseData { get; set; } 15 | 16 | public ServiceDataBase(IDataBase baseData) 17 | { 18 | BaseData = baseData; 19 | } 20 | 21 | public virtual void CloseConnection() 22 | { 23 | BaseData.CloseConnection(); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Service/System/SysButtonService.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Senparc.Respository; 3 | using Senparc.Scf.Core.Models.DataBaseModel; 4 | using Senparc.Scf.Repository; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Senparc.Scf.Service 11 | { 12 | public class SysButtonService : ClientServiceBase 13 | { 14 | private readonly ISysButtonRespository _iSysButtonRespository; 15 | 16 | public SysButtonService(ISysButtonRespository repo, IServiceProvider serviceProvider) : base(repo, serviceProvider) 17 | { 18 | _iSysButtonRespository = repo; 19 | } 20 | 21 | public async Task DeleteButtonsByMenuId(string menuId) 22 | { 23 | if (string.IsNullOrEmpty(menuId)) 24 | { 25 | return 0; 26 | } 27 | return await _iSysButtonRespository.DeleteButtonsByMenuId(menuId); 28 | } 29 | 30 | public async Task> GetSysButtonDtosAsync(string MenuId) 31 | { 32 | IEnumerable sysButtons = await GetFullListAsync(_ => _.MenuId == MenuId); 33 | return Mapper.Map>(sysButtons); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Service/System/SysRoleService.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Senparc.Scf.Core.Models.DataBaseModel; 3 | using Senparc.Scf.Repository; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Senparc.Scf.Service 10 | { 11 | public class SysRoleService : ClientServiceBase 12 | { 13 | public SysRoleService(ClientRepositoryBase repo, IServiceProvider serviceProvider) : base(repo, serviceProvider) 14 | { 15 | 16 | } 17 | 18 | public async Task CreateOrUpdateAsync(SysRoleDto dto) 19 | { 20 | SysRole sysRole; 21 | if (String.IsNullOrEmpty(dto.Id)) 22 | { 23 | sysRole = new SysRole(dto); 24 | } 25 | else 26 | { 27 | sysRole = await GetObjectAsync(_ => _.Id == dto.Id); 28 | sysRole.Update(dto); 29 | } 30 | await SaveObjectAsync(sysRole); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Service/System/SystemConfigServiceBase.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Cache; 2 | using Senparc.Scf.Core.Models; 3 | using Senparc.Scf.Log; 4 | using Senparc.Scf.Repository; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | using Microsoft.Extensions.DependencyInjection; 9 | 10 | namespace Senparc.Scf.Service 11 | { 12 | public class SystemConfigServiceBase : ClientServiceBase 13 | { 14 | public SystemConfigServiceBase(IClientRepositoryBase repo, IServiceProvider serviceProvider) : base(repo, serviceProvider) 15 | { 16 | } 17 | 18 | public override void SaveObject(SystemConfig obj) 19 | { 20 | LogUtility.SystemLogger.Info("系统信息被编辑"); 21 | 22 | base.SaveObject(obj); 23 | 24 | //删除缓存 25 | var systemConfigCache = _serviceProvider.GetService(); 26 | systemConfigCache.RemoveCache(); 27 | } 28 | 29 | public virtual string BackupDatabase() 30 | { 31 | string timeStamp = DateTime.Now.ToString("yyyyMMdd-HH-mm");//分钟 32 | return timeStamp; 33 | } 34 | 35 | public virtual void RecycleAppPool() 36 | { 37 | //string webConfigPath = HttpContext.Current.Server.MapPath("~/Web.config"); 38 | //System.IO.File.SetLastWriteTimeUtc(webConfigPath, DateTime.UtcNow); 39 | } 40 | 41 | public override void DeleteObject(SystemConfig obj) 42 | { 43 | throw new Exception("系统信息不能被删除!"); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Utility/DIExtension/Extensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using System; 3 | 4 | namespace Microsoft.Extensions.DependencyInjection 5 | { 6 | //参考:https://www.cnblogs.com/yuangang/archive/2016/08/08/5743660.html 7 | 8 | public static class Extensions 9 | { 10 | 11 | public static IApplicationBuilder UseSenparcMvcDI(this IApplicationBuilder builder) 12 | { 13 | DI.ServiceProvider = builder.ApplicationServices; 14 | return builder; 15 | } 16 | } 17 | 18 | /// 19 | /// TODO:和SenparcDI合并 20 | /// 21 | public static class DI 22 | { 23 | public static IServiceProvider ServiceProvider { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Utility/DIExtension/readme.md: -------------------------------------------------------------------------------- 1 | ## 说明 2 | 本目录用于存放.NET Core扩展依赖注入的类 -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Utility/Extensions/DateTimeExtensions.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | 3 | //namespace Senparc.Scf.Core.Extensions 4 | //{ 5 | // public static class DateTimeExtensions 6 | // { 7 | // public static string ToShortTime(this DateTime dt) 8 | // { 9 | // string result = null; 10 | // TimeSpan timeSpan = DateTime.Now - dt; 11 | // if (timeSpan.TotalSeconds < 59) 12 | // { 13 | // result = "刚刚"; 14 | // } 15 | // else if (timeSpan.TotalMinutes < 59) 16 | // { 17 | // result = "{0}分钟前".With((int)timeSpan.TotalMinutes); 18 | // } 19 | // else if (timeSpan.TotalHours < 24) 20 | // { 21 | // result = "{0}小时前".With((int)timeSpan.TotalHours); 22 | // } 23 | // else 24 | // { 25 | // result = "{0}天前".With((int)timeSpan.TotalDays); 26 | // } 27 | // return result; 28 | // } 29 | 30 | // } 31 | //} 32 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Utility/Extensions/IntegerExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Senparc.Scf.Core.Extensions 2 | { 3 | public static class IntegerExtensions 4 | { 5 | public static string ThousandChange(this int num) 6 | { 7 | if (num > 999) 8 | { 9 | num = num / 1000; 10 | return num.ToString() + "K"; 11 | } 12 | else 13 | { 14 | return num.ToString(); 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Utility/FileUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.Utility 4 | { 5 | public class FileUtility 6 | { 7 | /// 8 | /// 获取随机文件名 9 | /// 10 | /// 11 | public static string GetRandomFileName() 12 | { 13 | return $"{DateTime.Now.Ticks}{Guid.NewGuid().ToString("n").Substring(0, 8)}"; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Utility/ModelStateDictionaryExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | using Microsoft.AspNetCore.Http.Features; 4 | using Microsoft.AspNetCore.Mvc.ModelBinding; 5 | 6 | namespace Senparc.Scf.Utility 7 | { 8 | public static class ModelStateDictionaryExtension 9 | { 10 | /// 11 | /// 获取第一个错误提示 12 | /// 13 | /// 14 | /// 15 | public static string FirstErrorMessage (this ModelStateDictionary modelStateDictionary) 16 | { 17 | if (modelStateDictionary.IsValid) 18 | { 19 | return ""; 20 | } 21 | return modelStateDictionary.Values.FirstOrDefault (z => z.Errors.Count > 0).Errors [0].ErrorMessage; 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Utility/Senparc.Core.Utility/MD5.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.Core.Utility 6 | { 7 | /// 8 | /// MD5 加密 9 | /// 10 | public static class MD5 11 | { 12 | /// 13 | /// 获得 SCF 系统内全局一致的加盐的 MD5 加密结果 14 | /// 15 | /// 原始密码 16 | /// 盐 17 | /// 默认为 UTF8 18 | /// 19 | public static string GetMD5Code(string str, string salt, Encoding encoding = null) 20 | { 21 | return Senparc.CO2NET.Helpers.EncryptHelper.GetMD5(str + salt, encoding ?? Encoding.UTF8); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.Utility/Senparc.Core.Utility/Server.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace Senparc.Scf.Core.Utility 4 | { 5 | public static class Server 6 | { 7 | private static string _appDomainAppPath; 8 | 9 | public static string AppDomainAppPath 10 | { 11 | get 12 | { 13 | if (_appDomainAppPath == null) 14 | { 15 | _appDomainAppPath = SenparcHttpContext.ContentRootPath; 16 | } 17 | return _appDomainAppPath; 18 | } 19 | set 20 | { 21 | _appDomainAppPath = value; 22 | } 23 | } 24 | 25 | public static string GetMapPath(string virtualPath) 26 | { 27 | if (virtualPath == null) 28 | { 29 | return ""; 30 | } 31 | 32 | return SenparcHttpContext.MapPath(virtualPath); 33 | } 34 | 35 | public static string GetWebMapPath(string virtualPath) 36 | { 37 | if (virtualPath == null) 38 | { 39 | return ""; 40 | } 41 | 42 | return SenparcHttpContext.MapWebPath(virtualPath); 43 | } 44 | 45 | public static HttpContext HttpContext 46 | { 47 | get 48 | { 49 | return SenparcHttpContext.Current; 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase.Tests/FunctionBaseTest.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Basic/Senparc.Scf.XscfBase.Tests/FunctionBaseTest.cs -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase.Tests/Senparc.Scf.XscfBase.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Attributes/XscfAutoConfigurationMappingAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.XscfBase.Attributes 6 | { 7 | /// 8 | /// 自动配置 ConfigurationMapping 特性 9 | /// 注意:添加此属性后,ConfigurationMapping 中的配置会被优先注入到 SenparcEntities 系统对象,

10 | /// 否则,当某实体没有创建 ConfigurationMapping 时,会将其默认属性注入到 SenparcEntities 系统对象。
11 | ///
12 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] 13 | public class XscfAutoConfigurationMappingAttribute : Attribute 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Attributes/XscfMethodAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.XscfBase 4 | { 5 | /// 6 | /// Xscf 模块特性 - 扩展方法 7 | /// 8 | public class XscfMethodAttribute : Attribute 9 | { 10 | public string Name { get; set; } 11 | 12 | public XscfMethodAttribute(string name) 13 | { 14 | Name = name; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Attributes/XscfOrderAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.XscfBase 6 | { 7 | /// 8 | /// Xscf 模块执行顺序,Order 数字越大,执行越靠前,如果非系统关键模块,尽量靠后 9 | /// 10 | public class XscfOrderAttribute : Attribute 11 | { 12 | /// 13 | /// 14 | /// 15 | /// 加载顺序,数字越大加载顺序越靠前。请严格按照参考数值:0:普通(默认),1-5000:需要预加载的重要模块,>5000:系统及基础模块 16 | public XscfOrderAttribute(int order) 17 | { 18 | Order = order; 19 | } 20 | 21 | /// 22 | /// 加载顺序,数字越大加载顺序越靠前。请严格按照参考数值:0:普通(默认),1-5000:需要预加载的重要模块,>5000:系统及基础模块 23 | /// 24 | public int Order { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Attributes/XscfRegisterAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Scf.XscfBase 4 | { 5 | /// 6 | /// Xscf 模块特性 - 注册 7 | /// 8 | public class XscfRegisterAttribute : Attribute 9 | { 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/AutoMapper/XscfModuleProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.XscfBase.AutoMapper 7 | { 8 | /// 9 | /// Xscf 模块使用的 AutoMap 配置 10 | /// 11 | public class XscfModuleProfile : Profile 12 | { 13 | public XscfModuleProfile() 14 | { 15 | foreach (var register in Register.RegisterList) 16 | { 17 | if (register.AutoMapMappingConfigs != null) 18 | { 19 | foreach (var config in register.AutoMapMappingConfigs) 20 | { 21 | config(this); 22 | } 23 | } 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Database/XscfDatabaseDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.XscfBase.Database 7 | { 8 | /// 9 | /// IXscfDatabase 使用的 DbContext 基类 10 | /// 11 | public abstract class XscfDatabaseDbContext : DbContext 12 | { 13 | /// 14 | /// 当前 IXscfDatabase 注册类实例 15 | /// 16 | public abstract IXscfDatabase XscfDatabaseRegister { get; } 17 | 18 | public XscfDatabaseDbContext(DbContextOptions dbContextOptions) : base(dbContextOptions) 19 | { } 20 | 21 | protected override void OnModelCreating(ModelBuilder modelBuilder) 22 | { 23 | if (XscfDatabaseRegister == null) 24 | { 25 | throw new ArgumentNullException(nameof(XscfDatabaseRegister)); 26 | } 27 | 28 | XscfDatabaseRegister.OnModelCreating(modelBuilder); 29 | 30 | 31 | base.OnModelCreating(modelBuilder); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Exceptions/ScfModuleException.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Exceptions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.XscfBase 7 | { 8 | public class XscfPageException : SCFExceptionBase 9 | { 10 | public IXscfRegister XscfRegister { get; set; } 11 | 12 | public XscfPageException(IXscfRegister xscfRegister, string message, bool logged = false) : base(message, logged) 13 | { 14 | XscfRegister = xscfRegister; 15 | } 16 | 17 | public XscfPageException(IXscfRegister xscfRegister, string message, Exception inner, bool logged = false) : base(message, inner, logged) 18 | { 19 | XscfRegister = xscfRegister; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Exceptions/XscfFunctionException.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Exceptions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.XscfBase 7 | { 8 | /// 9 | /// Xscf 模块方法执行异常 10 | /// 11 | public class XscfFunctionException : SCFExceptionBase 12 | { 13 | public XscfFunctionException(string message, bool logged = false) : this(message, null, logged) 14 | { 15 | } 16 | 17 | public XscfFunctionException(string message, Exception inner, bool logged = false) : base(message, inner, logged) 18 | { 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Functions/EnumType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.XscfBase.Functions 6 | { 7 | /// 8 | /// 枚举类型 9 | /// 10 | /// 11 | public class EnumType where T : struct 12 | { 13 | public T Value { get; set; } 14 | public EnumType() { } 15 | 16 | public EnumType(T value) 17 | { 18 | Value = value; 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Functions/FunctionResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.XscfBase.Functions 6 | { 7 | /// 8 | /// 方法返回结果 9 | /// 10 | public class FunctionResult 11 | { 12 | /// 13 | /// 是否成功 14 | /// 15 | public bool Success { get; set; } 16 | /// 17 | /// 日志 18 | /// 19 | public string Log { get; set; } 20 | /// 21 | /// 消息结果 22 | /// 23 | public string Message { get; set; } 24 | /// 25 | /// 异常信息(此时 Success 一般为 false) 26 | /// 27 | public XscfFunctionException Exception { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Functions/Parameters/FunctionParameterLoadDataBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Threading.Tasks; 5 | 6 | namespace Senparc.Scf.XscfBase.Functions 7 | { 8 | /// 9 | /// 接口:需要默认载入数据的 FunctionParameter 10 | /// 11 | public interface IFunctionParameterLoadDataBase: IFunctionParameter 12 | { 13 | Task LoadData(IServiceProvider serviceProvider); 14 | } 15 | 16 | /// 17 | /// 需要默认载入数据的 FunctionParameter 18 | /// 19 | public abstract class FunctionParameterLoadDataBase : IFunctionParameterLoadDataBase 20 | { 21 | /// 22 | /// 载入数据 23 | /// 24 | /// 25 | public abstract Task LoadData(IServiceProvider serviceProvider); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Interfaces/Functions/IFunctionParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.XscfBase 6 | { 7 | /// 8 | /// Function 的参数配置 9 | /// 10 | public interface IFunctionParameter 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Interfaces/Functions/IXscfFunction.cs: -------------------------------------------------------------------------------- 1 |  2 | using Senparc.Scf.XscfBase.Functions; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Scf.XscfBase 8 | { 9 | /// 10 | /// 扩展方法接口 11 | /// 12 | public interface IXscfFunction 13 | { 14 | string Name { get; } 15 | string Description { get; } 16 | 17 | Type FunctionParameterType { get; } 18 | 19 | /// 20 | /// 生成参数定义对象的实例 21 | /// 22 | /// 23 | IFunctionParameter GenerateParameterInstance(); 24 | 25 | /// 26 | /// ServiceProvider 实例 27 | /// 28 | IServiceProvider ServiceProvider { get; set; } 29 | 30 | /// 31 | /// 执行程序 32 | /// 33 | /// 参数 34 | /// 35 | FunctionResult Run(IFunctionParameter param); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Interfaces/IXscfDatabase.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Infrastructure; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Senparc.Scf.XscfBase.Database; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace Senparc.Scf.XscfBase 10 | { 11 | /// 12 | /// XSCF 模块数据库配置 13 | /// 14 | public interface IXscfDatabase 15 | { 16 | /// 17 | /// 全局唯一的前缀,务必避免和其他模块重复 18 | /// 19 | string DatabaseUniquePrefix { get; } 20 | /// 21 | /// 创建数据库模型 22 | /// 23 | void OnModelCreating(ModelBuilder modelBuilder); 24 | /// 25 | /// 设置数据库,主要提供给使用 26 | /// 27 | /// 28 | /// MigrationsAssembly 的程序集名称,如果为 null,为默认使用当前 XscfDatabaseDbContextType 所在的程序集 29 | void DbContextOptionsAction(IRelationalDbContextOptionsBuilderInfrastructure dbContextOptionsAction, 30 | string assemblyName = null); 31 | 32 | /// 33 | /// XscfDatabaseDbContext 类型 34 | /// 35 | Type XscfDatabaseDbContextType { get; } 36 | 37 | /// 38 | /// 添加数据库模块 39 | /// 40 | /// 41 | void AddXscfDatabaseModule(IServiceCollection services); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Interfaces/IXscfMiddleware.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.XscfBase 7 | { 8 | /// 9 | /// 中间件接口 10 | /// 11 | public interface IXscfMiddleware 12 | { 13 | /// 14 | /// 使用中间件 15 | /// 16 | /// 17 | /// 18 | IApplicationBuilder UseMiddleware(IApplicationBuilder app); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Interfaces/IXscfRazorRuntimeCompilation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Scf.XscfBase 6 | { 7 | /// 8 | /// 需要使用 AddRazorRuntimeCompilation() 方法时,需要设置对应当前项目相对于 Senparc.Web 的路径 9 | /// 10 | public interface IXscfRazorRuntimeCompilation 11 | { 12 | /// 13 | /// 相对路径,如:Path.GetFullPath(Path.Combine(SiteConfig.WebRootPath, "..", "..", "Senparc.Areas.Admin")); 14 | /// 15 | string LibraryPath { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Basic/Senparc.Scf.XscfBase/Interfaces/IXscfThread.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.XscfBase.Threads; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Senparc.Scf.XscfBase 7 | { 8 | /// 9 | /// XSCF 线程模块接口 10 | /// 11 | public interface IXscfThread 12 | { 13 | /// 14 | /// 线程配置 15 | /// 16 | /// 17 | void ThreadConfig(XscfThreadBuilder xscfThreadBuilder); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | full 5 | portable 6 | True 7 | 8 | 9 | 10 | 11 | 12 | true 13 | 14 | false 15 | 16 | true 17 | snupkg 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.Application/Register.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Enums; 2 | using Senparc.Scf.XscfBase; 3 | using Senparc.Xscf.Application.Functions; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace Senparc.Xscf.Application 10 | { 11 | [XscfRegister] 12 | public class Register : XscfRegisterBase, IXscfRegister 13 | { 14 | public Register() 15 | { } 16 | 17 | #region IRegister 接口 18 | 19 | public override string Name => "Senparc.Xscf.Application"; 20 | public override string Uid => "699DFE0D-C1C0-4315-87DF-0DE1502B87A9";//必须确保全局唯一,生成后必须固定 21 | public override string Version => "0.0.5";//必须填写版本号 22 | 23 | public override string MenuName => "应用程序模块"; 24 | public override string Icon => "fa fa-pencil"; 25 | public override string Description => "此模块提供给开发者一个可以启动任何程序!"; 26 | 27 | /// 28 | /// 注册当前模块需要支持的功能模块 29 | /// 30 | public override IList Functions => new[] { 31 | typeof(Functions.LaunchApp), 32 | }; 33 | 34 | public override Task InstallOrUpdateAsync(IServiceProvider serviceProvider, InstallOrUpdate installOrUpdate) 35 | { 36 | return Task.CompletedTask; 37 | } 38 | 39 | public override async Task UninstallAsync(IServiceProvider serviceProvider, Func unsinstallFunc) 40 | { 41 | await unsinstallFunc().ConfigureAwait(false); 42 | } 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.Application/Senparc.Xscf.Application.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/AdminUserInfo/AuthorizationPage.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model Senparc.Areas.Admin.Areas.Admin.Pages.AdminUserInfoAuthorizationPageModel 3 | @{ 4 | ViewData["Title"] = "角色授予"; 5 | } 6 | 7 | 8 | @section breadcrumbs{ 9 |
  • 系统管理
  • 10 |
  • 11 | 管理员管理 12 |
  • 13 |
  • 14 | @ViewData["Title"] 15 |
  • 16 | } 17 | 18 |
    19 |
    20 |
    21 | @foreach (var item in Model.RoleAdminUserInfoDtos) 22 | { 23 |
    24 |
    25 | 28 |
    29 |
    30 | } 31 |
    32 |
    33 | 返回 34 | 保存 35 |
    36 |
    37 |
    38 |
    39 | 40 | @section scripts{ 41 | 42 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/AdminUserInfo/Edit.cshtml.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/AdminUserInfo/Edit.cshtml.cs -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/AdminUserInfo/Index.cshtml.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/AdminUserInfo/Index.cshtml.cs -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | namespace Senparc.Areas.Admin.Pages 9 | { 10 | public class IndexModel : BaseAdminPageModel 11 | { 12 | public IActionResult OnGet() 13 | { 14 | return null; 15 | //return RedirectToPage("/Home/Index"); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Login.cshtml.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Login.cshtml.cs -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Menu/Edit.cshtml.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Menu/Edit.cshtml.cs -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Menu/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Senparc.Core.Models.DataBaseModel; 8 | using Senparc.Scf.Core.Models; 9 | using Senparc.Service; 10 | 11 | namespace Senparc.Areas.Admin.Areas.Admin.Pages 12 | { 13 | public class MenuIndexModel : BaseAdminPageModel 14 | { 15 | private readonly SysMenuService _sysMenuService; 16 | 17 | public MenuIndexModel(SysMenuService _sysMenuService) 18 | { 19 | CurrentMenu = "Menu"; 20 | this._sysMenuService = _sysMenuService; 21 | } 22 | 23 | [BindProperty(SupportsGet = true)] 24 | public int PageIndex { get; set; } = 1; 25 | 26 | /// 27 | /// 28 | /// 29 | public PagedList SysMenus { get; set; } 30 | 31 | /// 32 | /// 33 | /// 34 | /// 35 | public async Task OnGetAsync() 36 | { 37 | SysMenus = await _sysMenuService.GetObjectListAsync(PageIndex, 10, _ => true, _ => _.AddTime, Scf.Core.Enums.OrderingType.Descending); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Role/Edit.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Senparc.Core.Models.DataBaseModel; 8 | using Senparc.Service; 9 | 10 | namespace Senparc.Areas.Admin.Areas.Admin.Pages 11 | { 12 | public class RoleEditModel : BaseAdminPageModel 13 | { 14 | private readonly SysRoleService _sysRoleService; 15 | 16 | public RoleEditModel(SysRoleService sysRoleService) 17 | { 18 | CurrentMenu = "Role"; 19 | _sysRoleService = sysRoleService; 20 | } 21 | 22 | [BindProperty(SupportsGet = true)] 23 | public string Id { get; set; } 24 | 25 | [BindProperty] 26 | public SysRoleDto SysRoleDto { get; set; } 27 | 28 | public async Task OnGetAsync() 29 | { 30 | if (!string.IsNullOrEmpty(Id)) 31 | { 32 | var entity = await _sysRoleService.GetObjectAsync(_ => _.Id == Id); 33 | SysRoleDto = _sysRoleService.Mapper.Map(entity); 34 | } 35 | } 36 | 37 | public async Task OnPostAsync() 38 | { 39 | //if (!string.IsNullOrEmpty(Id)) 40 | //{ 41 | // var entity = await _sysRoleService.GetObjectAsync(_ => _.Id == Id); 42 | // SysRoleDto = _sysRoleService.Mapper.Map(entity); 43 | //} 44 | await _sysRoleService.CreateOrUpdateAsync(SysRoleDto); 45 | return RedirectToPage("./Index"); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Role/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Senparc.Core.Models.DataBaseModel; 8 | using Senparc.Scf.Core.Models; 9 | using Senparc.Service; 10 | 11 | namespace Senparc.Areas.Admin.Areas.Admin.Pages 12 | { 13 | public class RoleIndexModel : BaseAdminPageModel 14 | { 15 | private readonly SysRoleService _sysRoleService; 16 | 17 | public RoleIndexModel(SysRoleService sysRoleService) 18 | { 19 | CurrentMenu = "Role"; 20 | this._sysRoleService = sysRoleService; 21 | } 22 | 23 | [BindProperty(SupportsGet = true)] 24 | public int PageIndex { get; set; } = 1; 25 | 26 | /// 27 | /// 28 | /// 29 | public PagedList SysRoles { get; set; } 30 | 31 | public async Task OnGetAsync() 32 | { 33 | SysRoles = await _sysRoleService.GetObjectListAsync(PageIndex, 10, _ => true, _ => _.AddTime, Scf.Core.Enums.OrderingType.Descending); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Role/Permission.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model Senparc.Areas.Admin.Areas.Admin.PagesRolePermissionModel 3 | @{ 4 | ViewData["Title"] = $"{Model.SysRoleInfo.RoleName}角色权限列表"; 5 | } 6 | 7 | @section Style{ 8 | 9 | } 10 | 11 | 12 | @section breadcrumbs{ 13 |
  • 系统管理
  • 14 |
  • 15 | 角色管理 16 |
  • 17 |
  • 18 | 角色权限管理 19 |
  • 20 | } 21 | 22 | 23 |
    24 |
    25 |
    26 |
    27 |

    28 | @Model.SysRoleInfo.RoleName - 权限设置 29 |

    30 |
    31 |
      32 |
      33 | 返回 34 | 保存 35 |
      36 |
      37 |
      38 |
      39 | 40 | @section scripts{ 41 | 42 | 43 | 44 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/Shared/_HeaderPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model Senparc.Areas.Admin.BaseAdminPageModel 2 | 3 |
      4 | 18 |
      19 | 20 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Mvc.Razor 2 | @using Senparc.Core.Models.VD 3 | @using Senparc.Scf.Mvc.UI 4 | @using System.Web.Mvc 5 | @using Senparc.CO2NET.Extensions 6 | 7 | @namespace Senparc.Areas.Admin.Pages 8 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 9 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/Admin/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Areas/readme.md: -------------------------------------------------------------------------------- 1 | ## 调试说明 2 | 3 | Razor Page 的独立库需要编译成 dll 后被 Senparc.Web 项目引用才能生效。 4 | 5 | 因此,如果需要快速调试 .cshtml 中的页面内容(避免每次都调试),可以将此文件夹(Areas)整体移动到 Senparc.Web 根目录下。 6 | 7 | ## 安全性 8 | 9 | 为了提高安全性,我们建议对于线上生产环境中的 Admin 模块进行访问限制(如限制IP、限制本地访问,或在别处加载而不在生产环境中集成)。 10 | 11 | 同时,您也可以通过随机修改 Area 名字来提高后台的安全性。 -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/BaseAdminPageModel.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Senparc.Areas.Admin.Filters; 3 | using Senparc.Core.Models.VD; 4 | using Senparc.Scf.Core.Models.VD; 5 | 6 | namespace Senparc.Areas.Admin 7 | { 8 | 9 | public interface IBaseAdminPageModel : IBasePageModel 10 | { 11 | 12 | } 13 | 14 | [ServiceFilter(typeof(AuthenticationResultFilterAttribute))] 15 | [AdminAuthorize("AdminOnly")] 16 | public class BaseAdminPageModel : PageModelBase, IBaseAdminPageModel 17 | { 18 | 19 | /// 20 | /// 存储相关用户信息 21 | /// 22 | public Core.AdminWorkContext AdminWorkContext { get; set; } 23 | 24 | public virtual IActionResult RenderError(string message) 25 | { 26 | //保留原有的controller和action信息 27 | //ViewData["FakeControllerName"] = RouteData.Values["controller"] as string; 28 | //ViewData["FakeActionName"] = RouteData.Values["action"] as string; 29 | 30 | return Page();//TODO:设定一个特定的错误页面 31 | 32 | //return View("Error", new Error_ExceptionVD 33 | //{ 34 | // //HandleErrorInfo = new HandleErrorInfo(new Exception(message), Url.RequestContext.RouteData.GetRequiredString("controller"), Url.RequestContext.RouteData.GetRequiredString("action")) 35 | //}); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Filters/AdminAuthorizeAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Senparc.Scf.Core.Config; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Senparc.Areas.Admin.Filters 8 | { 9 | /// 10 | /// 当前 Area 授权处理特性 11 | /// 12 | public class AdminAuthorizeAttribute : AuthorizeAttribute 13 | { 14 | //AuthorizeAttribute 可以和 MVC 通用:https://docs.microsoft.com/en-us/aspnet/core/razor-pages/filter?view=aspnetcore-2.2 15 | public static string AuthenticationScheme => SiteConfig.ScfAdminAuthorizeScheme; 16 | 17 | public AdminAuthorizeAttribute() 18 | { 19 | base.AuthenticationSchemes = AuthenticationScheme; 20 | } 21 | public AdminAuthorizeAttribute(string policy) : this() 22 | { 23 | this.Policy = policy; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Filters/CustomerResourceFilterAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Microsoft.AspNetCore.Mvc.Filters; 5 | 6 | namespace Senparc.Areas.Admin.Filters 7 | { 8 | public class CustomerResourceFilterAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata 9 | { 10 | public string ResourceCode { get; set; } 11 | 12 | public CustomerResourceFilterAttribute(string resuouceCode) 13 | { 14 | ResourceCode = resuouceCode; 15 | } 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Areas.Admin/Senparc.Areas.Admin.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | $(IncludeRazorContentInPack) 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/EncryptionServiceBase.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Utility; 2 | 3 | namespace Senparc.Service 4 | { 5 | public partial interface IEncryptionServiceBase //: IBaseServiceData 6 | { 7 | string GetEncodedContent(string content, string encodeKey); 8 | string GetDecodedContent(string content, string encodeKey); 9 | } 10 | 11 | public class EncryptionServiceBase :/* BaseServiceData,*/ IEncryptionServiceBase 12 | { 13 | public EncryptionServiceBase()//(IBaseData baseData): base(baseData) 14 | { } 15 | 16 | public string GetEncodedContent(string content, string encodeKey) 17 | { 18 | return DesUtility.EncryptDES(content, encodeKey); 19 | } 20 | 21 | public string GetDecodedContent(string content, string encodeKey) 22 | { 23 | return DesUtility.DecryptDES(content, encodeKey); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/FeedBackService.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/FeedBackService.cs -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/OperationQueue/OperationQueueItem.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Service.OperationQueue; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Senparc.Service.OperationQueue 6 | { 7 | /// 8 | /// 操作列队项 9 | /// 10 | public class OperationQueueItem 11 | { 12 | /// 13 | /// 列队项唯一标识 14 | /// 15 | public string Key { get; set; } 16 | /// 17 | /// 列队项目命中触发时执行的委托 18 | /// 19 | public OperationQueueType OperationQueueType { get; set; } 20 | /// 21 | /// 此实例对象的创建时间 22 | /// 23 | public DateTime AddTime { get; set; } 24 | 25 | /// 26 | /// 储存数据 27 | /// 28 | public List Data { get; set; } 29 | 30 | /// 31 | /// 项目说明(主要用于调试) 32 | /// 33 | public string Description { get; set; } 34 | 35 | /// 36 | /// 初始化SenparcMessageQueue消息列队项 37 | /// 38 | /// 39 | /// 40 | /// 41 | /// 42 | public OperationQueueItem(string key, OperationQueueType operationQueueType, List data, string description = null) 43 | { 44 | Key = key; 45 | OperationQueueType = operationQueueType; 46 | Data = data; 47 | Description = description; 48 | AddTime = DateTime.Now; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/Senparc.Service.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/ServiceBase/ClientServiceBase.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Microsoft.EntityFrameworkCore.Storage; 3 | using Senparc.Scf.Core.Models; 4 | using Senparc.Scf.Repository; 5 | using Senparc.Scf.Service; 6 | using System; 7 | 8 | namespace Senparc.Service 9 | { 10 | public interface IClientServiceBase : IServiceBase where T : EntityBase//global::System.Data.Objects.DataClasses.EntityObject, new() 11 | { 12 | IClientRepositoryBase BaseClientRepository { get; } 13 | 14 | ///// 15 | ///// 开启事物 16 | ///// 17 | ///// 18 | //IDbContextTransaction BeginTransaction(); 19 | } 20 | 21 | 22 | public class ClientServiceBase : ServiceBase, IClientServiceBase where T : EntityBase//global::System.Data.Objects.DataClasses.EntityObject, new() 23 | { 24 | public IClientRepositoryBase BaseClientRepository 25 | { 26 | get 27 | { 28 | return RepositoryBase as IClientRepositoryBase; 29 | } 30 | } 31 | 32 | public ClientServiceBase(IClientRepositoryBase repo, IServiceProvider serviceProvider) 33 | : base(repo, serviceProvider) 34 | { 35 | 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/System/SysButtonService.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Senparc.Core.Models.DataBaseModel; 3 | using Senparc.Respository; 4 | using Senparc.Scf.Repository; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Senparc.Service 11 | { 12 | public class SysButtonService : ClientServiceBase 13 | { 14 | private readonly ISysButtonRespository _iSysButtonRespository; 15 | 16 | public SysButtonService(ISysButtonRespository repo, IServiceProvider serviceProvider) : base(repo, serviceProvider) 17 | { 18 | _iSysButtonRespository = repo; 19 | } 20 | 21 | public async Task DeleteButtonsByMenuId(string menuId) 22 | { 23 | if (string.IsNullOrEmpty(menuId)) 24 | { 25 | return 0; 26 | } 27 | return await _iSysButtonRespository.DeleteButtonsByMenuId(menuId); 28 | } 29 | 30 | public async Task> GetSysButtonDtosAsync(string MenuId) 31 | { 32 | IEnumerable sysButtons = await GetFullListAsync(_ => _.MenuId == MenuId); 33 | return Mapper.Map>(sysButtons); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/System/SysRoleService.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Senparc.Core.Models.DataBaseModel; 3 | using Senparc.Scf.Repository; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Senparc.Service 10 | { 11 | public class SysRoleService : ClientServiceBase 12 | { 13 | public SysRoleService(ClientRepositoryBase repo, IServiceProvider serviceProvider) : base(repo, serviceProvider) 14 | { 15 | 16 | } 17 | 18 | public async Task CreateOrUpdateAsync(SysRoleDto dto) 19 | { 20 | SysRole sysRole; 21 | if (String.IsNullOrEmpty(dto.Id)) 22 | { 23 | sysRole = new SysRole(dto); 24 | } 25 | else 26 | { 27 | sysRole = await GetObjectAsync(_ => _.Id == dto.Id); 28 | sysRole.Update(dto); 29 | } 30 | await SaveObjectAsync(sysRole); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/SystemConfigService.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Service/SystemConfigService.cs -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/BootStrapper/AutoMapperBootStrapper.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Microsoft.AspNetCore.Builder; 3 | 4 | namespace Senparc.Web 5 | { 6 | public static class AutoMapperBootStrapper 7 | { 8 | public static void UseAutoMapper(this IApplicationBuilder app) 9 | { 10 | //Mapper.Initialize(y => 11 | //{ 12 | // #region User 13 | 14 | // //y.CreateMap().ForAllOtherMembers(z => z.ExplicitExpansion()); 15 | // //y.CreateMap().ForAllOtherMembers(z => z.ExplicitExpansion()); 16 | 17 | // #endregion 18 | //}); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/DbContext/SenparcDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Design; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Senparc.CO2NET; 5 | using Senparc.CO2NET.Extensions; 6 | using Senparc.CO2NET.RegisterServices; 7 | using Senparc.CO2NET.Utilities; 8 | using Senparc.Core.Models; 9 | using Senparc.Scf.Core.Config; 10 | using Senparc.Scf.Core.Models; 11 | using System; 12 | using System.Diagnostics; 13 | using System.IO; 14 | 15 | namespace Senparc.Web 16 | { 17 | /// 18 | /// 设计时 DbContext 创建 19 | /// 20 | public class SenparcDbContextFactory : IDesignTimeDbContextFactory 21 | { 22 | public SenparcEntities CreateDbContext(string[] args) 23 | { 24 | //修复 https://github.com/SenparcCoreFramework/SCF/issues/13 发现的问题(在非Web环境下无法得到网站根目录路径) 25 | IRegisterService register = RegisterService.Start(new SenparcSetting()); 26 | CO2NET.Config.RootDictionaryPath = Path.Combine(AppContext.BaseDirectory, "..\\..\\..\\"); // 27 | 28 | var builder = new DbContextOptionsBuilder(); 29 | 30 | //如果运行 Add-Migration 命令,并且获取不到正确的网站根目录,此处可能无法自动获取到连接字符串(上述#13问题), 31 | //也可通过下面已经注释的的提供默认值方式解决(不推荐) 32 | var sqlConnection = SenparcDatabaseConfigs.ClientConnectionString; //?? "Server=.\\;Database=SCF;Trusted_Connection=True;integrated security=True;"; 33 | builder.UseSqlServer(sqlConnection, b => b.MigrationsAssembly("Senparc.Web")); 34 | return new SenparcEntities(builder.Options); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM microsoft/aspnetcore:2.0 AS base 2 | WORKDIR /app 3 | EXPOSE 80 4 | 5 | FROM microsoft/aspnetcore-build:2.0 AS build 6 | WORKDIR /src 7 | COPY Senparc.Core.sln ./ 8 | COPY Senparc.Web/Senparc.Web.csproj Senparc.Web/ 9 | RUN dotnet restore -nowarn:msb3202,nu1503 10 | COPY . . 11 | WORKDIR /src/Senparc.Web 12 | RUN dotnet build -c Release -o /app 13 | 14 | FROM build AS publish 15 | RUN dotnet publish -c Release -o /app 16 | 17 | FROM base AS final 18 | WORKDIR /app 19 | COPY --from=publish /app . 20 | ENTRYPOINT ["dotnet", "Senparc.Web.dll"] 21 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Hubs/ReloadPageHub.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.SignalR; 2 | 3 | namespace Senparc.Web.Hubs 4 | { 5 | /// 6 | /// 刷新页面 7 | /// 8 | public class ReloadPageHub : Hub 9 | { 10 | public const string Route = "/reloadHub"; 11 | } 12 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Migrations/20200204103009_Update-SysMenuDto.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace Senparc.Web.Migrations 4 | { 5 | public partial class UpdateSysMenuDto : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.AddColumn( 10 | name: "ResourceCode", 11 | table: "SysPermission", 12 | maxLength: 20, 13 | nullable: true); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropColumn( 19 | name: "ResourceCode", 20 | table: "SysPermission"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Senparc.Web.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

      Error.

      8 |

      An error occurred while processing your request.

      9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

      13 | Request ID: @Model.RequestId 14 |

      15 | } 16 | 17 |

      Development Mode

      18 |

      19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |

      21 |

      22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |

      27 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | 9 | namespace Senparc.Web.Pages 10 | { 11 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 12 | public class ErrorModel : PageModel 13 | { 14 | public string RequestId { get; set; } 15 | 16 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 17 | 18 | public void OnGet() 19 | { 20 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = $" 首页"; 5 | } 6 |
      7 |

      @Model.FullSystemConfig.SystemName

      8 |

      开源项目:https://github.com/SenparcCoreFramework/SCF

      9 |
      10 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Senparc.Core.Models.VD; 8 | using Senparc.Scf.Core.Cache; 9 | using Senparc.Scf.Core.Models; 10 | 11 | namespace Senparc.Web.Pages 12 | { 13 | public class IndexModel : BasePageModel 14 | { 15 | //public FullSystemConfig FullSystemConfig { get; set; } 16 | 17 | //private FullSystemConfigCache _fullSystemConfigCache; 18 | //public IndexModel(FullSystemConfigCache fullSystemConfigCache) 19 | //{ 20 | // _fullSystemConfigCache = fullSystemConfigCache; 21 | //} 22 | 23 | public void OnGet() 24 | { 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "隐私策略"; 5 | } 6 |

      @ViewData["Title"]

      7 | 8 |

      9 | 使用此页面详细说明您的网站的隐私政策。 10 |

      11 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Senparc.Core.Models.VD; 8 | 9 | namespace Senparc.Web.Pages 10 | { 11 | public class PrivacyModel : BasePageModel 12 | { 13 | public void OnGet() 14 | { 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 17 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Senparc.Web 2 | @using Senparc.Core.Models.VD 3 | 4 | @namespace Senparc.Web.Pages 5 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 6 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace Senparc.Web 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | var build = CreateWebHostBuilder(args).Build(); 18 | build.Run(); 19 | } 20 | 21 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 22 | WebHost.CreateDefaultBuilder(args) 23 | .UseStartup(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:61126", 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 | "Senparc.Web": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Startup.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/Startup.cs -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "3.0.100" 4 | } 5 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/gulpfile.js: -------------------------------------------------------------------------------- 1 | /// 2 | /* 3 | This file is the main entry point for defining Gulp tasks and using Gulp plugins. 4 | Click here to learn more. http://go.microsoft.com/fwlink/?LinkId=518007 5 | */ 6 | 7 | var gulp = require('gulp'); 8 | var del = require('del'); 9 | 10 | var ts = require("gulp-typescript"); 11 | var tsProject = ts.createProject("tsconfig.json"); 12 | 13 | 14 | var paths = { 15 | scripts: ['scripts/**/*.js', 'scripts/**/*.ts', 'scripts/**/*.map'] 16 | }; 17 | 18 | gulp.task('clean', function () { 19 | return del(['wwwroot/scripts/**/*']); 20 | }); 21 | 22 | gulp.task('default', function () { 23 | //gulp.src(paths.scripts).pipe(gulp.dest('wwwroot/scripts')) 24 | 25 | return tsProject.src() 26 | .pipe(tsProject()) 27 | .js.pipe(gulp.dest("wwwroot/scripts")); 28 | 29 | }); 30 | 31 | var merge = require('merge-stream'); 32 | // Old bower behavior would be "*" in before and "" in after but you don't want that much. 33 | var webpackages = { 34 | "requirejs": { "bin/*": "bin/" } 35 | // ... 36 | }; 37 | 38 | //gulp.task("dist_lib", function () { 39 | // var streams = []; 40 | // for (var package in webpackages) 41 | // for (var item in webpackages[package]) 42 | // streams.push(gulp.src("node_modules/" + package + "/" + item) 43 | // .pipe(gulp.dest("lib/" + package + "/" + webpackage[package][item]))); 44 | //}); -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/libman.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "defaultProvider": "cdnjs", 4 | "libraries": [ 5 | { 6 | "library": "zTree.v3@3.5.40", 7 | "destination": "wwwroot/lib/zTree.v3/" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/log4net.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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/logs/log4net/logs_20200207/log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/logs/log4net/logs_20200207/log.txt -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/logs/log4net/logs_20200208/log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/logs/log4net/logs_20200208/log.txt -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/logs/log4net/logs_20200209/log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/logs/log4net/logs_20200209/log.txt -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "asp.net", 4 | "private": true, 5 | "devDependencies": { 6 | "bootstrap-sweetalert": "1.0.1", 7 | "del": "2.2.0", 8 | "gentelella": "1.4.0", 9 | "gulp": "^3.9.0", 10 | "gulp-typescript": "^5.0.1", 11 | "merge-stream": "1.0.1", 12 | "typescript": "^3.4.5" 13 | }, 14 | "dependencies": { 15 | "@ztree/ztree_v3": "^3.5.41", 16 | "bootstrap-datetimepicker": "0.0.7", 17 | "echarts": "^4.5.0", 18 | "moment": "^2.24.0", 19 | "sweetalert": "^2.1.2" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/scripts/app.js: -------------------------------------------------------------------------------- 1 | function init() { 2 | console.log('ts init()'); 3 | } 4 | //# sourceMappingURL=app.js.map -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/scripts/app.ts: -------------------------------------------------------------------------------- 1 | function init() { 2 | console.log('ts init()'); 3 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noImplicitAny": false, 4 | "noEmitOnError": true, 5 | "removeComments": false, 6 | "sourceMap": true, 7 | "target": "es5" 8 | }, 9 | "exclude": [ 10 | "node_modules", 11 | "wwwroot" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/css/Admin/adminlogin/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/css/Admin/adminlogin/logo.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/css/Admin/menuEdit.css: -------------------------------------------------------------------------------- 1 | body { 2 | } 3 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/css/Admin/styles.css: -------------------------------------------------------------------------------- 1 | .nav-sm .hidden-small { 2 | display: none; 3 | } 4 | 5 | .breadcrumb { 6 | padding-left: 0px; 7 | padding-top: 0px; 8 | } 9 | 10 | .breadcrumb a { 11 | color: #337ab7 12 | } 13 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Sticky footer styles 11 | -------------------------------------------------- */ 12 | html { 13 | font-size: 14px; 14 | } 15 | @media (min-width: 768px) { 16 | html { 17 | font-size: 16px; 18 | } 19 | } 20 | 21 | .border-top { 22 | border-top: 1px solid #e5e5e5; 23 | } 24 | .border-bottom { 25 | border-bottom: 1px solid #e5e5e5; 26 | } 27 | 28 | .box-shadow { 29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 30 | } 31 | 32 | button.accept-policy { 33 | font-size: 1rem; 34 | line-height: inherit; 35 | } 36 | 37 | /* Sticky footer styles 38 | -------------------------------------------------- */ 39 | html { 40 | position: relative; 41 | min-height: 100%; 42 | } 43 | 44 | body { 45 | /* Margin bottom by footer height */ 46 | margin-bottom: 60px; 47 | } 48 | .footer { 49 | position: absolute; 50 | bottom: 0; 51 | width: 100%; 52 | white-space: nowrap; 53 | /* Set the fixed height of the footer here */ 54 | height: 60px; 55 | line-height: 60px; /* Vertically center the text there */ 56 | } 57 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/Avatar/NeuChar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/Avatar/NeuChar.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/Avatar/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/Avatar/default.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/Logo.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/base/AdminLogin/admin_login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/base/AdminLogin/admin_login.jpg -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/base/head/logo_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/base/head/logo_128x128.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/base/head/logo_230x55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/base/head/logo_230x55.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/base/head/logo_70x55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Admin/base/head/logo_70x55.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Shared/SCFLogo/logo_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Shared/SCFLogo/logo_128x128.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Shared/SCFLogo/logo_230x55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Shared/SCFLogo/logo_230x55.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Shared/SCFLogo/logo_70x55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/Shared/SCFLogo/logo_70x55.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/logo-login-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/logo-login-0.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/logo-login-scf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/logo-login-scf.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/logo-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/logo-login.png -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/logo-square-scf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/images/logo-square-scf.jpg -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/js/Admin/Pages/AdminUserInfo/AuthorizationPage.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | _init(); 3 | }); 4 | function _init() { 5 | $('#submit').on('click', submit); 6 | } 7 | 8 | async function submit() { 9 | let accountId = resizeUrl().accountId; 10 | let $roleCheckBoxs = $('.roleCheckBox'); 11 | let array = []; 12 | $roleCheckBoxs.each((index, ele) => { 13 | if ($(ele).prop('checked')) { 14 | array.push($(ele).val()); 15 | } 16 | }); 17 | if (array.length === 0) { 18 | return; 19 | } 20 | await base.post('/Admin/AdminUserInfo/AuthorizationPage', { RoleIds: array, accountId: accountId }); 21 | await base.swal.alert('保存成功!', 'success'); 22 | window.location.href = '/Admin/AdminUserInfo/Index'; 23 | } -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/js/Admin/Pages/AdminUserInfo/Edit.js: -------------------------------------------------------------------------------- 1 | var vm = new Vue({ 2 | el: "#app", 3 | data: { 4 | form: { 5 | UserName: '', 6 | Password: '', 7 | ConfirmPassword: '', 8 | RealName: '', 9 | Phone: '', 10 | Note: '', 11 | dialogVisible: true 12 | } 13 | }, 14 | methods: { 15 | onSubmit() { 16 | vm.$confirm("确定提交吗?", '提示', { 17 | confirmButtonText: '确定', 18 | cancelButtonText: '取消', 19 | type: 'warning' 20 | }).then((ss) => { 21 | 22 | }).catch((ww) => { 23 | 24 | }); 25 | //base.confirm("确定提交吗?", "提交后保存数据", function () { 26 | // console.log("comfirm!"); 27 | //}, function () { 28 | // console.log("cancel!"); 29 | //}); 30 | //console.log('submit!'); 31 | 32 | } 33 | } 34 | 35 | }); -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/js/Admin/Pages/AdminUserInfo/Index.js: -------------------------------------------------------------------------------- 1 | var vm = new Vue({ 2 | el: "#app", 3 | data: function () { 4 | return { 5 | list: [],//AdminUserInfo_getList 6 | currentPage1: 5, 7 | currentPage2: 5, 8 | currentPage3: 5, 9 | currentPage4: 4, 10 | multipleSelection:[] 11 | }; 12 | }, 13 | created: function () { 14 | //this.adminUserInfo_getList(); 15 | }, 16 | methods: { 17 | adminUserInfo_getList: function () { 18 | base.get("/Admin/AdminUserInfo/OnGetAsync", function (result) { 19 | //vm.list 20 | }); 21 | }, 22 | handleEdit: function (data) { 23 | window.open("/Admin/AdminUserInfo/Edit?id=" + data.Id); 24 | }, 25 | handleSizeChange(val) { 26 | console.log(`每页 `+val+` 条`); 27 | }, 28 | handleCurrentChange(val) { 29 | console.log(`当前页: `+val); 30 | }, 31 | handleSelectionChange(val) { 32 | vm.multipleSelection = val; 33 | } 34 | } 35 | 36 | }); -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/js/element-ui_2.5.4/theme/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/js/element-ui_2.5.4/theme/fonts/element-icons.ttf -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/js/element-ui_2.5.4/theme/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/js/element-ui_2.5.4/theme/fonts/element-icons.woff -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your Javascript code. 5 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/APP_Data/src/Senparc.Web/wwwroot/scripts/app.js: -------------------------------------------------------------------------------- 1 | function init() { 2 | console.log('ts init()'); 3 | } 4 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/ChangeNameSpaceTest.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/ChangeNameSpaceTest.cs -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace.Tests/Senparc.Xscf.ChangeNamespace.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | false 7 | 8 | Debug;Release;Test 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace/Entities/MeetRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Senparc.Xscf.ChangeNamespace 6 | { 7 | public class MeetRule 8 | { 9 | 10 | public MeetRule(string prefix, string orignalKeyword, string replaceWord, string fileType = null) 11 | { 12 | Prefix = prefix; 13 | OrignalKeyword = orignalKeyword; 14 | ReplaceWord = replaceWord; 15 | FileType = fileType; 16 | } 17 | 18 | public string Prefix { get; set; } 19 | public string OrignalKeyword { get; set; } 20 | public string ReplaceWord { get; set; } 21 | public string FileType { get; set; } 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.ChangeNamespace/readme.md: -------------------------------------------------------------------------------- 1 | ## 说明 2 | 3 | 程序发布之前,整体修改 SCF 模板中的命名空间 4 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.DatabaseToolkit/Senparc.Xscf.DatabaseToolkit/App_Data/DataBase/SenparcConfig.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | Client 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 2 19 | Local 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.DatabaseToolkit/Senparc.Xscf.DatabaseToolkit/Migrations/20200326162920_Add_SetConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | namespace Senparc.Xscf.DatabaseToolkit.Migrations 5 | { 6 | public partial class Add_SetConfig : Migration 7 | { 8 | protected override void Up(MigrationBuilder migrationBuilder) 9 | { 10 | migrationBuilder.CreateTable( 11 | name: "DatabaseToolkitDbConfig", 12 | columns: table => new 13 | { 14 | Id = table.Column(nullable: false) 15 | .Annotation("SqlServer:Identity", "1, 1"), 16 | Flag = table.Column(nullable: false), 17 | AddTime = table.Column(nullable: false), 18 | LastUpdateTime = table.Column(nullable: false), 19 | AdminRemark = table.Column(maxLength: 300, nullable: true), 20 | Remark = table.Column(maxLength: 300, nullable: true), 21 | BackupCycleMinutes = table.Column(nullable: false), 22 | BackuPath = table.Column(maxLength: 300, nullable: true) 23 | }, 24 | constraints: table => 25 | { 26 | table.PrimaryKey("PK_DatabaseToolkitDbConfig", x => x.Id); 27 | }); 28 | } 29 | 30 | protected override void Down(MigrationBuilder migrationBuilder) 31 | { 32 | migrationBuilder.DropTable( 33 | name: "DatabaseToolkitDbConfig"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.DatabaseToolkit/Senparc.Xscf.DatabaseToolkit/Models/DataBaseModel/DbConfig.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.ComponentModel.DataAnnotations.Schema; 6 | using System.Text; 7 | 8 | namespace Senparc.Xscf.DatabaseToolkit 9 | { 10 | [Table(Register.DATABASE_PREFIX + nameof(DbConfig))]//必须添加前缀,防止全系统中发生冲突 11 | [Serializable] 12 | public class DbConfig : EntityBase 13 | { 14 | /// 15 | /// 备份间隔时间 16 | /// 17 | [Required] 18 | public int BackupCycleMinutes { get; private set; } 19 | /// 20 | /// 备份物理路径 21 | /// 22 | [MaxLength(300)] 23 | public string BackupPath { get; private set; } 24 | 25 | /// 26 | /// 上次备份时间 27 | /// 28 | public DateTime? LastBackupTime { get; private set; } 29 | 30 | private DbConfig() { } 31 | 32 | public DbConfig(int backupCycleMinutes, string backupPath) 33 | { 34 | BackupCycleMinutes = backupCycleMinutes; 35 | BackupPath = backupPath; 36 | } 37 | 38 | public void RecordBackupTime() 39 | { 40 | LastBackupTime = SystemTime.Now.DateTime; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.DatabaseToolkit/Senparc.Xscf.DatabaseToolkit/Models/DatabaseToolkitEntities.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Senparc.Scf.XscfBase; 3 | using Senparc.Scf.XscfBase.Database; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace Senparc.Xscf.DatabaseToolkit 9 | { 10 | public class DatabaseToolkitEntities : XscfDatabaseDbContext 11 | { 12 | public override IXscfDatabase XscfDatabaseRegister => new Register(); 13 | public DatabaseToolkitEntities(DbContextOptions dbContextOptions) : base(dbContextOptions) 14 | { 15 | } 16 | 17 | public DbSet DbConfigs { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.DatabaseToolkit/Senparc.Xscf.DatabaseToolkit/Models/SenparcDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using log4net; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Senparc.CO2NET; 5 | using Senparc.CO2NET.RegisterServices; 6 | using Senparc.Scf.XscfBase.Database; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.IO; 10 | using System.Text; 11 | 12 | namespace Senparc.Xscf.DatabaseToolkit 13 | { 14 | /// 15 | /// 设计时 DbContext 创建(仅在开发时创建 Code-First 的数据库 Migration 使用,在生产环境不会执行) 16 | /// 17 | public class SenparcDbContextFactory : SenparcDesignTimeDbContextFactoryBase 18 | { 19 | /// 20 | /// 用于寻找 App_Data 文件夹,从而找到数据库连接字符串配置信息 21 | /// 22 | public override string RootDictionaryPath => Path.Combine(AppContext.BaseDirectory, "..\\..\\..\\"/* Debug模式下项目根目录 */); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.DatabaseToolkit/Senparc.Xscf.DatabaseToolkit/Register.Database.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Senparc.CO2NET.Trace; 4 | using Senparc.Scf.XscfBase; 5 | using Senparc.Xscf.DatabaseToolkit.Functions; 6 | using System; 7 | 8 | namespace Senparc.Xscf.DatabaseToolkit 9 | { 10 | public partial class Register : IXscfDatabase 11 | { 12 | public const string DATABASE_PREFIX = "DatabaseToolkit"; 13 | public string DatabaseUniquePrefix => DATABASE_PREFIX; 14 | 15 | public Type XscfDatabaseDbContextType => typeof(DatabaseToolkitEntities); 16 | 17 | public void AddXscfDatabaseModule(IServiceCollection services) 18 | { 19 | //SenparcTrace.SendCustomLog("执行调试", "DatabaseToolkit.AddXscfDatabaseModule"); 20 | services.AddScoped(); 21 | services.AddScoped(); 22 | services.AddScoped(); 23 | 24 | //AutoMap映射 25 | base.AddAutoMapMapping(profile => 26 | { 27 | profile.CreateMap(); 28 | profile.CreateMap(); 29 | }); 30 | } 31 | 32 | public void OnModelCreating(ModelBuilder modelBuilder) 33 | { 34 | //实现 [XscfAutoConfigurationMapping] 特性之后,可以自动执行,无需手动添加 35 | //modelBuilder.ApplyConfiguration(new DbConfig_WeixinUserConfigurationMapping()); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Extensions/Senparc.Xscf.DatabaseToolkit/Senparc.Xscf.DatabaseToolkit/Register.RazorRuntime.cs: -------------------------------------------------------------------------------- 1 | using Senparc.Scf.Core.Config; 2 | using Senparc.Scf.XscfBase; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Text; 7 | 8 | namespace Senparc.Xscf.DatabaseToolkit 9 | { 10 | public partial class Register : IXscfRazorRuntimeCompilation 11 | { 12 | public string LibraryPath => Path.Combine(SiteConfig.WebRootPath, "..", "..", "..", "..", "ScfPackageSources", "src", "Extensions", "Senparc.Xscf.DatabaseToolkit"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Extensions/readme.md: -------------------------------------------------------------------------------- 1 | ## 扩展包 2 | 3 | ## 扩展包 4 | 用于 [SCF(SenparcCoreFramework)](https://github.com/SenparcCoreFramework/SCF) 项目的扩展包,以 `Senparc.ScfExtension.`开头 5 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

      Error.

      8 |

      An error occurred while processing your request.

      9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

      13 | Request ID: @Model.RequestId 14 |

      15 | } 16 | 17 |

      Development Mode

      18 |

      19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |

      21 |

      22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |

      27 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Senparc.IntegrationSample.Pages 11 | { 12 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 13 | public class ErrorModel : PageModel 14 | { 15 | public string RequestId { get; set; } 16 | 17 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 18 | 19 | private readonly ILogger _logger; 20 | 21 | public ErrorModel(ILogger logger) 22 | { 23 | _logger = logger; 24 | } 25 | 26 | public void OnGet() 27 | { 28 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "测试页"; 5 | } 6 | 7 |
      8 |

      SenparcCoreFramework

      9 |

      10 | 注意:此项目是 SCF 基础包的集成测试项目,仅验证编译是否能通过,无参考意义,并非 SCF 模板项目! 11 | 点击这里 查看可直接安装使用的 SCF 模板项目! 12 |

      13 |
      14 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace Senparc.IntegrationSample.Pages 10 | { 11 | public class IndexModel : PageModel 12 | { 13 | private readonly ILogger _logger; 14 | 15 | public IndexModel(ILogger logger) 16 | { 17 | _logger = logger; 18 | } 19 | 20 | public void OnGet() 21 | { 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |

      @ViewData["Title"]

      7 | 8 |

      Use this page to detail your site's privacy policy.

      9 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace Senparc.IntegrationSample.Pages 10 | { 11 | public class PrivacyModel : PageModel 12 | { 13 | private readonly ILogger _logger; 14 | 15 | public PrivacyModel(ILogger logger) 16 | { 17 | _logger = logger; 18 | } 19 | 20 | public void OnGet() 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Senparc.IntegrationSample 2 | @namespace Senparc.IntegrationSample.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Senparc.IntegrationSample 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:56753", 7 | "sslPort": 44350 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Senparc.IntegrationSample": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Senparc.IntegrationSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Startup.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/Startup.cs -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/appsettings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/appsettings.json -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Provide sufficient contrast against white background */ 11 | a { 12 | color: #0366d6; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 22 | color: #fff; 23 | background-color: #1b6ec2; 24 | border-color: #1861ac; 25 | } 26 | 27 | /* Sticky footer styles 28 | -------------------------------------------------- */ 29 | html { 30 | font-size: 14px; 31 | } 32 | @media (min-width: 768px) { 33 | html { 34 | font-size: 16px; 35 | } 36 | } 37 | 38 | .border-top { 39 | border-top: 1px solid #e5e5e5; 40 | } 41 | .border-bottom { 42 | border-bottom: 1px solid #e5e5e5; 43 | } 44 | 45 | .box-shadow { 46 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 47 | } 48 | 49 | button.accept-policy { 50 | font-size: 1rem; 51 | line-height: inherit; 52 | } 53 | 54 | /* Sticky footer styles 55 | -------------------------------------------------- */ 56 | html { 57 | position: relative; 58 | min-height: 100%; 59 | } 60 | 61 | body { 62 | /* Margin bottom by footer height */ 63 | margin-bottom: 60px; 64 | } 65 | .footer { 66 | position: absolute; 67 | bottom: 0; 68 | width: 100%; 69 | white-space: nowrap; 70 | line-height: 60px; /* Vertically center the text there */ 71 | } 72 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SenparcCoreFramework/ScfPackageSources/29a7c5f26e5f4dd90290dc034c5fcd754302deea/src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your Javascript code. 5 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /src/Senparc.IntegrationSample.Tests/Senparc.IntegrationSample/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | --------------------------------------------------------------------------------