├── .gitattributes ├── test ├── Host │ └── Host.Generic.Tests │ │ ├── config │ │ ├── cache.Development.json │ │ ├── cache.json │ │ └── logging.Development.json │ │ ├── Properties │ │ └── launchSettings.json │ │ └── Program.cs ├── Pdf │ └── Pdf.iText.Tests │ │ ├── pdfs │ │ ├── pH水质自动分析仪技术要求.pdf │ │ └── 再生铜、铝、铅、锌工业污染物排放标准.pdf │ │ └── PdfHandlerTest.cs ├── Utils │ └── Utils.Core.Tests │ │ ├── Log │ │ ├── ILog.cs │ │ └── TextLog.cs │ │ ├── BaseTest.cs │ │ └── ServiceCollectionExtensionsTest.cs └── Data │ ├── Data.Common │ ├── Repository │ │ ├── ICategoryRepository.cs │ │ ├── CategoryRepository.cs │ │ └── IArticleRepository.cs │ ├── BlogDbContext.cs │ ├── Domain │ │ └── CategoryEntity.cs │ ├── Data.Common.csproj │ └── LoginInfo.cs │ ├── Data.SQLite.Tests │ └── config │ │ └── db.json │ ├── Data.SqlServer.Tests │ └── config │ │ └── db.json │ ├── Data.MySql.Tests │ └── config │ │ └── db.json │ └── Data.PostgreSQL.Tests │ └── config │ └── db.json ├── src ├── Admin │ ├── UI │ │ └── module-admin │ │ │ ├── .browserslistrc │ │ │ ├── src │ │ │ ├── store │ │ │ │ └── index.js │ │ │ ├── main.js │ │ │ ├── views │ │ │ │ ├── cache │ │ │ │ │ └── index │ │ │ │ │ │ ├── cols.js │ │ │ │ │ │ └── page.js │ │ │ │ ├── mime │ │ │ │ │ └── index │ │ │ │ │ │ └── cols.js │ │ │ │ ├── home │ │ │ │ │ ├── page.js │ │ │ │ │ └── index.vue │ │ │ │ ├── icon │ │ │ │ │ └── page.js │ │ │ │ ├── module │ │ │ │ │ ├── index │ │ │ │ │ │ └── page.js │ │ │ │ │ └── components │ │ │ │ │ │ └── permission-list │ │ │ │ │ │ └── cols.js │ │ │ │ ├── config │ │ │ │ │ ├── page.js │ │ │ │ │ └── library │ │ │ │ │ │ └── form-mixins.js │ │ │ │ ├── log │ │ │ │ │ └── login-log │ │ │ │ │ │ ├── page.js │ │ │ │ │ │ └── cols.js │ │ │ │ └── menu │ │ │ │ │ └── index │ │ │ │ │ └── cols.js │ │ │ ├── api │ │ │ │ ├── components │ │ │ │ │ ├── mime.js │ │ │ │ │ ├── cache.js │ │ │ │ │ ├── module.js │ │ │ │ │ ├── log.js │ │ │ │ │ ├── permission.js │ │ │ │ │ ├── tool.js │ │ │ │ │ ├── auditInfo.js │ │ │ │ │ └── config.js │ │ │ │ └── index.js │ │ │ ├── module.js │ │ │ ├── components │ │ │ │ ├── role-select │ │ │ │ │ └── index.vue │ │ │ │ ├── module-select │ │ │ │ │ └── index.vue │ │ │ │ ├── loginmode-select │ │ │ │ │ └── index.vue │ │ │ │ ├── index.js │ │ │ │ ├── platform-select │ │ │ │ │ └── index.vue │ │ │ │ ├── enum-select │ │ │ │ │ └── index.vue │ │ │ │ ├── enum-radio │ │ │ │ │ └── index.vue │ │ │ │ └── enum-checkbox │ │ │ │ │ └── index.vue │ │ │ ├── routes │ │ │ │ └── index.js │ │ │ └── config │ │ │ │ └── index.js │ │ │ ├── script │ │ │ ├── npm_update.ps1 │ │ │ ├── npm_install.ps1 │ │ │ └── npm_publish.ps1 │ │ │ ├── postcss.config.js │ │ │ ├── .prettierrc │ │ │ ├── babel.config.js │ │ │ ├── .vscode │ │ │ └── settings.json │ │ │ └── .eslintrc.js │ ├── WebHost │ │ ├── _modules │ │ │ └── 00_Admin │ │ │ │ ├── _module.json │ │ │ │ └── InitData │ │ │ │ ├── AccountRole.json │ │ │ │ ├── AccountConfig.json │ │ │ │ ├── Module.json │ │ │ │ ├── Role.json │ │ │ │ └── Account.json │ │ ├── Program.cs │ │ └── Properties │ │ │ └── launchSettings.json │ ├── Library │ │ ├── Domain │ │ │ ├── Module │ │ │ │ └── ModuleEntity.Extend.cs │ │ │ ├── Mime │ │ │ │ ├── Models │ │ │ │ │ └── MimeQueryModel.cs │ │ │ │ └── MimeEntity.cs │ │ │ ├── Tenant │ │ │ │ ├── ITenantRepository.cs │ │ │ │ └── TenantEntity.cs │ │ │ ├── Role │ │ │ │ ├── Models │ │ │ │ │ └── RoleQueryModel.cs │ │ │ │ └── RoleEntity.cs │ │ │ ├── Config │ │ │ │ ├── ConfigEntity.Extend.cs │ │ │ │ ├── Models │ │ │ │ │ └── ConfigQueryModel.cs │ │ │ │ ├── IConfigRepository.cs │ │ │ │ └── ConfigEntity.cs │ │ │ ├── AuditInfo │ │ │ │ └── AuditInfoEntity.Extend.cs │ │ │ ├── LoginLog │ │ │ │ ├── LoginLogEntity.Extend.cs │ │ │ │ └── ILoginLogRepository.cs │ │ │ ├── FileOwner │ │ │ │ ├── IFileOwnerRepository.cs │ │ │ │ └── FileOwnerEntity.cs │ │ │ ├── File │ │ │ │ ├── FileEntity.Extend.cs │ │ │ │ └── Models │ │ │ │ │ └── FileQueryModel.cs │ │ │ ├── Menu │ │ │ │ ├── Models │ │ │ │ │ └── MenuQueryModel.cs │ │ │ │ ├── MenuEntity.Extend.cs │ │ │ │ └── MenuType.cs │ │ │ ├── AccountConfig │ │ │ │ └── IAccountConfigRepository.cs │ │ │ ├── RoleMenu │ │ │ │ └── RoleMenuEntity.cs │ │ │ ├── AccountRole │ │ │ │ └── AccountRoleEntity.cs │ │ │ ├── RolePage │ │ │ │ └── RolePageEntity.cs │ │ │ ├── RolePermission │ │ │ │ └── RolePermissionEntity.cs │ │ │ └── RoleButton │ │ │ │ └── RoleButtonEntity.cs │ │ ├── Application │ │ │ ├── ModuleService │ │ │ │ └── ViewModels │ │ │ │ │ ├── ModuleSyncModel.cs │ │ │ │ │ └── ModuleOptionsUpdateModel.cs │ │ │ ├── MimeService │ │ │ │ └── ViewModels │ │ │ │ │ ├── MimeUpdateModel.cs │ │ │ │ │ └── MimeAddModel.cs │ │ │ ├── RoleService │ │ │ │ ├── ViewModels │ │ │ │ │ ├── RoleUpdateModel.cs │ │ │ │ │ ├── RoleAddModel.cs │ │ │ │ │ ├── RoleMenuBindModel.cs │ │ │ │ │ └── RolePermissionBindModel.cs │ │ │ │ └── _MapperConfig.cs │ │ │ ├── MenuService │ │ │ │ ├── ViewModels │ │ │ │ │ └── MenuUpdateModel.cs │ │ │ │ └── _MapperConfig.cs │ │ │ ├── ConfigService │ │ │ │ └── ViewModels │ │ │ │ │ └── ConfigUpdateModel.cs │ │ │ ├── ToolService │ │ │ │ └── IToolService.cs │ │ │ ├── AccountService │ │ │ │ └── ViewModels │ │ │ │ │ ├── AccountSkinUpdateModel.cs │ │ │ │ │ └── AccountRoleBindModel.cs │ │ │ ├── AuthService │ │ │ │ ├── LoginHandler │ │ │ │ │ └── DefaultCustomLoginHandler.cs │ │ │ │ └── Defaults │ │ │ │ │ └── DefaultPhoneVerifyCodeProvider.cs │ │ │ └── CacheService │ │ │ │ └── ICacheService.cs │ │ ├── Infrastructure │ │ │ ├── Repositories │ │ │ │ ├── PostgreSQL │ │ │ │ │ ├── Sql │ │ │ │ │ │ └── AuditInfoSql.cs │ │ │ │ │ ├── FileRepository.cs │ │ │ │ │ ├── MimeRepository.cs │ │ │ │ │ ├── ConfigRepository.cs │ │ │ │ │ ├── MenuRepository.cs │ │ │ │ │ ├── ModuleRepository.cs │ │ │ │ │ ├── RoleRepository.cs │ │ │ │ │ ├── TenantRepository.cs │ │ │ │ │ ├── AccountRepository.cs │ │ │ │ │ ├── LoginLogRepository.cs │ │ │ │ │ ├── RoleMenuRepository.cs │ │ │ │ │ ├── RolePageRepository.cs │ │ │ │ │ ├── FileOwnerRepository.cs │ │ │ │ │ ├── RoleButtonRepository.cs │ │ │ │ │ ├── AccountRoleRepository.cs │ │ │ │ │ ├── AccountConfigRepository.cs │ │ │ │ │ ├── RolePermissionRepository.cs │ │ │ │ │ └── AccountAuthInfoRepository.cs │ │ │ │ ├── MySql │ │ │ │ │ ├── FileRepository.cs │ │ │ │ │ ├── MimeRepository.cs │ │ │ │ │ ├── ConfigRepository.cs │ │ │ │ │ ├── MenuRepository.cs │ │ │ │ │ ├── ModuleRepository.cs │ │ │ │ │ ├── RoleRepository.cs │ │ │ │ │ ├── TenantRepository.cs │ │ │ │ │ ├── AccountRepository.cs │ │ │ │ │ ├── LoginLogRepository.cs │ │ │ │ │ ├── RoleMenuRepository.cs │ │ │ │ │ ├── RolePageRepository.cs │ │ │ │ │ ├── FileOwnerRepository.cs │ │ │ │ │ ├── RoleButtonRepository.cs │ │ │ │ │ ├── AccountRoleRepository.cs │ │ │ │ │ ├── AccountConfigRepository.cs │ │ │ │ │ ├── RolePermissionRepository.cs │ │ │ │ │ ├── AccountAuthInfoRepository.cs │ │ │ │ │ └── Sql │ │ │ │ │ │ └── AuditInfoSql.cs │ │ │ │ ├── SQLite │ │ │ │ │ ├── FileRepository.cs │ │ │ │ │ ├── MimeRepository.cs │ │ │ │ │ ├── MenuRepository.cs │ │ │ │ │ ├── RoleRepository.cs │ │ │ │ │ ├── ConfigRepository.cs │ │ │ │ │ ├── ModuleRepository.cs │ │ │ │ │ ├── TenantRepository.cs │ │ │ │ │ ├── AccountRepository.cs │ │ │ │ │ ├── LoginLogRepository.cs │ │ │ │ │ ├── RoleMenuRepository.cs │ │ │ │ │ ├── RolePageRepository.cs │ │ │ │ │ ├── FileOwnerRepository.cs │ │ │ │ │ ├── RoleButtonRepository.cs │ │ │ │ │ ├── AccountConfigRepository.cs │ │ │ │ │ ├── AccountRoleRepository.cs │ │ │ │ │ ├── RolePermissionRepository.cs │ │ │ │ │ └── AccountAuthInfoRepository.cs │ │ │ │ ├── AdminDbContext.cs │ │ │ │ └── SqlServer │ │ │ │ │ ├── TenantRepository.cs │ │ │ │ │ ├── Sql │ │ │ │ │ └── AuditInfoSql.cs │ │ │ │ │ ├── ConfigRepository.cs │ │ │ │ │ ├── FileOwnerRepository.cs │ │ │ │ │ └── AccountConfigRepository.cs │ │ │ ├── AdminConfig.cs │ │ │ ├── ModuleServicesConfigurator.cs │ │ │ └── AccountPermissionResolver │ │ │ │ └── MenuComparer.cs │ │ └── Quartz │ │ │ ├── Quartz.csproj │ │ │ └── ModuleApiRequestCountSyncTask.cs │ └── Web │ │ ├── ModuleController.cs │ │ ├── Validators │ │ ├── AccountUpdateValidator.cs │ │ └── AccountAddValidator.cs │ │ └── Core │ │ └── DefaultLoginClaimsExtendProvider.cs └── Framework │ ├── Host │ ├── Host.Api │ │ ├── Class1.cs │ │ └── Host.Api.csproj │ ├── Host.Web │ │ ├── IStartLogoProvider.cs │ │ └── Middleware │ │ │ └── ExceptionHandleMiddlewareExtensions.cs │ └── Host.Electron │ │ └── Host.Electron.csproj │ ├── Config │ ├── Config.Abstractions │ │ ├── IConfig.cs │ │ ├── ConfigCollection.cs │ │ ├── IConfigCollection.cs │ │ ├── ConfigType.cs │ │ ├── IConfigChangeEvent.cs │ │ ├── Config.Abstractions.csproj │ │ └── Impl │ │ │ └── SystemConfig.cs │ ├── Config.Redis │ │ ├── Config.Redis.csproj │ │ └── ServiceCollectionExtensions.cs │ └── Config.Core │ │ └── Config.Core.csproj │ ├── Pdf │ ├── Pdf.Abstractions │ │ ├── PdfProvider.cs │ │ ├── PdfConfig.cs │ │ ├── IPdfHandler.cs │ │ └── Pdf.Abstractions.csproj │ ├── Pdf.Integration │ │ └── Pdf.Integration.csproj │ └── Pdf.iText │ │ └── Pdf.iText.csproj │ ├── Data │ ├── Core │ │ ├── Data.Abstractions │ │ │ ├── Entities │ │ │ │ ├── IEntity.cs │ │ │ │ ├── IColumnDescriptorCollection.cs │ │ │ │ ├── ITenant.cs │ │ │ │ └── IEntitySqlBuilder.cs │ │ │ ├── Enums │ │ │ │ ├── JoinType.cs │ │ │ │ └── SortType.cs │ │ │ ├── Attributes │ │ │ │ ├── KeyAttribute.cs │ │ │ │ ├── MaxAttribute.cs │ │ │ │ ├── NullableAttribute.cs │ │ │ │ ├── PrefixIgnoreAttribute.cs │ │ │ │ ├── IgnoreAttribute.cs │ │ │ │ ├── LengthAttribute.cs │ │ │ │ ├── TableAttribute.cs │ │ │ │ └── PrecisionAttribute.cs │ │ │ ├── SqlQueryable │ │ │ │ └── GroupByQueryable │ │ │ │ │ └── INetSqlGrouping.cs │ │ │ ├── IQueryParameters.cs │ │ │ ├── IUnitOfWork.cs │ │ │ ├── Pagination │ │ │ │ └── Sort.cs │ │ │ └── IDatabaseCreateEvents.cs │ │ └── Data.Core │ │ │ ├── DbConstants.cs │ │ │ ├── Entities │ │ │ ├── ColumnDescriptorCollection.cs │ │ │ └── Entity.cs │ │ │ ├── SqlQueryable │ │ │ └── Internal │ │ │ │ └── GroupByJoinDescriptor.cs │ │ │ └── Data.Core.csproj │ ├── Extend │ │ └── Data.Query │ │ │ ├── QuerySortModel.cs │ │ │ ├── QueryPagingModel.cs │ │ │ └── Data.Query.csproj │ └── Db │ │ ├── Data.SQLite │ │ ├── GuidTypeHandler.cs │ │ └── Data.SQLite.csproj │ │ ├── Data.PostgreSQL │ │ └── Data.PostgreSQL.csproj │ │ ├── Data.SqlServer │ │ └── Data.SqlServer.csproj │ │ └── Data.MySql │ │ └── Data.MySql.csproj │ ├── Quartz │ ├── Quartz.Abstractions │ │ ├── IQuartzModuleCollection.cs │ │ ├── QuartzSerializerType.cs │ │ ├── TaskExecutionContext.cs │ │ ├── QuartzTaskDescriptor.cs │ │ ├── ITask.cs │ │ ├── QuartzProvider.cs │ │ ├── ITaskExecutionContext.cs │ │ ├── QuartzConfigChangedEvent.cs │ │ └── QuartzModuleDescriptor.cs │ └── Quartz.Core │ │ ├── QuartzModuleCollection.cs │ │ └── JobFactory.cs │ ├── Utils │ ├── Utils.Core │ │ ├── Attributes │ │ │ └── IgnorePropertyAttribute.cs │ │ ├── Models │ │ │ ├── SortUpdateModel.cs │ │ │ ├── CoordinateModel.cs │ │ │ └── SortOptionModel.cs │ │ ├── Interfaces │ │ │ └── IAppShutdownHandler.cs │ │ ├── Enums │ │ │ ├── Sex.cs │ │ │ ├── Whether.cs │ │ │ ├── FileAccessMode.cs │ │ │ └── HttpMethod.cs │ │ ├── Result │ │ │ ├── ExcelExportResultModel.cs │ │ │ ├── ChartDataResultModel.cs │ │ │ ├── QueryResultModel.cs │ │ │ └── IResultModel.cs │ │ ├── Files │ │ │ └── FileSizeUnit.cs │ │ └── Extensions │ │ │ ├── ArrayExtensions.cs │ │ │ └── GuidExtensions.cs │ └── Utils.Mvc │ │ ├── Extensions │ │ └── HttpRequestExtensions.cs │ │ └── Utils.Mvc.csproj │ ├── OSS │ ├── OSS.Qiniu.SDK │ │ ├── Storage │ │ │ ├── UploadProgressHandler.cs │ │ │ ├── QiniuException.cs │ │ │ └── UploadController.cs │ │ ├── OSS.Qiniu.SDK.csproj │ │ ├── QiniuCSharpSDK.cs │ │ └── Util │ │ │ └── Mac.cs │ ├── OSS.Minio │ │ └── OSS.Minio.csproj │ ├── OSS.Aliyun │ │ └── OSS.Aliyun.csproj │ ├── OSS.Abstractions │ │ ├── OSS.Abstractions.csproj │ │ ├── OSSProvider.cs │ │ ├── AliyunConfig.cs │ │ └── OSSConfig.cs │ ├── OSS.Integration │ │ └── OSS.Integration.csproj │ ├── OSS.Qiniu │ │ └── OSS.Qiniu.csproj │ └── OSS.Local │ │ └── OSS.Local.csproj │ ├── Auth │ ├── Auth.Web │ │ ├── PermissionTreeModel.cs │ │ ├── Attributes │ │ │ ├── CommonAttribute.cs │ │ │ └── DisableAuditingAttribute.cs │ │ ├── ApiControllerAbstract.cs │ │ ├── DefaultTenantResolver.cs │ │ └── IAuditingHandler.cs │ ├── Auth.Abstractions │ │ ├── ISingleAccountLoginHandler.cs │ │ ├── LoginModels │ │ │ ├── CustomLoginModel.cs │ │ │ ├── VerifyCodeModel.cs │ │ │ ├── PhoneVerifyCodeSendModel.cs │ │ │ ├── EmailLoginModel.cs │ │ │ └── UserNameLoginModel.cs │ │ ├── ITenantResolver.cs │ │ ├── Providers │ │ │ └── ILoginLogProvider.cs │ │ ├── IPermissionValidateHandler.cs │ │ ├── LoginHandlers │ │ │ ├── IEmailLoginHandler.cs │ │ │ ├── IPhoneLoginHandler.cs │ │ │ ├── ICustomLoginHandler.cs │ │ │ ├── IUserNameLoginHandler.cs │ │ │ └── IUserNameOrEmailLoginHandler.cs │ │ ├── ILoginClaimsExtendProvider.cs │ │ ├── ILoginHandler.cs │ │ ├── ILoginInfoDetailsBuilder.cs │ │ ├── Auth.Abstractions.csproj │ │ ├── PasswordHandler │ │ │ └── IPasswordHandler.cs │ │ └── AccountType.cs │ └── Auth.Jwt │ │ └── JwtTokenModel.cs │ ├── Module │ ├── Module.Abstractions │ │ ├── IModuleCollection.cs │ │ ├── IModuleServicesConfigurator.cs │ │ ├── IModuleAssemblyDescriptor.cs │ │ └── ModuleEnumDescriptor.cs │ ├── Module.GenericHost │ │ ├── ModuleAssemblyDescriptor.cs │ │ └── Module.GenericHost.csproj │ └── Module.AspNetCore │ │ ├── ModuleAssemblyDescriptor.cs │ │ └── Module.AspNetCore.csproj │ ├── Excel │ ├── Excel.Abstractions │ │ ├── ExcelProvider.cs │ │ ├── ExcelConfig.cs │ │ ├── IExcelHandler.cs │ │ ├── Excel.Abstractions.csproj │ │ └── IExcelExportHandler.cs │ ├── Excel.NPOI │ │ └── Excel.NPOI.csproj │ ├── Excel.Aspose │ │ └── Excel.Aspose.csproj │ ├── Excel.EPPlus │ │ ├── EPPlusExcelHandler.cs │ │ └── Excel.EPPlus.csproj │ └── Excel.Integration │ │ └── Excel.Integration.csproj │ ├── Mapper │ └── Mapper.AutoMapper │ │ ├── IMapperConfig.cs │ │ └── MapperConfigurationExpression.cs │ ├── MQ │ └── MQ.RabbitMQ │ │ ├── DefaultExchange.cs │ │ └── Consumer.cs │ ├── Cache │ ├── Cache.Abstractions │ │ ├── CacheProvider.cs │ │ ├── CacheKeyDescriptor.cs │ │ └── Cache.Abstractions.csproj │ └── Cache.Integration │ │ └── Cache.Integration.csproj │ ├── Validation │ └── Validation.Abstractions │ │ ├── IValidateResultFormatHandler.cs │ │ └── Validation.Abstractions.csproj │ └── Logging │ ├── Logging.Serilog │ └── HostBuilderExtensions.cs │ └── Logging.Serilog.GenericHost │ └── GenericHostBuilderExtensions.cs ├── img ├── qq.jpg ├── airpay.jpg ├── code.png ├── logo.png ├── wechat.jpg ├── wechat_group.png ├── 20201108235810.png ├── 20201108235849.png ├── 20201108235914.png └── 20201108235933.png └── docs └── NetModular生态.xmind /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sql linguist-language=C# 2 | -------------------------------------------------------------------------------- /test/Host/Host.Generic.Tests/config/cache.Development.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /img/qq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/qq.jpg -------------------------------------------------------------------------------- /img/airpay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/airpay.jpg -------------------------------------------------------------------------------- /img/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/code.png -------------------------------------------------------------------------------- /img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/logo.png -------------------------------------------------------------------------------- /img/wechat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/wechat.jpg -------------------------------------------------------------------------------- /img/wechat_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/wechat_group.png -------------------------------------------------------------------------------- /docs/NetModular生态.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/docs/NetModular生态.xmind -------------------------------------------------------------------------------- /img/20201108235810.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/20201108235810.png -------------------------------------------------------------------------------- /img/20201108235849.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/20201108235849.png -------------------------------------------------------------------------------- /img/20201108235914.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/20201108235914.png -------------------------------------------------------------------------------- /img/20201108235933.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/img/20201108235933.png -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/store/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | namespaced: true, 3 | state: {} 4 | } 5 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/script/npm_update.ps1: -------------------------------------------------------------------------------- 1 | cd ../ 2 | npm --registry https://registry.npmjs.org/ update 3 | pause -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/script/npm_install.ps1: -------------------------------------------------------------------------------- 1 | cd ../ 2 | npm --registry https://registry.npmjs.org/ install 3 | pause -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/script/npm_publish.ps1: -------------------------------------------------------------------------------- 1 | cd ../ 2 | npm --registry https://registry.npmjs.org/ publish 3 | pause -------------------------------------------------------------------------------- /src/Framework/Host/Host.Api/Class1.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Host.Api 2 | { 3 | public class Class1 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "semi": false, 4 | "singleQuote": true, 5 | "printWidth": 200 6 | } 7 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/main.js: -------------------------------------------------------------------------------- 1 | import WebHost from './index' 2 | import config from './config' 3 | 4 | // 启动 5 | WebHost.start(config) 6 | -------------------------------------------------------------------------------- /test/Pdf/Pdf.iText.Tests/pdfs/pH水质自动分析仪技术要求.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/test/Pdf/Pdf.iText.Tests/pdfs/pH水质自动分析仪技术要求.pdf -------------------------------------------------------------------------------- /test/Host/Host.Generic.Tests/config/cache.json: -------------------------------------------------------------------------------- 1 | { 2 | // 0、MemoryCache 1、Redis 3 | "Mode": 0, 4 | "Redis": { 5 | "ConnectionString": "wsl" 6 | } 7 | } -------------------------------------------------------------------------------- /test/Pdf/Pdf.iText.Tests/pdfs/再生铜、铝、铅、锌工业污染物排放标准.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamoldli/NetModular/HEAD/test/Pdf/Pdf.iText.Tests/pdfs/再生铜、铝、铅、锌工业污染物排放标准.pdf -------------------------------------------------------------------------------- /src/Admin/WebHost/_modules/00_Admin/_module.json: -------------------------------------------------------------------------------- 1 | {"Id": "00","Name":"权限管理","Code":"Admin","Icon":"permission","Version":"9.0.6","Description":"权限管理模块用于身份认证以及授权等功能"} 2 | -------------------------------------------------------------------------------- /test/Utils/Utils.Core.Tests/Log/ILog.cs: -------------------------------------------------------------------------------- 1 | namespace Utils.Core.Tests.Log 2 | { 3 | public interface ILog 4 | { 5 | string Debug(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Module/ModuleEntity.Extend.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Module.Admin.Domain.Module 2 | { 3 | public partial class ModuleEntity 4 | { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /src/Admin/WebHost/_modules/00_Admin/InitData/AccountRole.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "AccountId": "39F08CFD-8E0D-771B-A2F3-2639A62CA2FA", 4 | "RoleId": "39F08CFD-8DD0-BB54-4544-C2DC43C6CA38" 5 | } 6 | ] -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/cache/index/cols.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | name: 'name', 4 | label: '键名' 5 | }, 6 | { 7 | name: 'desc', 8 | label: '说明' 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@vue/cli-plugin-babel/preset', 5 | { 6 | useBuiltIns: 'entry' 7 | } 8 | ] 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /src/Admin/WebHost/_modules/00_Admin/InitData/AccountConfig.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "AccountId": "39F08CFD-8E0D-771B-A2F3-2639A62CA2FA", 4 | "Skin": "pretty", 5 | "Theme": "default", 6 | "FontSize": "small" 7 | } 8 | ] -------------------------------------------------------------------------------- /src/Framework/Config/Config.Abstractions/IConfig.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Config.Abstractions 2 | { 3 | /// 4 | /// 配置接口,所有配置类都要继承该接口 5 | /// 6 | public interface IConfig 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Framework/Pdf/Pdf.Abstractions/PdfProvider.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Pdf.Abstractions 2 | { 3 | /// 4 | /// PDF提供器 5 | /// 6 | public enum PdfProvider 7 | { 8 | iText 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Entities/IEntity.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace NetModular.Lib.Data.Abstractions.Entities 3 | { 4 | /// 5 | /// 实体 6 | /// 7 | public interface IEntity 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/api/components/mime.js: -------------------------------------------------------------------------------- 1 | import module from '../../module' 2 | 3 | export default name => { 4 | const root = `${module.code}/${name}/` 5 | const crud = $http.crud(root) 6 | 7 | return { 8 | ...crud 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/module.js: -------------------------------------------------------------------------------- 1 | /** 模块信息 */ 2 | const pack = require('../package.json') 3 | 4 | export default { 5 | id: pack.id, 6 | name: pack.title, 7 | code: pack.code, 8 | version: pack.version, 9 | description: pack.description 10 | } 11 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Abstractions/IQuartzModuleCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace NetModular.Lib.Quartz.Abstractions 4 | { 5 | public interface IQuartzModuleCollection : IList 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/Host/Host.Generic.Tests/config/logging.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Serilog": { 3 | "MinimumLevel": { 4 | "Default": "Debug", 5 | "Override": { 6 | "Microsoft": "Debug", 7 | "System": "Debug" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /test/Host/Host.Generic.Tests/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Host.Generic.Tests": { 4 | "commandName": "Project", 5 | "environmentVariables": { 6 | "DOTNET_ENVIRONMENT": "Development" 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Mime/Models/MimeQueryModel.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Query; 2 | 3 | namespace NetModular.Module.Admin.Domain.Mime.Models 4 | { 5 | public class MimeQueryModel : QueryModel 6 | { 7 | public string Ext { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/Data/Data.Common/Repository/ICategoryRepository.cs: -------------------------------------------------------------------------------- 1 | using Data.Common.Domain; 2 | using NetModular.Lib.Data.Abstractions; 3 | 4 | namespace Data.Common.Repository 5 | { 6 | public interface ICategoryRepository : IRepository 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/ModuleService/ViewModels/ModuleSyncModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Module.Admin.Application.ModuleService.ViewModels 2 | { 3 | /// 4 | /// 模块同步模型 5 | /// 6 | public class ModuleSyncModel 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/components/role-select/index.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/Admin/Web/ModuleController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using NetModular.Lib.Auth.Web; 3 | 4 | namespace NetModular.Module.Admin.Web 5 | { 6 | [Area("Admin")] 7 | public abstract class ModuleController : ControllerAbstract 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Framework/Config/Config.Abstractions/ConfigCollection.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Utils.Core.Abstracts; 2 | 3 | namespace NetModular.Lib.Config.Abstractions 4 | { 5 | public class ConfigCollection : CollectionAbstract, IConfigCollection 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/components/module-select/index.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/routes/index.js: -------------------------------------------------------------------------------- 1 | import loadRoutes from 'netmodular-ui/packages/utils/load-routes' 2 | const requireComponent = require.context('../views', true, /\page.js$/) 3 | export default loadRoutes(requireComponent.keys().map(fileName => requireComponent(fileName).route)) 4 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/components/loginmode-select/index.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/mime/index/cols.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | name: 'id', 4 | label: '编号', 5 | width: 250, 6 | show: false 7 | }, 8 | { 9 | name: 'ext', 10 | label: '扩展名' 11 | }, 12 | { 13 | name: 'value', 14 | label: '值' 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src/Admin/WebHost/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Host.Web; 3 | 4 | namespace NetModular.Module.Admin.WebHost; 5 | 6 | public class Program 7 | { 8 | public static async Task Main(string[] args) 9 | { 10 | await new HostBuilder().RunAsync(args); 11 | } 12 | } -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Enums/JoinType.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Data.Abstractions.Enums 2 | { 3 | /// 4 | /// 连接类型 5 | /// 6 | public enum JoinType 7 | { 8 | UnKnown, 9 | Left, 10 | Inner, 11 | Right 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Utils/Utils.Core.Tests/Log/TextLog.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Utils.Core.Attributes; 2 | 3 | namespace Utils.Core.Tests.Log 4 | { 5 | [Singleton] 6 | public class TextLog : ILog 7 | { 8 | public string Debug() 9 | { 10 | return "TextLog"; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Tenant/ITenantRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Domain.Tenant 4 | { 5 | /// 6 | /// 租户仓储 7 | /// 8 | public interface ITenantRepository : IRepository 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/WebHost/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WebHost": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "launchUrl": "swagger", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Framework/Config/Config.Abstractions/IConfigCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace NetModular.Lib.Config.Abstractions 4 | { 5 | /// 6 | /// 配置集合 7 | /// 8 | public interface IConfigCollection : IList 9 | { 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Abstractions/QuartzSerializerType.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Quartz.Abstractions 4 | { 5 | public enum QuartzSerializerType 6 | { 7 | [Description("JSON")] 8 | Json, 9 | [Description("XML")] 10 | Xml 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Admin/WebHost/_modules/00_Admin/InitData/Module.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Id": "39F498A8-AE7B-049F-C78A-E16941E70FC5", 4 | "Number": 0, 5 | "Name": "权限管理", 6 | "Code": "Admin", 7 | "Icon": "permission", 8 | "Version": "2.1.2", 9 | "Remarks": "权限管理模块用于身份认证以及授权等功能", 10 | "ApiRequestCount": 0 11 | } 12 | ] -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Attributes/KeyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Attributes 4 | { 5 | /// 6 | /// 主键 7 | /// 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class KeyAttribute : Attribute 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Attributes/IgnorePropertyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Utils.Core.Attributes 4 | { 5 | /// 6 | /// 忽略属性 7 | /// 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class IgnorePropertyAttribute : Attribute 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /test/Data/Data.Common/BlogDbContext.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | using NetModular.Lib.Data.Core; 3 | 4 | namespace Data.Common 5 | { 6 | public class BlogDbContext : DbContext 7 | { 8 | public BlogDbContext(IDbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Attributes/MaxAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Attributes 4 | { 5 | /// 6 | /// 最大长度 7 | /// 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class MaxAttribute : Attribute 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Role/Models/RoleQueryModel.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Query; 2 | 3 | namespace NetModular.Module.Admin.Domain.Role.Models 4 | { 5 | public class RoleQueryModel : QueryModel 6 | { 7 | /// 8 | /// 名称 9 | /// 10 | public string Name { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.defaultFormatter": "esbenp.prettier-vscode", 3 | "editor.formatOnPaste": true, 4 | "editor.formatOnSave": true, 5 | "editor.formatOnType": true, 6 | "editor.codeActionsOnSave": { 7 | "source.fixAll.tslint": "explicit", 8 | "source.fixAll.eslint": "explicit" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Entities/IColumnDescriptorCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Entities 4 | { 5 | /// 6 | /// 列信息集合 7 | /// 8 | public interface IColumnDescriptorCollection : IList 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Core/QuartzModuleCollection.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Quartz.Abstractions; 2 | using NetModular.Lib.Utils.Core.Abstracts; 3 | 4 | namespace NetModular.Lib.Quartz.Core 5 | { 6 | public class QuartzModuleCollection : CollectionAbstract, IQuartzModuleCollection 7 | { 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Attributes/NullableAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Attributes 4 | { 5 | /// 6 | /// 可空的 7 | /// 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class NullableAttribute : Attribute 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/Sql/AuditInfoSql.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL.Sql 2 | { 3 | public static class AuditInfoSql 4 | { 5 | /// 6 | /// 查询最近一周访问量 7 | /// 8 | public const string QueryLatestWeekPv = ""; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/home/page.js: -------------------------------------------------------------------------------- 1 | /** 页面信息 */ 2 | const page = new (function() { 3 | this.title = '首页' 4 | this.icon = 'home' 5 | this.name = 'home' 6 | this.path = '/admin/home' 7 | this.icon = 'home' 8 | })() 9 | 10 | export const route = { 11 | page, 12 | component: () => import('./index') 13 | } 14 | 15 | export default page 16 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Qiniu.SDK/Storage/UploadProgressHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Qiniu.Storage 2 | { 3 | /// 4 | /// 分片上传进度处理 5 | /// 6 | /// 已上传的字节数 7 | /// 文件总字节数 8 | public delegate void UploadProgressHandler(long uploadedBytes, long totalBytes); 9 | } 10 | -------------------------------------------------------------------------------- /test/Host/Host.Generic.Tests/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using NetModular.Lib.Host.Generic; 4 | 5 | namespace Host.Generic.Tests 6 | { 7 | class Program 8 | { 9 | static async Task Main(string[] args) 10 | { 11 | await new HostBuilder().Run(args); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/MimeService/ViewModels/MimeUpdateModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace NetModular.Module.Admin.Application.MimeService.ViewModels 4 | { 5 | public class MimeUpdateModel : MimeAddModel 6 | { 7 | [Required(ErrorMessage = "请选择数据")] 8 | public int Id { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Core/DbConstants.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Data.Core 2 | { 3 | /// 4 | /// 数据库相关常量 5 | /// 6 | internal static class DbConstants 7 | { 8 | /// 9 | /// 租户列名称 10 | /// 11 | public const string TENANT_COLUMN_NAME = "TenantId"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/Data/Data.SQLite.Tests/config/db.json: -------------------------------------------------------------------------------- 1 | { 2 | //是否开启日志 3 | "Logging": false, 4 | //数据库类型 0、SqlServer 1、MySql 2、SQLite 3、PostgreSQL 5 | "Dialect": 2, 6 | //是否创建数据库和表 7 | "CreateDatabase": true, 8 | //模块列表 9 | "Modules": [ 10 | { 11 | //模块名称 12 | "Name": "Blog", 13 | //数据库名称 14 | "Database": "Nm_Blog" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/SqlQueryable/GroupByQueryable/INetSqlGrouping.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Data.Abstractions.SqlQueryable.GroupByQueryable 2 | { 3 | /// 4 | /// 分组查询对象 5 | /// 6 | public interface INetSqlGrouping 7 | { 8 | TKey Key { get; } 9 | 10 | long Count(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Abstractions/TaskExecutionContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Quartz; 3 | 4 | namespace NetModular.Lib.Quartz.Abstractions 5 | { 6 | public class TaskExecutionContext : ITaskExecutionContext 7 | { 8 | public Guid JobId { get; set; } 9 | 10 | public IJobExecutionContext JobExecutionContext { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Web/PermissionTreeModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Auth.Web 2 | { 3 | /// 4 | /// 权限树模型 5 | /// 6 | public class PermissionTreeModel 7 | { 8 | public string Label { get; set; } 9 | 10 | public string Code { get; set; } 11 | 12 | public bool IsPermission { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/FileRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class FileRepository : SqlServer.FileRepository 6 | { 7 | public FileRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/MimeRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class MimeRepository : SqlServer.MimeRepository 6 | { 7 | public MimeRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/FileRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class FileRepository : SqlServer.FileRepository 6 | { 7 | public FileRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/MimeRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class MimeRepository : SqlServer.MimeRepository 6 | { 7 | public MimeRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Entities/ITenant.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Entities 4 | { 5 | /// 6 | /// 租户 7 | /// 8 | public interface ITenant 9 | { 10 | /// 11 | /// 租户编号 12 | /// 13 | Guid? TenantId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/RoleService/ViewModels/RoleUpdateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace NetModular.Module.Admin.Application.RoleService.ViewModels 5 | { 6 | public class RoleUpdateModel : RoleAddModel 7 | { 8 | [Required(ErrorMessage = "请选择角色")] 9 | public Guid Id { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/ConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class ConfigRepository : SqlServer.ConfigRepository 6 | { 7 | public ConfigRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/MenuRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class MenuRepository : SqlServer.MenuRepository 6 | { 7 | public MenuRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/ModuleRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class ModuleRepository : SqlServer.ModuleRepository 6 | { 7 | public ModuleRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/RoleRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class RoleRepository : SqlServer.RoleRepository 6 | { 7 | public RoleRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/TenantRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class TenantRepository : SqlServer.TenantRepository 6 | { 7 | public TenantRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/MenuRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class MenuRepository : SqlServer.MenuRepository 6 | { 7 | public MenuRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/RoleRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class RoleRepository : SqlServer.RoleRepository 6 | { 7 | public RoleRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/FileRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class FileRepository : SqlServer.FileRepository 6 | { 7 | public FileRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/MimeRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class MimeRepository : SqlServer.MimeRepository 6 | { 7 | public MimeRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/ConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class ConfigRepository : SqlServer.ConfigRepository 6 | { 7 | public ConfigRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/ModuleRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class ModuleRepository : SqlServer.ModuleRepository 6 | { 7 | public ModuleRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/TenantRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class TenantRepository : SqlServer.TenantRepository 6 | { 7 | public TenantRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Web/Attributes/CommonAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Auth.Web.Attributes 4 | { 5 | /// 6 | /// 通用权限(只要登录即可访问,不需要授权) 7 | /// 8 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] 9 | public class CommonAttribute : Attribute 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Web/Attributes/DisableAuditingAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Auth.Web.Attributes 4 | { 5 | /// 6 | /// 禁用审计功能 7 | /// 8 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property)] 9 | public class DisableAuditingAttribute : Attribute 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Attributes/PrefixIgnoreAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Attributes 4 | { 5 | /// 6 | /// 忽略表前缀,如果设置了表前缀,附加了该特性的表不会设置表前缀 7 | /// 8 | [AttributeUsage(AttributeTargets.Class, Inherited = false)] 9 | public class PrefixIgnoreAttribute : Attribute 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Config/ConfigEntity.Extend.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions.Attributes; 2 | 3 | namespace NetModular.Module.Admin.Domain.Config 4 | { 5 | public partial class ConfigEntity 6 | { 7 | /// 8 | /// 类型名称 9 | /// 10 | [Ignore] 11 | public string TypeName => Type.ToDescription(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/AdminDbContext.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | using NetModular.Lib.Data.Core; 3 | 4 | namespace NetModular.Module.Admin.Infrastructure.Repositories 5 | { 6 | public class AdminDbContext : DbContext 7 | { 8 | public AdminDbContext(IDbContextOptions options) : base(options) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/AccountRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class AccountRepository : SqlServer.AccountRepository 6 | { 7 | public AccountRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/LoginLogRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class LoginLogRepository : SqlServer.LoginLogRepository 6 | { 7 | public LoginLogRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/RoleMenuRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class RoleMenuRepository : SqlServer.RoleMenuRepository 6 | { 7 | public RoleMenuRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/RolePageRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class RolePageRepository : SqlServer.RolePageRepository 6 | { 7 | public RolePageRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/ConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class ConfigRepository : SqlServer.ConfigRepository 6 | { 7 | public ConfigRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/MenuRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class MenuRepository : SqlServer.MenuRepository 6 | { 7 | public MenuRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/ModuleRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class ModuleRepository : SqlServer.ModuleRepository 6 | { 7 | public ModuleRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/RoleRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class RoleRepository : SqlServer.RoleRepository 6 | { 7 | public RoleRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/TenantRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class TenantRepository : SqlServer.TenantRepository 6 | { 7 | public TenantRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/AccountRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class AccountRepository : SqlServer.AccountRepository 6 | { 7 | public AccountRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/LoginLogRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class LoginLogRepository : SqlServer.LoginLogRepository 6 | { 7 | public LoginLogRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/RoleMenuRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class RoleMenuRepository : SqlServer.RoleMenuRepository 6 | { 7 | public RoleMenuRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/RolePageRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class RolePageRepository : SqlServer.RolePageRepository 6 | { 7 | public RolePageRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/icon/page.js: -------------------------------------------------------------------------------- 1 | /** 页面信息 */ 2 | const page = new (function() { 3 | this.title = '图标预览' 4 | this.icon = 'icon' 5 | this.name = 'admin_icon' 6 | this.path = '/admin/icon' 7 | })() 8 | 9 | /** 路由信息 */ 10 | export const route = { 11 | page, 12 | component: () => import(/* webpackChunkName: "admin.icon" */ './index') 13 | } 14 | 15 | export default page 16 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/FileOwnerRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class FileOwnerRepository : SqlServer.FileOwnerRepository 6 | { 7 | public FileOwnerRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/FileOwnerRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class FileOwnerRepository : SqlServer.FileOwnerRepository 6 | { 7 | public FileOwnerRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/RoleButtonRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class RoleButtonRepository : SqlServer.RoleButtonRepository 6 | { 7 | public RoleButtonRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/AccountRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class AccountRepository : SqlServer.AccountRepository 6 | { 7 | public AccountRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/LoginLogRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class LoginLogRepository : SqlServer.LoginLogRepository 6 | { 7 | public LoginLogRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/RoleMenuRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class RoleMenuRepository : SqlServer.RoleMenuRepository 6 | { 7 | public RoleMenuRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/RolePageRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class RolePageRepository : SqlServer.RolePageRepository 6 | { 7 | public RolePageRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/RoleButtonRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class RoleButtonRepository : SqlServer.RoleButtonRepository 6 | { 7 | public RoleButtonRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Attributes/IgnoreAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Attributes 4 | { 5 | /// 6 | /// 忽略属性,不创建实体对应的表或者实体属性不在表中映射列 7 | /// 8 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, Inherited = false)] 9 | public class IgnoreAttribute : Attribute 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Entities/IEntitySqlBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Data.Abstractions.Entities 2 | { 3 | /// 4 | /// 实体Sql生成器 5 | /// 6 | public interface IEntitySqlBuilder 7 | { 8 | /// 9 | /// 生成 10 | /// 11 | /// 12 | EntitySql Build(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/AccountRoleRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class AccountRoleRepository : SqlServer.AccountRoleRepository 6 | { 7 | public AccountRoleRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/FileOwnerRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class FileOwnerRepository : SqlServer.FileOwnerRepository 6 | { 7 | public FileOwnerRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Framework/Module/Module.Abstractions/IModuleCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace NetModular.Lib.Module.Abstractions 4 | { 5 | /// 6 | /// 模块集合 7 | /// 8 | public interface IModuleCollection : IList 9 | { 10 | /// 11 | /// 加载 12 | /// 13 | void Load(); 14 | } 15 | } -------------------------------------------------------------------------------- /src/Admin/Library/Domain/AuditInfo/AuditInfoEntity.Extend.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions.Attributes; 2 | 3 | namespace NetModular.Module.Admin.Domain.AuditInfo 4 | { 5 | public partial class AuditInfoEntity 6 | { 7 | /// 8 | /// 平台名称 9 | /// 10 | [Ignore] 11 | public string PlatformName => Platform.ToDescription(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Tenant/TenantEntity.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Core.Entities.Extend; 2 | 3 | namespace NetModular.Module.Admin.Domain.Tenant 4 | { 5 | /// 6 | /// 租户信息 7 | /// 8 | public class TenantEntity : EntityBase 9 | { 10 | /// 11 | /// 租户名称 12 | /// 13 | public string Name { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/AccountConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class AccountConfigRepository : SqlServer.AccountConfigRepository 6 | { 7 | public AccountConfigRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/RoleButtonRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class RoleButtonRepository : SqlServer.RoleButtonRepository 6 | { 7 | public RoleButtonRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/AccountConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class AccountConfigRepository : SqlServer.AccountConfigRepository 6 | { 7 | public AccountConfigRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/AccountRoleRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class AccountRoleRepository : SqlServer.AccountRoleRepository 6 | { 7 | public AccountRoleRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Framework/Config/Config.Abstractions/ConfigType.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Config.Abstractions 2 | { 3 | /// 4 | /// 配置类型 5 | /// 6 | public enum ConfigType 7 | { 8 | /// 9 | /// 库配置 10 | /// 11 | Library, 12 | /// 13 | /// 模块配置 14 | /// 15 | Module 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Enums/SortType.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Data.Abstractions.Enums 2 | { 3 | /// 4 | /// 排序规则 5 | /// 6 | public enum SortType 7 | { 8 | /// 9 | /// 升序 10 | /// 11 | Asc, 12 | /// 13 | /// 降序 14 | /// 15 | Desc 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/RolePermissionRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class RolePermissionRepository : SqlServer.RolePermissionRepository 6 | { 7 | public RolePermissionRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/AccountRoleRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class AccountRoleRepository : SqlServer.AccountRoleRepository 6 | { 7 | public AccountRoleRepository(IDbContext dbContext) : base(dbContext) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/RolePermissionRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class RolePermissionRepository : SqlServer.RolePermissionRepository 6 | { 7 | public RolePermissionRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/api/components/cache.js: -------------------------------------------------------------------------------- 1 | import module from '../../module' 2 | 3 | export default name => { 4 | const root = `${module.code}/${name}/` 5 | const crud = $http.crud(root) 6 | const urls = { 7 | clear: root + 'Clear' 8 | } 9 | const clear = prefix => { 10 | return $http.delete(urls.clear, { prefix }) 11 | } 12 | return { 13 | ...crud, 14 | clear 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Minio/OSS.Minio.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Framework/Pdf/Pdf.Abstractions/PdfConfig.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Pdf.Abstractions 2 | { 3 | public class PdfConfig 4 | { 5 | /// 6 | /// 提供器 7 | /// 8 | public PdfProvider Provider { get; set; } 9 | 10 | /// 11 | /// 操作时产生的临时文件存储根路径 12 | /// 13 | public string TempPath { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/AccountAuthInfoRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql 4 | { 5 | public class AccountAuthInfoRepository : SqlServer.AccountAuthInfoRepository 6 | { 7 | public AccountAuthInfoRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/AccountConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class AccountConfigRepository : SqlServer.AccountConfigRepository 6 | { 7 | public AccountConfigRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SQLite/AccountAuthInfoRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SQLite 4 | { 5 | public class AccountAuthInfoRepository : SqlServer.AccountAuthInfoRepository 6 | { 7 | public AccountAuthInfoRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/LoginLog/LoginLogEntity.Extend.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions.Attributes; 2 | 3 | namespace NetModular.Module.Admin.Domain.LoginLog 4 | { 5 | public partial class LoginLogEntity 6 | { 7 | [Ignore] 8 | public string PlatformName => Platform.ToDescription(); 9 | 10 | [Ignore] 11 | public string LoginModeName => LoginMode.ToDescription(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/RolePermissionRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class RolePermissionRepository : SqlServer.RolePermissionRepository 6 | { 7 | public RolePermissionRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Models/SortUpdateModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace NetModular.Lib.Utils.Core.Models 4 | { 5 | /// 6 | /// 排序更新模型 7 | /// 8 | public class SortUpdateModel 9 | { 10 | /// 11 | /// 选项列表 12 | /// 13 | public IList> Options { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/PostgreSQL/AccountAuthInfoRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure.Repositories.PostgreSQL 4 | { 5 | public class AccountAuthInfoRepository : SqlServer.AccountAuthInfoRepository 6 | { 7 | public AccountAuthInfoRepository(IDbContext context) : base(context) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Core/Entities/ColumnDescriptorCollection.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions.Entities; 2 | using NetModular.Lib.Utils.Core.Abstracts; 3 | 4 | namespace NetModular.Lib.Data.Core.Entities 5 | { 6 | /// 7 | /// 列信息集合 8 | /// 9 | public class ColumnDescriptorCollection : CollectionAbstract, IColumnDescriptorCollection 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Aliyun/OSS.Aliyun.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Interfaces/IAppShutdownHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace NetModular.Lib.Utils.Core.Interfaces 4 | { 5 | /// 6 | /// 应用关闭处理接口 7 | /// 8 | public interface IAppShutdownHandler 9 | { 10 | /// 11 | /// 处理 12 | /// 13 | /// 14 | Task Handle(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/Data/Data.Common/Repository/CategoryRepository.cs: -------------------------------------------------------------------------------- 1 | using Data.Common.Domain; 2 | using NetModular.Lib.Data.Abstractions; 3 | using NetModular.Lib.Data.Core; 4 | 5 | namespace Data.Common.Repository 6 | { 7 | public class CategoryRepository : RepositoryAbstract, ICategoryRepository 8 | { 9 | public CategoryRepository(IDbContext context) : base(context) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/api/components/module.js: -------------------------------------------------------------------------------- 1 | import module from '../../module' 2 | 3 | export default name => { 4 | const root = `${module.code}/${name}/` 5 | const crud = $http.crud(root) 6 | const urls = { 7 | select: root + 'select' 8 | } 9 | 10 | /** 11 | * @description 下拉框 12 | */ 13 | const select = () => { 14 | return $http.get(urls.select) 15 | } 16 | 17 | return { ...crud, select } 18 | } 19 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/components/index.js: -------------------------------------------------------------------------------- 1 | import library from 'netmodular-ui/packages/library' 2 | let components = [] 3 | const requireComponent = require.context('./', true, /index\.vue$/) 4 | requireComponent.keys().map(fileName => { 5 | components.push({ 6 | name: `${library.prefix.toLowerCase()}-${fileName.split('/')[1]}`, 7 | component: requireComponent(fileName).default 8 | }) 9 | }) 10 | export default components 11 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.Abstractions/ExcelProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Excel.Abstractions 4 | { 5 | /// 6 | /// Excel操作库 7 | /// 8 | public enum ExcelProvider 9 | { 10 | [Description("EPPlus")] 11 | EPPlus, 12 | [Description("NPOI")] 13 | NPOI, 14 | [Description("OpenXml")] 15 | OpenXml 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Framework/Host/Host.Web/IStartLogoProvider.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Host.Web.Options; 2 | 3 | namespace NetModular.Lib.Host.Web 4 | { 5 | /// 6 | /// 启动logo提供器 7 | /// 8 | public interface IStartLogoProvider 9 | { 10 | /// 11 | /// 显示 12 | /// 13 | /// 14 | void Show(HostOptions options); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Framework/Mapper/Mapper.AutoMapper/IMapperConfig.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | 3 | namespace NetModular.Lib.Mapper.AutoMapper 4 | { 5 | /// 6 | /// 对象映射绑定 7 | /// 8 | public interface IMapperConfig 9 | { 10 | /// 11 | /// 绑定 12 | /// 13 | /// 14 | void Bind(IMapperConfigurationExpression cfg); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/Data/Data.Common/Domain/CategoryEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Data.Abstractions.Entities; 3 | using NetModular.Lib.Data.Core.Entities; 4 | 5 | namespace Data.Common.Domain 6 | { 7 | public class CategoryEntity : Entity, ITenant 8 | { 9 | public Guid? TenantId { get; set; } 10 | 11 | public string Name { get; set; } 12 | 13 | public int Count { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/MimeService/ViewModels/MimeAddModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace NetModular.Module.Admin.Application.MimeService.ViewModels 4 | { 5 | public class MimeAddModel 6 | { 7 | [Required(ErrorMessage = "请输入扩展名")] 8 | public string Ext { get; set; } 9 | 10 | [Required(ErrorMessage = "请输入值")] 11 | public string Value { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/config/index.js: -------------------------------------------------------------------------------- 1 | const isDev = process.env.NODE_ENV !== 'production' 2 | 3 | const config = { 4 | baseUrl: '../api/' 5 | /** 账户类型 */ 6 | // accountTypes: [ 7 | // { label: '管理员', value: 0 }, 8 | // { label: '企业', value: 2 }, 9 | // { label: '员工', value: 1 } 10 | // ] 11 | } 12 | 13 | // 开发模式 14 | if (isDev) { 15 | config.baseUrl = 'http://localhost:6220/api/' 16 | } 17 | 18 | export default config 19 | -------------------------------------------------------------------------------- /src/Framework/MQ/MQ.RabbitMQ/DefaultExchange.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.MQ.RabbitMQ 2 | { 3 | /// 4 | /// 默认交换器 5 | /// 6 | public class DefaultExchange 7 | { 8 | public const string Direct = "nm.direct"; 9 | 10 | public const string Fanout = "nm.fanout"; 11 | 12 | public const string Topic = "nm.topic"; 13 | 14 | public const string Headers = "nm.headers"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/Data/Data.Common/Data.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/RoleService/ViewModels/RoleAddModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace NetModular.Module.Admin.Application.RoleService.ViewModels 4 | { 5 | public class RoleAddModel 6 | { 7 | [Required(ErrorMessage = "请输入角色名称")] 8 | public string Name { get; set; } 9 | 10 | public string Remarks { get; set; } 11 | 12 | public int Sort { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/ISingleAccountLoginHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace NetModular.Lib.Auth.Abstractions 4 | { 5 | /// 6 | /// 单账户登录处理器 7 | /// 8 | public interface ISingleAccountLoginHandler 9 | { 10 | /// 11 | /// 验证账户是否已在别处登录 12 | /// 13 | /// 14 | Task Validate(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Framework/Host/Host.Api/Host.Api.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Config/Models/ConfigQueryModel.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Config.Abstractions; 2 | using NetModular.Lib.Data.Query; 3 | 4 | namespace NetModular.Module.Admin.Domain.Config.Models 5 | { 6 | public class ConfigQueryModel : QueryModel 7 | { 8 | public string Key { get; set; } 9 | 10 | /// 11 | /// 类型 12 | /// 13 | public ConfigType? Type { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: ['plugin:vue/essential', '@vue/prettier'], 7 | rules: { 8 | 'no-console': 'off', 9 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 10 | }, 11 | parserOptions: { 12 | parser: 'babel-eslint' 13 | }, 14 | globals: { 15 | $http: 'readonly', 16 | $api: 'readonly' 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/api/index.js: -------------------------------------------------------------------------------- 1 | import module from '../module' 2 | 3 | // 注册接口列表为window全局属性 4 | window.$api = {} 5 | 6 | let apis = {} 7 | const requireComponent = require.context('./components', true, /\.*\.js$/) 8 | requireComponent.keys().map(fileName => { 9 | const name = fileName.replace('./', '').replace('.js', '') 10 | const func = requireComponent(fileName).default 11 | apis[name] = func(name) 12 | }) 13 | $api[module.code] = apis 14 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.NPOI/Excel.NPOI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Web/ApiControllerAbstract.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using NetModular.Lib.Validation.Abstractions; 3 | 4 | namespace NetModular.Lib.Auth.Web 5 | { 6 | /// 7 | /// 公共接口抽象控制器 8 | /// 9 | [Route("api/v1/[controller]/[action]")] 10 | [ApiController] 11 | [ValidateResultFormat] 12 | public abstract class ApiControllerAbstract : ControllerBase 13 | { 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.Aspose/Excel.Aspose.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/MenuService/ViewModels/MenuUpdateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace NetModular.Module.Admin.Application.MenuService.ViewModels 5 | { 6 | /// 7 | /// 新增菜单 8 | /// 9 | public class MenuUpdateModel : MenuAddModel 10 | { 11 | //编号 12 | [Required(ErrorMessage = "请选择要编辑的菜单")] 13 | public Guid Id { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginModels/CustomLoginModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Auth.Abstractions.LoginModels 2 | { 3 | /// 4 | /// 自定义登录 5 | /// 6 | public class CustomLoginModel : LoginModel 7 | { 8 | public override LoginMode Mode => LoginMode.Custom; 9 | 10 | /// 11 | /// 登数Json数据 12 | /// 13 | public string JsonData { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Enums/Sex.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Utils.Core.Enums 4 | { 5 | /// 6 | /// 性别 7 | /// 8 | public enum Sex 9 | { 10 | /// 11 | /// 未知 12 | /// 13 | [Description("未知")] 14 | UnKnown = -1, 15 | [Description("男")] 16 | Boy, 17 | [Description("女")] 18 | Girl 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Models/CoordinateModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Utils.Core.Models 2 | { 3 | /// 4 | /// 坐标模型 5 | /// 6 | public class CoordinateModel 7 | { 8 | /// 9 | /// 经度 10 | /// 11 | public string Lng { get; set; } 12 | 13 | /// 14 | /// 纬度 15 | /// 16 | public string Lat { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Abstractions/QuartzTaskDescriptor.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Quartz.Abstractions 2 | { 3 | /// 4 | /// 任务描述信息 5 | /// 6 | public class QuartzTaskDescriptor 7 | { 8 | /// 9 | /// 名称 10 | /// 11 | public string Name { get; set; } 12 | 13 | /// 14 | /// 类名称 15 | /// 16 | public string Class { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginModels/VerifyCodeModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Auth.Abstractions.LoginModels 2 | { 3 | /// 4 | /// 验证码模型 5 | /// 6 | public class VerifyCodeModel 7 | { 8 | /// 9 | /// ID 10 | /// 11 | public string Id { get; set; } 12 | 13 | /// 14 | /// 验证码 15 | /// 16 | public string Code { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Host/Host.Web/Middleware/ExceptionHandleMiddlewareExtensions.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using Microsoft.AspNetCore.Builder; 4 | 5 | namespace NetModular.Lib.Host.Web.Middleware 6 | { 7 | public static class ExceptionHandleMiddlewareExtensions 8 | { 9 | public static IApplicationBuilder UseExceptionHandle(this IApplicationBuilder app) 10 | { 11 | app.UseMiddleware(); 12 | 13 | return app; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SqlServer/TenantRepository.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions; 2 | using NetModular.Lib.Data.Core; 3 | using NetModular.Module.Admin.Domain.Tenant; 4 | 5 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SqlServer 6 | { 7 | public class TenantRepository : RepositoryAbstract, ITenantRepository 8 | { 9 | public TenantRepository(IDbContext context) : base(context) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Admin/Web/Validators/AccountUpdateValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using NetModular.Module.Admin.Application.AccountService.ViewModels; 3 | 4 | namespace NetModular.Module.Admin.Web.Validators 5 | { 6 | public class AccountUpdateValidator : AbstractValidator 7 | { 8 | public AccountUpdateValidator() 9 | { 10 | RuleFor(x => x.Email).EmailAddress().When(x => x.Email.NotNull()).WithMessage("请输入正确的邮箱地址"); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Abstractions/ITask.cs: -------------------------------------------------------------------------------- 1 | using Quartz; 2 | using System.Threading.Tasks; 3 | 4 | namespace NetModular.Lib.Quartz.Abstractions 5 | { 6 | /// 7 | /// 任务接口 8 | /// 9 | public interface ITask : IJob 10 | { 11 | /// 12 | /// 执行方法 13 | /// 14 | /// 15 | /// 16 | Task Execute(ITaskExecutionContext context); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/FileOwner/IFileOwnerRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Data.Abstractions; 3 | 4 | namespace NetModular.Module.Admin.Domain.FileOwner 5 | { 6 | public interface IFileOwnerRepository : IRepository 7 | { 8 | /// 9 | /// 判断是否存在 10 | /// 11 | /// 12 | /// 13 | Task Exist(FileOwnerEntity entity); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.Abstractions/ExcelConfig.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Excel.Abstractions 2 | { 3 | /// 4 | /// Excel操作配置项 5 | /// 6 | public class ExcelConfig 7 | { 8 | /// 9 | /// Excel提供器 10 | /// 11 | public ExcelProvider Provider { get; set; } 12 | 13 | /// 14 | /// Excel操作时产生的临时文件存储根路径 15 | /// 16 | public string TempPath { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Module/Module.GenericHost/ModuleAssemblyDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using NetModular.Lib.Module.Abstractions; 3 | 4 | namespace NetModular.Lib.Module.GenericHost 5 | { 6 | public class ModuleAssemblyDescriptor : IModuleAssemblyDescriptor 7 | { 8 | public Assembly Application { get; set; } 9 | 10 | public Assembly Domain { get; set; } 11 | 12 | public Assembly Infrastructure { get; set; } 13 | public Assembly Quartz { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Framework/Config/Config.Abstractions/IConfigChangeEvent.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Config.Abstractions 2 | { 3 | /// 4 | /// 配置变更事件 5 | /// 6 | public interface IConfigChangeEvent where TConfig : IConfig 7 | { 8 | /// 9 | /// 变更事件 10 | /// 11 | /// 12 | /// 13 | void OnChanged(TConfig newConfig, TConfig oldConfig); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Abstractions/QuartzProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Quartz.Abstractions 4 | { 5 | public enum QuartzProvider 6 | { 7 | [Description("SqlServer")] 8 | SqlServer, 9 | [Description("MySqlConnector")] 10 | MySql, 11 | [Description("SQLite-Microsoft")] 12 | SQLite, 13 | [Description("OracleODP")] 14 | Oracle, 15 | [Description("Npgsql")] 16 | PostgreSQL 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/Utils/Utils.Core.Tests/BaseTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using NetModular.Lib.Utils.Core; 4 | 5 | namespace Utils.Core.Tests 6 | { 7 | public abstract class BaseTest 8 | { 9 | protected readonly IServiceProvider SP; 10 | 11 | protected BaseTest() 12 | { 13 | var service = new ServiceCollection(); 14 | service.AddNetModularServices(); 15 | SP = service.BuildServiceProvider(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Cache/Cache.Abstractions/CacheProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Cache.Abstractions 4 | { 5 | /// 6 | /// 缓存提供器 7 | /// 8 | public enum CacheProvider 9 | { 10 | /// 11 | /// 内存缓存 12 | /// 13 | [Description("内存缓存")] 14 | MemoryCache, 15 | /// 16 | /// Redis 17 | /// 18 | [Description("Redis")] 19 | Redis 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Framework/Data/Extend/Data.Query/QuerySortModel.cs: -------------------------------------------------------------------------------- 1 | 2 | using NetModular.Lib.Data.Abstractions.Enums; 3 | 4 | namespace NetModular.Lib.Data.Query 5 | { 6 | /// 7 | /// 查询排序模型 8 | /// 9 | public class QuerySortModel 10 | { 11 | /// 12 | /// 字段 13 | /// 14 | public string Field { get; set; } 15 | 16 | /// 17 | /// 排序类型 18 | /// 19 | public SortType Type { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/RoleService/ViewModels/RoleMenuBindModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | namespace NetModular.Module.Admin.Application.RoleService.ViewModels 6 | { 7 | public class RoleMenuBindModel 8 | { 9 | [Required(ErrorMessage = "请选择角色")] 10 | public Guid RoleId { get; set; } 11 | 12 | /// 13 | /// 菜单列表 14 | /// 15 | public List Menus { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Framework/Data/Db/Data.SQLite/GuidTypeHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Dapper; 3 | 4 | namespace NetModular.Lib.Data.SQLite 5 | { 6 | public class GuidTypeHandler : SqlMapper.TypeHandler 7 | { 8 | public override Guid Parse(object value) 9 | { 10 | return Guid.Parse(value.ToString()); 11 | } 12 | 13 | public override void SetValue(System.Data.IDbDataParameter parameter, Guid value) 14 | { 15 | parameter.Value = value.ToString(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Validation/Validation.Abstractions/IValidateResultFormatHandler.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Filters; 2 | 3 | namespace NetModular.Lib.Validation.Abstractions 4 | { 5 | /// 6 | /// 验证结果格式化器 7 | /// 8 | public interface IValidateResultFormatHandler 9 | { 10 | /// 11 | /// 格式化处理 12 | /// 13 | /// 14 | /// 15 | void Format(ResultExecutingContext context); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Admin/WebHost/_modules/00_Admin/InitData/Role.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Id": "39F08CFD-8DD0-BB54-4544-C2DC43C6CA38", 4 | "Name": "超级管理员", 5 | "Remarks": "超级管理员", 6 | "IsSpecified": 0, 7 | "CreatedTime": "2019-09-29 10:19:21", 8 | "CreatedBy": "00000000-0000-0000-0000-000000000000", 9 | "ModifiedTime": "2020-01-13 19:26:56", 10 | "ModifiedBy": "39F08CFD-8E0D-771B-A2F3-2639A62CA2FA", 11 | "Deleted": 0, 12 | "DeletedTime": "2019-09-29 10:19:21", 13 | "DeletedBy": "00000000-0000-0000-0000-000000000000" 14 | } 15 | ] -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/api/components/log.js: -------------------------------------------------------------------------------- 1 | import module from '../../module' 2 | 3 | export default name => { 4 | const root = `${module.code}/${name}/` 5 | const urls = { 6 | queryLogin: root + 'Login', 7 | exportLogin: root + 'LoginExport' 8 | } 9 | 10 | const queryLogin = params => { 11 | return $http.get(urls.queryLogin, params) 12 | } 13 | 14 | const exportLogin = params => { 15 | return $http.export(urls.exportLogin, params) 16 | } 17 | 18 | return { 19 | queryLogin, 20 | exportLogin 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.EPPlus/EPPlusExcelHandler.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Auth.Abstractions; 2 | using NetModular.Lib.Config.Abstractions; 3 | using NetModular.Lib.Excel.Abstractions; 4 | 5 | namespace NetModular.Lib.Excel.EPPlus 6 | { 7 | public class EPPlusExcelHandler : ExcelHandlerAbstract 8 | { 9 | public EPPlusExcelHandler(ILoginInfo loginInfo, IExcelExportHandler exportHandler, ExcelConfig config, IConfigProvider configProvider) : base(loginInfo, exportHandler, config, configProvider) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/ConfigService/ViewModels/ConfigUpdateModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using NetModular.Lib.Config.Abstractions; 3 | 4 | namespace NetModular.Module.Admin.Application.ConfigService.ViewModels 5 | { 6 | public class ConfigUpdateModel 7 | { 8 | [Required(ErrorMessage = "配置类编码不能为空")] 9 | public string Code { get; set; } 10 | 11 | public ConfigType Type { get; set; } 12 | 13 | [Required(ErrorMessage = "配置内容不能为空")] 14 | public string Json { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/AdminConfig.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Config.Abstractions; 2 | 3 | namespace NetModular.Module.Admin.Infrastructure 4 | { 5 | /// 6 | /// 权限管理配置项 7 | /// 8 | public class AdminConfig : IConfig 9 | { 10 | /// 11 | /// 启用登录日志 12 | /// 13 | public bool LoginLog { get; set; } 14 | 15 | /// 16 | /// 账户默认密码 17 | /// 18 | public string DefaultPassword { get; set; } = "123456"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/ITenantResolver.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Auth.Abstractions.LoginModels; 3 | 4 | namespace NetModular.Lib.Auth.Abstractions 5 | { 6 | /// 7 | /// 租户解析器接口 8 | /// 9 | public interface ITenantResolver 10 | { 11 | /// 12 | /// 解析租户ID 13 | /// 14 | /// 登录结果 15 | /// 16 | Task Resolve(LoginResultModel loginResultModel); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Abstractions/ITaskExecutionContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Quartz; 3 | 4 | namespace NetModular.Lib.Quartz.Abstractions 5 | { 6 | /// 7 | /// 任务执行上下文 8 | /// 9 | public interface ITaskExecutionContext 10 | { 11 | /// 12 | /// 任务编号 13 | /// 14 | Guid JobId { get; set; } 15 | 16 | /// 17 | /// Quartz的任务执行上下文 18 | /// 19 | IJobExecutionContext JobExecutionContext { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/Providers/ILoginLogProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Auth.Abstractions.LoginModels; 3 | 4 | namespace NetModular.Lib.Auth.Abstractions.Providers 5 | { 6 | /// 7 | /// 登录日志处理 8 | /// 9 | public interface ILoginLogProvider 10 | { 11 | /// 12 | /// 处理 13 | /// 14 | /// 登录结果 15 | /// 16 | Task Handle(LoginResultModel loginResult); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Web/DefaultTenantResolver.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Auth.Abstractions; 3 | using NetModular.Lib.Auth.Abstractions.LoginModels; 4 | using NetModular.Lib.Utils.Core.Attributes; 5 | 6 | namespace NetModular.Lib.Auth.Web 7 | { 8 | [Singleton] 9 | public class DefaultTenantResolver : ITenantResolver 10 | { 11 | public Task Resolve(LoginResultModel loginResultModel) 12 | { 13 | loginResultModel.TenantId = null; 14 | return Task.CompletedTask; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Admin/Web/Core/DefaultLoginClaimsExtendProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Security.Claims; 4 | using NetModular.Lib.Auth.Abstractions; 5 | using NetModular.Lib.Auth.Web; 6 | using NetModular.Lib.Utils.Core.Attributes; 7 | 8 | namespace NetModular.Module.Admin.Web.Core 9 | { 10 | [Singleton] 11 | internal class DefaultLoginClaimsExtendProvider : ILoginClaimsExtendProvider 12 | { 13 | public List GetExtendClaims(Guid accountId) 14 | { 15 | return null; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Qiniu.SDK/OSS.Qiniu.SDK.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/MySql/Sql/AuditInfoSql.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Module.Admin.Infrastructure.Repositories.MySql.Sql 2 | { 3 | public static class AuditInfoSql 4 | { 5 | /// 6 | /// 查询最近一周访问量 7 | /// 8 | public const string QueryLatestWeekPv = @"SELECT 9 | DATE_FORMAT(ExecutionTime, '%Y-%m-%d' ) `Key`, 10 | COUNT(0) `Value` 11 | FROM 12 | {0} 13 | WHERE 14 | ExecutionTime > DATE_FORMAT( DATE_ADD(NOW(), interval -6 day), '%Y-%m-%d' ) 15 | GROUP BY 16 | `Key` ORDER BY `Key`"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/IPermissionValidateHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using NetModular.Lib.Utils.Core.Enums; 4 | 5 | namespace NetModular.Lib.Auth.Abstractions 6 | { 7 | /// 8 | /// 权限验证处理接口 9 | /// 10 | public interface IPermissionValidateHandler 11 | { 12 | /// 13 | /// 验证 14 | /// 15 | /// 16 | Task Validate(IDictionary routeValues, HttpMethod httpMethod); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginHandlers/IEmailLoginHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Auth.Abstractions.LoginModels; 3 | 4 | namespace NetModular.Lib.Auth.Abstractions.LoginHandlers 5 | { 6 | /// 7 | /// 邮件登录处理 8 | /// 9 | public interface IEmailLoginHandler 10 | { 11 | /// 12 | /// 登录处理 13 | /// 14 | /// 15 | /// 16 | Task Handle(EmailLoginModel model); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginHandlers/IPhoneLoginHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Auth.Abstractions.LoginModels; 3 | 4 | namespace NetModular.Lib.Auth.Abstractions.LoginHandlers 5 | { 6 | /// 7 | /// 手机登录处理 8 | /// 9 | public interface IPhoneLoginHandler 10 | { 11 | /// 12 | /// 登录处理 13 | /// 14 | /// 15 | /// 16 | Task Handle(PhoneLoginModel model); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/RoleService/ViewModels/RolePermissionBindModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using NetModular.Lib.Auth.Abstractions; 4 | using NetModular.Lib.Utils.Core.Validations; 5 | 6 | namespace NetModular.Module.Admin.Application.RoleService.ViewModels 7 | { 8 | public class RolePermissionBindModel 9 | { 10 | [NotEmpty(ErrorMessage = "请选择角色")] 11 | public Guid RoleId { get; set; } 12 | 13 | public Platform Platform { get; set; } 14 | 15 | public List Permissions { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SqlServer/Sql/AuditInfoSql.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SqlServer.Sql 2 | { 3 | public static class AuditInfoSql 4 | { 5 | /// 6 | /// 查询最近一周访问量 7 | /// 8 | public const string QueryLatestWeekPv = @"SELECT CONVERT(VARCHAR(100), ExecutionTime, 23) AS [Key], 9 | COUNT(0) AS [Value] 10 | FROM dbo.{0} 11 | WHERE ExecutionTime > DATEADD(DAY, -6, GETDATE()) 12 | GROUP BY CONVERT(VARCHAR(100), ExecutionTime, 23) 13 | ORDER BY [Key];"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/api/components/permission.js: -------------------------------------------------------------------------------- 1 | import module from '../../module' 2 | 3 | export default name => { 4 | const root = `${module.code}/${name}/` 5 | const crud = $http.crud(root) 6 | 7 | const urls = { 8 | tree: root + 'Tree', 9 | queryByCodes: root + 'QueryByCodes' 10 | } 11 | 12 | const tree = () => { 13 | return $http.get(urls.tree) 14 | } 15 | 16 | const queryByCodes = codes => { 17 | return $http.get(urls.queryByCodes, { codes }) 18 | } 19 | 20 | return { 21 | ...crud, 22 | tree, 23 | queryByCodes 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/module/index/page.js: -------------------------------------------------------------------------------- 1 | /** 页面信息 */ 2 | const page = new (function() { 3 | this.title = '模块中心' 4 | this.icon = 'product' 5 | this.name = 'admin_module' 6 | this.path = '/admin/module' 7 | 8 | // 关联权限 9 | this.permissions = [`${this.name}_query_get`, `admin_permission_query_get`, `admin_permission_querybycodes_get`] 10 | 11 | // 按钮 12 | this.buttons = {} 13 | })() 14 | 15 | /** 路由信息 */ 16 | export const route = { 17 | page, 18 | component: () => import(/* webpackChunkName: "admin.module" */ './index') 19 | } 20 | 21 | export default page 22 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/ILoginClaimsExtendProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Security.Claims; 4 | 5 | namespace NetModular.Lib.Auth.Abstractions 6 | { 7 | /// 8 | /// 登录Claims扩展处理器 9 | /// 10 | public interface ILoginClaimsExtendProvider 11 | { 12 | /// 13 | /// 获取扩展Claims列表 14 | /// 15 | /// 账户编号 16 | /// 17 | List GetExtendClaims(Guid accountId); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/ILoginHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Security.Claims; 3 | 4 | namespace NetModular.Lib.Auth.Abstractions 5 | { 6 | /// 7 | /// 登录处理 8 | /// 9 | public interface ILoginHandler 10 | { 11 | /// 12 | /// 登录处理 13 | /// 14 | /// 信息 15 | /// 扩展数据 16 | /// 17 | IResultModel Hand(List claims, string extendData); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginHandlers/ICustomLoginHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Auth.Abstractions.LoginModels; 3 | 4 | namespace NetModular.Lib.Auth.Abstractions.LoginHandlers 5 | { 6 | /// 7 | /// 自定义登录处理器 8 | /// 9 | public interface ICustomLoginHandler 10 | { 11 | /// 12 | /// 登录处理 13 | /// 14 | /// 15 | /// 16 | Task Handle(CustomLoginModel model); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Abstractions/OSS.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/RoleService/_MapperConfig.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using NetModular.Lib.Mapper.AutoMapper; 3 | using NetModular.Module.Admin.Application.RoleService.ViewModels; 4 | using NetModular.Module.Admin.Domain.Role; 5 | 6 | namespace NetModular.Module.Admin.Application.RoleService 7 | { 8 | public class MapperConfig : IMapperConfig 9 | { 10 | public void Bind(IMapperConfigurationExpression cfg) 11 | { 12 | cfg.CreateMap(); 13 | cfg.AddMap(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Integration/OSS.Integration.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Framework/Pdf/Pdf.Integration/Pdf.Integration.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Admin/Web/Validators/AccountAddValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using NetModular.Module.Admin.Application.AccountService.ViewModels; 3 | 4 | namespace NetModular.Module.Admin.Web.Validators 5 | { 6 | public class AccountAddValidator : AbstractValidator 7 | { 8 | public AccountAddValidator() 9 | { 10 | RuleFor(x => x.Email).EmailAddress().When(x => x.Email.NotNull()).WithMessage("请输入正确的邮箱地址"); 11 | RuleFor(x => x.Password).Length(6, 100).When(x => x.Password.NotNull()).WithMessage("密码不能小于6位"); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginHandlers/IUserNameLoginHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Auth.Abstractions.LoginModels; 3 | 4 | namespace NetModular.Lib.Auth.Abstractions.LoginHandlers 5 | { 6 | /// 7 | /// 用户名登录处理器 8 | /// 9 | public interface IUserNameLoginHandler 10 | { 11 | /// 12 | /// 登录处理 13 | /// 14 | /// 15 | /// 16 | Task Handle(UserNameLoginModel model); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Jwt/JwtTokenModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Auth.Jwt 2 | { 3 | /// 4 | /// JWT令牌 5 | /// 6 | public class JwtTokenModel 7 | { 8 | /// 9 | /// jwt令牌 10 | /// 11 | public string AccessToken { get; set; } 12 | 13 | /// 14 | /// 刷新令牌 15 | /// 16 | public string RefreshToken { get; set; } 17 | 18 | /// 19 | /// 有效期(秒) 20 | /// 21 | public int ExpiresIn { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Web/IAuditingHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNetCore.Mvc.Filters; 3 | 4 | namespace NetModular.Lib.Auth.Web 5 | { 6 | /// 7 | /// 审计日志处理接口 8 | /// 9 | public interface IAuditingHandler 10 | { 11 | /// 12 | /// 处理 13 | /// 14 | /// 请求上下文 15 | /// 请求委托 16 | /// 17 | Task Hand(ActionExecutingContext context, ActionExecutionDelegate next); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Framework/Config/Config.Abstractions/Config.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/ILoginInfoDetailsBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace NetModular.Lib.Auth.Abstractions 5 | { 6 | /// 7 | /// 登录信息详情生成器 8 | /// 9 | public interface ILoginInfoDetailsBuilder 10 | { 11 | /// 12 | /// 账户类型 13 | /// 14 | AccountType AccountType { get; } 15 | 16 | /// 17 | /// 生成详细信息 18 | /// 19 | /// 20 | Task Build(Guid accountId); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Core/SqlQueryable/Internal/GroupByJoinDescriptor.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Data.Core.SqlQueryable.Internal 2 | { 3 | internal class GroupByJoinDescriptor 4 | { 5 | /// 6 | /// 属性名称 7 | /// 8 | public string Name { get; set; } 9 | 10 | /// 11 | /// 别名 12 | /// 13 | public string Alias { get; set; } 14 | 15 | /// 16 | /// 连接信息 17 | /// 18 | public QueryJoinDescriptor JoinDescriptor { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.Integration/Excel.Integration.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Mime/MimeEntity.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions.Attributes; 2 | using NetModular.Lib.Data.Core.Entities; 3 | 4 | namespace NetModular.Module.Admin.Domain.Mime 5 | { 6 | /// 7 | /// MIME 类型 8 | /// 9 | public class MimeEntity : Entity 10 | { 11 | /// 12 | /// 后缀名 13 | /// 14 | public string Ext { get; set; } 15 | 16 | /// 17 | /// 值 18 | /// 19 | [Length(200)] 20 | public string Value { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/IQueryParameters.cs: -------------------------------------------------------------------------------- 1 | using Dapper; 2 | 3 | namespace NetModular.Lib.Data.Abstractions 4 | { 5 | /// 6 | /// 参数集合 7 | /// 8 | public interface IQueryParameters 9 | { 10 | /// 11 | /// 添加参数 12 | /// 13 | /// 14 | /// 15 | string Add(object value); 16 | 17 | /// 18 | /// 转换参数 19 | /// 20 | /// 21 | DynamicParameters Parse(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/ToolService/IToolService.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Module.Admin.Application.ToolService 2 | { 3 | /// 4 | /// 工具服务 5 | /// 6 | public interface IToolService 7 | { 8 | /// 9 | /// 获取枚举下拉列表 10 | /// 11 | /// 模块编码 12 | /// 枚举名称 13 | /// 库名称 14 | /// 15 | IResultModel GetEnumSelect(string moduleCode, string enumName, string libName = "Domain"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginHandlers/IUserNameOrEmailLoginHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Auth.Abstractions.LoginModels; 3 | 4 | namespace NetModular.Lib.Auth.Abstractions.LoginHandlers 5 | { 6 | /// 7 | /// 用户名或邮箱登录处理器 8 | /// 9 | public interface IUserNameOrEmailLoginHandler 10 | { 11 | /// 12 | /// 登录处理 13 | /// 14 | /// 15 | /// 16 | Task Handle(UserNameOrEmailLoginModel model); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Cache/Cache.Abstractions/CacheKeyDescriptor.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Cache.Abstractions 2 | { 3 | /// 4 | /// 缓存键描述信息 5 | /// 6 | public class CacheKeyDescriptor 7 | { 8 | /// 9 | /// 所属模块编码 10 | /// 11 | public string ModuleCode { get; set; } 12 | 13 | /// 14 | /// 名称 15 | /// 16 | public string Name { get; set; } 17 | 18 | /// 19 | /// 说明 20 | /// 21 | public string Desc { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/File/FileEntity.Extend.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions.Attributes; 2 | 3 | namespace NetModular.Module.Admin.Domain.File 4 | { 5 | public partial class FileEntity 6 | { 7 | /// 8 | /// 模块名称 9 | /// 10 | [Ignore] 11 | public string ModuleName { get; set; } 12 | 13 | /// 14 | /// 访问URL 15 | /// 16 | [Ignore] 17 | public string Url { get; set; } 18 | 19 | [Ignore] 20 | public string AccessModeName => AccessMode.ToDescription(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Framework/Logging/Logging.Serilog/HostBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | using Serilog; 3 | 4 | namespace NetModular.Lib.Logging.Serilog 5 | { 6 | public static class HostBuilderExtensions 7 | { 8 | public static IHostBuilder UseLogging(this IHostBuilder builder) 9 | { 10 | builder.UseSerilog((hostingContext, loggerConfiguration) => 11 | { 12 | loggerConfiguration.ReadFrom.Configuration(hostingContext.Configuration).Enrich.FromLogContext(); 13 | }); 14 | 15 | return builder; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Module/Module.AspNetCore/ModuleAssemblyDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using NetModular.Lib.Module.Abstractions; 3 | 4 | namespace NetModular.Lib.Module.AspNetCore 5 | { 6 | public class ModuleAssemblyDescriptor : IModuleAssemblyDescriptor 7 | { 8 | public Assembly Web { get; set; } 9 | 10 | public Assembly Api { get; set; } 11 | 12 | public Assembly Application { get; set; } 13 | 14 | public Assembly Domain { get; set; } 15 | 16 | public Assembly Infrastructure { get; set; } 17 | 18 | public Assembly Quartz { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Menu/Models/MenuQueryModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Data.Query; 3 | 4 | namespace NetModular.Module.Admin.Domain.Menu.Models 5 | { 6 | public class MenuQueryModel : QueryModel 7 | { 8 | /// 9 | /// 父节点编号 10 | /// 11 | public Guid? ParentId { get; set; } 12 | 13 | /// 14 | /// 名称 15 | /// 16 | public string Name { get; set; } 17 | 18 | /// 19 | /// 路由名称 20 | /// 21 | public string RouteName { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/IUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | 4 | namespace NetModular.Lib.Data.Abstractions 5 | { 6 | /// 7 | /// 工作单元 8 | /// 9 | public interface IUnitOfWork : IDisposable 10 | { 11 | /// 12 | /// 事务 13 | /// 14 | IDbTransaction Transaction { get; } 15 | 16 | /// 17 | /// 提交 18 | /// 19 | void Commit(); 20 | 21 | /// 22 | /// 回滚 23 | /// 24 | void Rollback(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Enums/Whether.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Utils.Core.Enums 4 | { 5 | /// 6 | /// 是否 7 | /// 8 | public enum Whether 9 | { 10 | /// 11 | /// 未知 12 | /// 13 | [Description("未知")] 14 | UnKnown = -1, 15 | /// 16 | /// 否 17 | /// 18 | [Description("否")] 19 | False, 20 | /// 21 | /// 是 22 | /// 23 | [Description("是")] 24 | True, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Result/ExcelExportResultModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Utils.Core.Result 2 | { 3 | /// 4 | /// Excel导出结果模型 5 | /// 6 | public class ExcelExportResultModel 7 | { 8 | /// 9 | /// 文件名 10 | /// 11 | public string FileName { get; set; } 12 | 13 | /// 14 | /// 存储名称 15 | /// 16 | public string SaveName { get; set; } 17 | 18 | /// 19 | /// 存储路径 20 | /// 21 | public string Path { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/ModuleServicesConfigurator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Microsoft.Extensions.Hosting; 4 | using NetModular.Lib.Module.Abstractions; 5 | 6 | namespace NetModular.Module.Admin.Infrastructure 7 | { 8 | /// 9 | /// 模块服务配置器 10 | /// 11 | public class ModuleServicesConfigurator : IModuleServicesConfigurator 12 | { 13 | public void Configure(IServiceCollection services, IModuleCollection modules, IHostEnvironment env, IConfiguration cfg) 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/config/page.js: -------------------------------------------------------------------------------- 1 | /** 页面信息 */ 2 | const page = new (function() { 3 | this.title = '配置中心' 4 | this.icon = 'tools' 5 | this.name = 'admin_config' 6 | this.path = '/admin/config' 7 | 8 | // 关联权限 9 | this.permissions = [`${this.name}_edit_get`, `${this.name}_update_post`, `${this.name}_UploadLogo_post`, `${this.name}_LogoUrl_get`, `${this.name}_Descriptors_get`] 10 | 11 | // 按钮 12 | this.buttons = {} 13 | })() 14 | 15 | /** 路由信息 */ 16 | export const route = { 17 | page, 18 | component: () => import(/* webpackChunkName: "admin.config" */ './index') 19 | } 20 | 21 | export default page 22 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/AccountConfig/IAccountConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using NetModular.Lib.Data.Abstractions; 4 | 5 | namespace NetModular.Module.Admin.Domain.AccountConfig 6 | { 7 | /// 8 | /// 账户配置仓储 9 | /// 10 | public interface IAccountConfigRepository : IRepository 11 | { 12 | /// 13 | /// 查询指定账户的配置信息 14 | /// 15 | /// 16 | /// 17 | Task GetByAccount(Guid accountId); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginModels/PhoneVerifyCodeSendModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace NetModular.Lib.Auth.Abstractions.LoginModels 4 | { 5 | /// 6 | /// 手机验证码发送模型 7 | /// 8 | public class PhoneVerifyCodeSendModel 9 | { 10 | /// 11 | /// 区号 12 | /// 13 | public string AreaCode { get; set; } = "086"; 14 | 15 | /// 16 | /// Phone 17 | /// 18 | [Required(ErrorMessage = "请输入手机号")] 19 | public string Phone { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Core/Entities/Entity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Data.Abstractions.Entities; 3 | 4 | namespace NetModular.Lib.Data.Core.Entities 5 | { 6 | /// 7 | /// 包含指定类型主键的实体 8 | /// 9 | /// 10 | public class Entity : IEntity 11 | { 12 | /// 13 | /// 主键 14 | /// 15 | public virtual TKey Id { get; set; } 16 | } 17 | 18 | /// 19 | /// 主键类型为GUID的实体 20 | /// 21 | public class Entity : Entity 22 | { 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Enums/FileAccessMode.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Utils.Core.Enums 4 | { 5 | /// 6 | /// 文件访问方式 7 | /// 8 | public enum FileAccessMode 9 | { 10 | /// 11 | /// 私有 12 | /// 13 | [Description("私有")] 14 | Private, 15 | /// 16 | /// 公开 17 | /// 18 | [Description("公开")] 19 | Open, 20 | /// 21 | /// 授权 22 | /// 23 | [Description("授权")] 24 | Auth 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Framework/Validation/Validation.Abstractions/Validation.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular model validate abstractions 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/RoleMenu/RoleMenuEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Data.Abstractions.Attributes; 3 | using NetModular.Lib.Data.Core.Entities; 4 | 5 | namespace NetModular.Module.Admin.Domain.RoleMenu 6 | { 7 | /// 8 | /// 角色菜单 9 | /// 10 | [Table("Role_Menu")] 11 | public partial class RoleMenuEntity : Entity 12 | { 13 | /// 14 | /// 角色编号 15 | /// 16 | public Guid RoleId { get; set; } 17 | 18 | /// 19 | /// 菜单编号 20 | /// 21 | public Guid MenuId { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Config/IConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Config.Abstractions; 3 | using NetModular.Lib.Data.Abstractions; 4 | 5 | namespace NetModular.Module.Admin.Domain.Config 6 | { 7 | /// 8 | /// 配置项仓储 9 | /// 10 | public interface IConfigRepository : IRepository 11 | { 12 | /// 13 | /// 获取 14 | /// 15 | /// 16 | /// 17 | /// 18 | Task Get(ConfigType type, string code); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Framework/Logging/Logging.Serilog.GenericHost/GenericHostBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | using Serilog; 3 | 4 | namespace NetModular.Lib.Logging.Serilog.GenericHost 5 | { 6 | public static class WebHostBuilderExtensions 7 | { 8 | public static IHostBuilder UseLogging(this IHostBuilder builder) 9 | { 10 | builder.UseSerilog((hostingContext, loggerConfiguration) => 11 | { 12 | loggerConfiguration.ReadFrom.Configuration(hostingContext.Configuration).Enrich.FromLogContext(); 13 | }); 14 | 15 | return builder; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Framework/Mapper/Mapper.AutoMapper/MapperConfigurationExpression.cs: -------------------------------------------------------------------------------- 1 | namespace AutoMapper 2 | { 3 | public static class MapperConfigurationExpression 4 | { 5 | /// 6 | /// 添加双向映射 7 | /// 8 | /// 9 | /// 10 | /// 11 | public static void AddMap(this IMapperConfigurationExpression cfg) 12 | { 13 | cfg.CreateMap(); 14 | cfg.CreateMap(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Framework/Pdf/Pdf.Abstractions/IPdfHandler.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Pdf.Abstractions 2 | { 3 | /// 4 | /// PDF处理类 5 | /// 6 | public interface IPdfHandler 7 | { 8 | /// 9 | /// 获取指定pdf文件的页数 10 | /// 11 | /// 12 | /// 13 | int GetPages(string filePath); 14 | 15 | /// 16 | /// 获取指定PDF文件的文本内容 17 | /// 18 | /// 19 | /// 20 | string GetFullText(string filePath); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Mvc/Extensions/HttpRequestExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace NetModular.Lib.Utils.Mvc.Extensions 4 | { 5 | public static class HttpRequestExtensions 6 | { 7 | /// 8 | /// 获取根地址 9 | /// 10 | /// 11 | /// 附加路径 12 | /// 13 | public static string GetHost(this HttpRequest request, string path = null) 14 | { 15 | return $"{request.Scheme}://{request.Host}{request.PathBase}{path ?? string.Empty}"; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/AccountRole/AccountRoleEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Data.Abstractions.Attributes; 3 | using NetModular.Lib.Data.Core.Entities; 4 | 5 | namespace NetModular.Module.Admin.Domain.AccountRole 6 | { 7 | /// 8 | /// 账户角色 9 | /// 10 | [Table("Account_Role")] 11 | public class AccountRoleEntity : Entity 12 | { 13 | /// 14 | /// 账户编号 15 | /// 16 | public Guid AccountId { get; set; } 17 | 18 | /// 19 | /// 角色编号 20 | /// 21 | public Guid RoleId { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/FileOwner/FileOwnerEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Data.Abstractions.Attributes; 3 | using NetModular.Lib.Data.Core.Entities; 4 | 5 | namespace NetModular.Module.Admin.Domain.FileOwner 6 | { 7 | /// 8 | /// 文件所有者信息 9 | /// 10 | [Table("File_Owner")] 11 | public class FileOwnerEntity : Entity 12 | { 13 | /// 14 | /// 文件存储编号 15 | /// 16 | public string SaveId { get; set; } 17 | 18 | /// 19 | /// 账户编号 20 | /// 21 | public Guid AccountId { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Framework/Data/Extend/Data.Query/QueryPagingModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace NetModular.Lib.Data.Query 4 | { 5 | /// 6 | /// 查询分页模型 7 | /// 8 | public class QueryPagingModel 9 | { 10 | /// 11 | /// 当前页 12 | /// 13 | public int Index { get; set; } = 1; 14 | 15 | /// 16 | /// 页大小 17 | /// 18 | public int Size { get; set; } = 15; 19 | 20 | /// 21 | /// 排序字段 22 | /// 23 | public List Sort { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Result/ChartDataResultModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Utils.Core.Result 2 | { 3 | /// 4 | /// 图表数据返回结果 5 | /// 6 | public class ChartDataResultModel 7 | { 8 | /// 9 | /// 键 10 | /// 11 | public TKey Key { get; set; } 12 | 13 | /// 14 | /// 值 15 | /// 16 | public object Value { get; set; } 17 | } 18 | 19 | /// 20 | /// 图表数据返回结果 21 | /// 22 | public class ChartDataResultModel : ChartDataResultModel 23 | { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/Utils/Utils.Core.Tests/ServiceCollectionExtensionsTest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Utils.Core.Tests.Log; 3 | using Xunit; 4 | 5 | namespace Utils.Core.Tests 6 | { 7 | public class ServiceCollectionExtensionsTest : BaseTest 8 | { 9 | private readonly ILog _log; 10 | 11 | public ServiceCollectionExtensionsTest() 12 | { 13 | _log = SP.GetService(); 14 | } 15 | 16 | [Fact] 17 | public void AddSingletonServicesTest() 18 | { 19 | var txt = _log.Debug(); 20 | 21 | Assert.Equal("TextLog", txt); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/AccountService/ViewModels/AccountSkinUpdateModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Module.Admin.Application.AccountService.ViewModels 2 | { 3 | /// 4 | /// 账户皮肤配置信息修改 5 | /// 6 | public class AccountSkinUpdateModel 7 | { 8 | /// 9 | /// 皮肤名称 10 | /// 11 | public string Name { get; set; } 12 | 13 | /// 14 | /// 主题 15 | /// 16 | public string Theme { get; set; } 17 | 18 | /// 19 | /// 字号 20 | /// 21 | public string FontSize { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/File/Models/FileQueryModel.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Query; 2 | using NetModular.Lib.Utils.Core.Enums; 3 | 4 | namespace NetModular.Module.Admin.Domain.File.Models 5 | { 6 | public class FileQueryModel : QueryModel 7 | { 8 | /// 9 | /// 文件名称 10 | /// 11 | public string FileName { get; set; } 12 | 13 | /// 14 | /// 模块编码 15 | /// 16 | public string ModuleCode { get; set; } 17 | 18 | /// 19 | /// 访问方式 20 | /// 21 | public FileAccessMode? AccessMode { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Framework/Config/Config.Redis/Config.Redis.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Admin/Library/Quartz/Quartz.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/module/components/permission-list/cols.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | name: 'id', 4 | label: '编号', 5 | show: false, 6 | width: 260 7 | }, 8 | { 9 | name: 'name', 10 | label: '名称' 11 | }, 12 | { 13 | name: 'moduleCode', 14 | label: '模块编码', 15 | show: false 16 | }, 17 | { 18 | name: 'controller', 19 | label: '控制器', 20 | width: '120' 21 | }, 22 | { 23 | name: 'action', 24 | label: '方法' 25 | }, 26 | { 27 | name: 'httpMethod', 28 | label: '请求方式', 29 | width: '80' 30 | }, 31 | { 32 | name: 'code', 33 | label: '唯一编码', 34 | width: '300' 35 | } 36 | ] 37 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Qiniu.SDK/Storage/QiniuException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Qiniu.Http; 3 | 4 | namespace Qiniu.Storage 5 | { 6 | class QiniuException :Exception 7 | { 8 | public string message; 9 | public HttpResult HttpResult; 10 | public QiniuException(HttpResult httpResult, string message) 11 | { 12 | this.HttpResult = httpResult == null ? new HttpResult() : httpResult; 13 | this.message = message; 14 | } 15 | 16 | public override string Message 17 | { 18 | get 19 | { 20 | return this.message; 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/Data/Data.SqlServer.Tests/config/db.json: -------------------------------------------------------------------------------- 1 | { 2 | //是否开启日志 3 | "Logging": false, 4 | //数据库类型 0、SqlServer 1、MySql 2、SQLite 3、PostgreSQL 5 | "Dialect": 0, 6 | //数据库版本 7 | "Version": "", 8 | //数据库地址 9 | "Server": ".", 10 | //端口号 11 | "Port": 0, 12 | //用户名 13 | "UserId": "sa", 14 | //密码 15 | "Password": "sa", 16 | //是否创建数据库和表 17 | "CreateDatabase": false, 18 | //模块列表 19 | "Modules": [ 20 | { 21 | //模块名称 22 | "Name": "Blog", 23 | //表前缀 24 | "Prefix": "", 25 | //数据库名称 26 | "Database": "Nm_Blog", 27 | //自定义连接信息 28 | "ConnectionString": "", 29 | //自定义版本号 30 | "Version": "" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /src/Admin/Library/Domain/LoginLog/ILoginLogRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using NetModular.Lib.Data.Abstractions; 4 | using NetModular.Module.Admin.Domain.LoginLog.Models; 5 | 6 | namespace NetModular.Module.Admin.Domain.LoginLog 7 | { 8 | /// 9 | /// 登录日志仓储 10 | /// 11 | public interface ILoginLogRepository : IRepository 12 | { 13 | /// 14 | /// 查询列表 15 | /// 16 | /// 17 | /// 18 | Task> Query(LoginLogQueryModel model); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/RolePage/RolePageEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Data.Abstractions.Attributes; 3 | using NetModular.Lib.Data.Core.Entities; 4 | 5 | namespace NetModular.Module.Admin.Domain.RolePage 6 | { 7 | /// 8 | /// 角色绑定的页面 9 | /// 10 | [Table("Role_Page")] 11 | public class RolePageEntity : Entity 12 | { 13 | /// 14 | /// 角色编号 15 | /// 16 | public Guid RoleId { get; set; } 17 | 18 | /// 19 | /// 页面编码(对应前端路由名称) 20 | /// 21 | [Length(200)] 22 | public string PageCode { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Framework/Pdf/Pdf.Abstractions/Pdf.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Enums/HttpMethod.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Utils.Core.Enums 4 | { 5 | /// 6 | /// 请求方法类型 7 | /// 8 | public enum HttpMethod 9 | { 10 | [Description("GET")] 11 | GET, 12 | [Description("PUT")] 13 | PUT, 14 | [Description("POST")] 15 | POST, 16 | [Description("DELETE")] 17 | DELETE, 18 | [Description("HEAD")] 19 | HEAD, 20 | [Description("OPTIONS")] 21 | OPTIONS, 22 | [Description("TRACE")] 23 | TRACE, 24 | [Description("PATCH")] 25 | PATCH 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/components/platform-select/index.vue: -------------------------------------------------------------------------------- 1 | 29 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Pagination/Sort.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions.Enums; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Pagination 4 | { 5 | /// 6 | /// 排序规则 7 | /// 8 | public class Sort 9 | { 10 | /// 11 | /// 排序字段 12 | /// 13 | public string OrderBy { get; } 14 | 15 | /// 16 | /// 排序方式 17 | /// 18 | public SortType Type { get; } 19 | 20 | public Sort(string orderBy, SortType type = SortType.Asc) 21 | { 22 | OrderBy = orderBy; 23 | Type = type; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Framework/Data/Db/Data.PostgreSQL/Data.PostgreSQL.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.EPPlus/Excel.EPPlus.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Abstractions/OSSProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.OSS.Abstractions 4 | { 5 | /// 6 | /// OSS提供器 7 | /// 8 | public enum OSSProvider 9 | { 10 | [Description("本地存储")] 11 | Local, 12 | /// 13 | /// 七牛 14 | /// 15 | [Description("七牛")] 16 | Qiniu, 17 | /// 18 | /// 阿里云 19 | /// 20 | [Description("阿里云")] 21 | Aliyun, 22 | /// 23 | /// Minio 24 | /// 25 | [Description("Minio")] 26 | Minio 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/log/login-log/page.js: -------------------------------------------------------------------------------- 1 | /** 页面信息 */ 2 | const page = new (function() { 3 | this.title = '登录日志' 4 | this.icon = 'log' 5 | this.name = 'admin_log_login' 6 | this.path = '/admin/log/login' 7 | 8 | // 关联权限 9 | this.permissions = [`${this.name}_get`] 10 | this.buttons = { 11 | export: { 12 | text: '导出', 13 | type: 'text', 14 | icon: 'export', 15 | code: `${this.name}_export`, 16 | permissions: [`${this.name}export_post`] 17 | } 18 | } 19 | })() 20 | 21 | /** 路由信息 */ 22 | export const route = { 23 | page, 24 | component: () => import(/* webpackChunkName: "admin.log" */ './index') 25 | } 26 | 27 | export default page 28 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Attributes/LengthAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Attributes 4 | { 5 | /// 6 | /// 属性长度 7 | /// 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class LengthAttribute : Attribute 10 | { 11 | /// 12 | /// 长度 13 | /// 14 | public int Length { get; set; } 15 | 16 | /// 17 | /// 固定长度 18 | /// 19 | /// 20 | public LengthAttribute(int length = 50) 21 | { 22 | Length = length; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/Data/Data.Common/Repository/IArticleRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Data.Common.Domain; 3 | using NetModular.Lib.Data.Abstractions; 4 | 5 | namespace Data.Common.Repository 6 | { 7 | public interface IArticleRepository : IRepository 8 | { 9 | /// 10 | /// 数量 11 | /// 12 | /// 13 | Task Count(); 14 | 15 | /// 16 | /// 增加数量 17 | /// 18 | /// 19 | /// 20 | /// 21 | Task AddCount(int id, int count); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Menu/MenuEntity.Extend.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions.Attributes; 2 | 3 | namespace NetModular.Module.Admin.Domain.Menu 4 | { 5 | public partial class MenuEntity 6 | { 7 | /// 8 | /// 父节点名称 9 | /// 10 | [Ignore] 11 | public string ParentName { get; set; } 12 | 13 | /// 14 | /// 类型名称 15 | /// 16 | [Ignore] 17 | public string TypeName => Type.ToDescription(); 18 | 19 | /// 20 | /// 打开方式名称 21 | /// 22 | [Ignore] 23 | public string TargetName => Target.ToDescription(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/IDatabaseCreateEvents.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace NetModular.Lib.Data.Abstractions 4 | { 5 | /// 6 | /// 数据库创建事件 7 | /// 8 | public interface IDatabaseCreateEvents 9 | { 10 | /// 11 | /// 数据库上下文 12 | /// 13 | IDbContext DbContext { get; set; } 14 | 15 | /// 16 | /// 创建之前 17 | /// 18 | /// 19 | Task Before(); 20 | 21 | /// 22 | /// 创建之后 23 | /// 24 | /// 25 | Task After(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/Data/Data.MySql.Tests/config/db.json: -------------------------------------------------------------------------------- 1 | { 2 | //是否开启日志 3 | "Logging": false, 4 | //数据库类型 0、SqlServer 1、MySql 2、SQLite 3、PostgreSQL 5 | "Dialect": 1, 6 | //数据库版本 7 | "Version": "", 8 | //数据库地址 9 | "Server": "pi.iamoldli.com", 10 | //端口号 11 | "Port": 10080, 12 | //用户名 13 | "UserId": "root", 14 | //密码 15 | "Password": "oldli!@#123", 16 | //是否创建数据库和表 17 | "CreateDatabase": true, 18 | //模块列表 19 | "Modules": [ 20 | { 21 | //模块名称 22 | "Name": "Blog", 23 | //表前缀 24 | "Prefix": "", 25 | //数据库名称 26 | "Database": "Nm_Blog", 27 | //自定义连接信息 28 | "ConnectionString": "", 29 | //自定义版本号 30 | "Version": "" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /src/Admin/Library/Application/AuthService/LoginHandler/DefaultCustomLoginHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using NetModular.Lib.Auth.Abstractions.LoginHandlers; 4 | using NetModular.Lib.Auth.Abstractions.LoginModels; 5 | using NetModular.Lib.Utils.Core.Attributes; 6 | 7 | namespace NetModular.Module.Admin.Application.AuthService.LoginHandler 8 | { 9 | /// 10 | /// 自定义登录默认实现 11 | /// 12 | [Singleton] 13 | public class DefaultCustomLoginHandler : ICustomLoginHandler 14 | { 15 | public Task Handle(CustomLoginModel model) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/config/library/form-mixins.js: -------------------------------------------------------------------------------- 1 | import { mapMutations } from 'vuex' 2 | const { edit, update } = $api.admin.config 3 | export default { 4 | data() { 5 | return { 6 | type: 0, 7 | code: '', 8 | form: { 9 | header: false, 10 | action: this.update 11 | } 12 | } 13 | }, 14 | methods: { 15 | ...mapMutations('app/config', { setUIConfig: 'init' }), 16 | update() { 17 | return update({ type: this.type, code: this.code, json: JSON.stringify(this.form.model) }) 18 | } 19 | }, 20 | created() { 21 | edit({ type: this.type, code: this.code }).then(data => { 22 | this.form.model = data 23 | }) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/cache/index/page.js: -------------------------------------------------------------------------------- 1 | /** 页面信息 */ 2 | const page = new (function() { 3 | this.title = '缓存清理' 4 | this.icon = 'redis' 5 | this.name = 'admin_cache' 6 | this.path = '/admin/cache' 7 | 8 | // 关联权限 9 | this.permissions = [`${this.name}_query_get`] 10 | 11 | // 按钮 12 | this.buttons = { 13 | clear: { 14 | text: '清除', 15 | type: 'text', 16 | icon: 'delete', 17 | code: `${this.name}_clear`, 18 | permissions: [`${this.name}_clear_delete`] 19 | } 20 | } 21 | })() 22 | 23 | /** 路由信息 */ 24 | export const route = { 25 | page, 26 | component: () => import(/* webpackChunkName: "admin.cache" */ './index') 27 | } 28 | 29 | export default page 30 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.Abstractions/IExcelHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using NetModular.Lib.Data.Query; 3 | using NetModular.Lib.Utils.Core.Result; 4 | 5 | namespace NetModular.Lib.Excel.Abstractions 6 | { 7 | /// 8 | /// Excel处理接口 9 | /// 10 | public interface IExcelHandler 11 | { 12 | /// 13 | /// 导出 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | ExcelExportResultModel Export(ExportModel model, IList entities) where T : class, new(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Qiniu.SDK/Storage/UploadController.cs: -------------------------------------------------------------------------------- 1 | namespace Qiniu.Storage 2 | { 3 | /// 4 | /// 上传任务的状态 5 | /// 6 | public enum UploadControllerAction 7 | { 8 | /// 9 | /// 任务状态:激活 10 | /// 11 | Activated, 12 | 13 | /// 14 | /// 任务状态:暂停 15 | /// 16 | Suspended, 17 | 18 | /// 19 | /// 任务状态:退出 20 | /// 21 | Aborted 22 | }; 23 | 24 | /// 25 | /// 上传任务的控制函数 26 | /// 27 | /// 28 | public delegate UploadControllerAction UploadController(); 29 | } 30 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/AccountPermissionResolver/MenuComparer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using NetModular.Module.Admin.Domain.Menu; 3 | 4 | namespace NetModular.Module.Admin.Infrastructure.AccountPermissionResolver 5 | { 6 | 7 | /// 8 | /// 菜单比较器 9 | /// 10 | public class MenuComparer : IEqualityComparer 11 | { 12 | public bool Equals(MenuEntity x, MenuEntity y) 13 | { 14 | if (x == null || y == null) 15 | return false; 16 | 17 | return x.Id == y.Id; 18 | } 19 | 20 | public int GetHashCode(MenuEntity obj) 21 | { 22 | return 1; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Abstractions/QuartzConfigChangedEvent.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Config.Abstractions; 2 | 3 | namespace NetModular.Lib.Quartz.Abstractions 4 | { 5 | public class QuartzConfigChangedEvent : IConfigChangeEvent 6 | { 7 | private readonly IQuartzServer _quartzServer; 8 | 9 | public QuartzConfigChangedEvent(IQuartzServer quartzServer) 10 | { 11 | _quartzServer = quartzServer; 12 | } 13 | 14 | public void OnChanged(QuartzConfig newConfig, QuartzConfig oldConfig) 15 | { 16 | _quartzServer.Stop(); 17 | if (newConfig.Enabled) 18 | _quartzServer.Restart(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Models/SortOptionModel.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Utils.Core.Models 2 | { 3 | /// 4 | /// 排序选项模型 5 | /// 6 | public class SortOptionModel 7 | { 8 | /// 9 | /// 编号 10 | /// 11 | public TKey Id { get; set; } 12 | 13 | /// 14 | /// 显示名称 15 | /// 16 | public string Label { get; set; } 17 | 18 | /// 19 | /// 序号 20 | /// 21 | public int Sort { get; set; } 22 | 23 | /// 24 | /// 附加数据 25 | /// 26 | public object Data { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/MenuService/_MapperConfig.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using NetModular.Lib.Mapper.AutoMapper; 3 | using NetModular.Module.Admin.Application.MenuService.ResultModels; 4 | using NetModular.Module.Admin.Application.MenuService.ViewModels; 5 | using NetModular.Module.Admin.Domain.Menu; 6 | 7 | namespace NetModular.Module.Admin.Application.MenuService 8 | { 9 | public class MapperConfig : IMapperConfig 10 | { 11 | public void Bind(IMapperConfigurationExpression cfg) 12 | { 13 | cfg.CreateMap(); 14 | cfg.AddMap(); 15 | cfg.CreateMap(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/components/enum-select/index.vue: -------------------------------------------------------------------------------- 1 | 32 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/CacheService/ICacheService.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace NetModular.Module.Admin.Application.CacheService 4 | { 5 | /// 6 | /// 缓存服务 7 | /// 8 | public interface ICacheService 9 | { 10 | /// 11 | /// 查询指定模块的所有缓存键信息 12 | /// 13 | /// 14 | /// 15 | IResultModel Query(string moduleCode); 16 | 17 | /// 18 | /// 清除指定前缀的缓存 19 | /// 20 | /// 21 | /// 22 | Task Clear(string prefix); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Framework/MQ/MQ.RabbitMQ/Consumer.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using RabbitMQ.Client; 3 | 4 | namespace NetModular.Lib.MQ.RabbitMQ; 5 | 6 | /// 7 | /// 消费者 8 | /// 9 | public class Consumer 10 | { 11 | /// 12 | /// 消费者标签 13 | /// 14 | public string Tag { get; set; } 15 | 16 | /// 17 | /// 关联通道 18 | /// 19 | public IChannel Channel { get; set; } 20 | 21 | /// 22 | /// 取消消费 23 | /// 24 | public Task CancelAsync() 25 | { 26 | if (Tag.NotNull()) 27 | { 28 | return Channel.BasicCancelAsync(Tag); 29 | } 30 | 31 | return Task.CompletedTask; 32 | } 33 | } -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Core/JobFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Quartz; 3 | using Quartz.Spi; 4 | 5 | namespace NetModular.Lib.Quartz.Core 6 | { 7 | public class JobFactory : IJobFactory 8 | { 9 | private readonly IServiceProvider _container; 10 | 11 | public JobFactory(IServiceProvider container) 12 | { 13 | _container = container; 14 | } 15 | 16 | public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler) 17 | { 18 | return _container.GetService(bundle.JobDetail.JobType) as IJob; 19 | } 20 | 21 | public void ReturnJob(IJob job) 22 | { 23 | (job as IDisposable)?.Dispose(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/Data/Data.Common/LoginInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Auth.Abstractions; 3 | 4 | namespace Data.Common 5 | { 6 | public class LoginInfo : ILoginInfo 7 | { 8 | public Guid? TenantId { get; } 9 | 10 | public Guid AccountId => Guid.Parse("39F08CFD-8E0D-771B-A2F3-2639A62CA2FA"); 11 | 12 | public string AccountName { get; } 13 | 14 | public AccountType AccountType { get; } 15 | 16 | public Platform Platform { get; } 17 | 18 | public string IP { get; } 19 | 20 | public string IPv4 { get; } 21 | 22 | public string IPv6 { get; } 23 | 24 | public long LoginTime { get; } 25 | 26 | public string UserAgent { get; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Framework/Cache/Cache.Integration/Cache.Integration.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/api/components/tool.js: -------------------------------------------------------------------------------- 1 | import module from '../../module' 2 | 3 | export default name => { 4 | const root = `${module.code}/${name}/` 5 | 6 | const urls = { 7 | enumSelect: root + 'EnumSelect', 8 | platformSelect: root + 'PlatformSelect', 9 | loginModeSelect: root + 'LoginModeSelect' 10 | } 11 | 12 | const enumSelect = params => { 13 | return $http.get(urls.enumSelect, params) 14 | } 15 | 16 | const platformSelect = () => { 17 | return $http.get(urls.platformSelect) 18 | } 19 | 20 | const loginModeSelect = () => { 21 | return $http.get(urls.loginModeSelect) 22 | } 23 | 24 | return { 25 | enumSelect, 26 | platformSelect, 27 | loginModeSelect 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.Abstractions/Excel.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular excel abstractions 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Mvc/Utils.Mvc.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular utils for Mvc 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/log/login-log/cols.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | name: 'id', 4 | label: '编号', 5 | show: false 6 | }, 7 | { 8 | name: 'platformName', 9 | label: '登录平台' 10 | }, 11 | { 12 | name: 'loginModeName', 13 | label: '登录方式' 14 | }, 15 | { 16 | name: 'userName', 17 | label: '用户名' 18 | }, 19 | { 20 | name: 'email', 21 | label: '邮箱' 22 | }, 23 | { 24 | name: 'phone', 25 | label: '手机号' 26 | }, 27 | { 28 | name: 'loginTime', 29 | label: '登录时间' 30 | }, 31 | { 32 | name: 'ip', 33 | label: 'IP' 34 | }, 35 | { 36 | name: 'success', 37 | label: '结果' 38 | }, 39 | { 40 | name: 'userAgent', 41 | label: 'UA' 42 | } 43 | ] 44 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Attributes/TableAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Attributes 4 | { 5 | /// 6 | /// 表名称,指定实体类在数据库中对应的表名称 7 | /// 8 | [AttributeUsage(AttributeTargets.Class, Inherited = false)] 9 | public class TableAttribute : Attribute 10 | { 11 | /// 12 | /// 表名称 13 | /// 14 | public string Name { get; set; } 15 | 16 | /// 17 | /// 指定实体类在数据库中对应的表名称 18 | /// 19 | /// 表名 20 | public TableAttribute(string tableName) 21 | { 22 | Name = tableName; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Framework/Data/Db/Data.SqlServer/Data.SqlServer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular data implement for SqlServer 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Files/FileSizeUnit.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Utils.Core.Files 4 | { 5 | /// 6 | /// 文件大小单位 7 | /// 8 | public enum FileSizeUnit 9 | { 10 | /// 11 | /// 字节 12 | /// 13 | [Description("B")] 14 | Byte, 15 | /// 16 | /// K字节 17 | /// 18 | [Description("KB")] 19 | K, 20 | /// 21 | /// M字节 22 | /// 23 | [Description("MB")] 24 | M, 25 | /// 26 | /// G字节 27 | /// 28 | [Description("GB")] 29 | G 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/AccountService/ViewModels/AccountRoleBindModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace NetModular.Module.Admin.Application.AccountService.ViewModels 5 | { 6 | /// 7 | /// 账户角色绑定模型 8 | /// 9 | public class AccountRoleBindModel 10 | { 11 | [Required(ErrorMessage = "请选择账户")] 12 | public Guid AccountId { get; set; } 13 | 14 | /// 15 | /// 角色 16 | /// 17 | [Required(ErrorMessage = "请选择角色")] 18 | public Guid RoleId { get; set; } 19 | 20 | /// 21 | /// 是否选中 22 | /// 23 | public bool Checked { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/Auth.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular auth abstractions 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Menu/MenuType.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Module.Admin.Domain.Menu 4 | { 5 | /// 6 | /// 菜单类型 7 | /// 8 | public enum MenuType 9 | { 10 | /// 11 | /// 未知 12 | /// 13 | [Description("未知")] 14 | UnKnown = -1, 15 | /// 16 | /// 节点 17 | /// 18 | [Description("节点")] 19 | Node, 20 | /// 21 | /// 路由菜单 22 | /// 23 | [Description("路由")] 24 | Route, 25 | /// 26 | /// 链接菜单 27 | /// 28 | [Description("链接")] 29 | Link 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SqlServer/ConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Config.Abstractions; 3 | using NetModular.Lib.Data.Abstractions; 4 | using NetModular.Lib.Data.Core; 5 | using NetModular.Module.Admin.Domain.Config; 6 | 7 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SqlServer 8 | { 9 | public class ConfigRepository : RepositoryAbstract, IConfigRepository 10 | { 11 | public ConfigRepository(IDbContext context) : base(context) 12 | { 13 | } 14 | 15 | public Task Get(ConfigType type, string code) 16 | { 17 | return GetAsync(m => m.Type == type && m.Code == code); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SqlServer/FileOwnerRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using NetModular.Lib.Data.Abstractions; 3 | using NetModular.Lib.Data.Core; 4 | using NetModular.Module.Admin.Domain.FileOwner; 5 | 6 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SqlServer 7 | { 8 | public class FileOwnerRepository : RepositoryAbstract, IFileOwnerRepository 9 | { 10 | public FileOwnerRepository(IDbContext context) : base(context) 11 | { 12 | } 13 | 14 | public Task Exist(FileOwnerEntity entity) 15 | { 16 | return Db.Find(m => m.SaveId == entity.SaveId && m.AccountId == entity.AccountId).ExistsAsync(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/components/enum-radio/index.vue: -------------------------------------------------------------------------------- 1 | 32 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/PasswordHandler/IPasswordHandler.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.Auth.Abstractions.PasswordHandler 2 | { 3 | /// 4 | /// 密码处理器接口 5 | /// 6 | public interface IPasswordHandler 7 | { 8 | /// 9 | /// 加密 10 | /// 11 | /// 12 | /// 13 | /// 14 | string Encrypt(string userName, string password); 15 | 16 | /// 17 | /// 解密 18 | /// 19 | /// 20 | /// 21 | string Decrypt(string encryptPassword); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Framework/Host/Host.Electron/Host.Electron.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular host for Electron 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/ModuleService/ViewModels/ModuleOptionsUpdateModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace NetModular.Module.Admin.Application.ModuleService.ViewModels 5 | { 6 | public class ModuleOptionsUpdateModel 7 | { 8 | /// 9 | /// 模块编码 10 | /// 11 | [Required(ErrorMessage = "请选择模块")] 12 | public string Code { get; set; } 13 | 14 | /// 15 | /// 配置模型实例 16 | /// 17 | public object Instance { get; set; } 18 | 19 | /// 20 | /// 值 21 | /// 22 | public Dictionary Values { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Core/Data.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular data core 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Framework/Data/Db/Data.MySql/Data.MySql.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular data implement for MySql 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Admin/Library/Infrastructure/Repositories/SqlServer/AccountConfigRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using NetModular.Lib.Data.Abstractions; 4 | using NetModular.Lib.Data.Core; 5 | using NetModular.Module.Admin.Domain.AccountConfig; 6 | 7 | namespace NetModular.Module.Admin.Infrastructure.Repositories.SqlServer 8 | { 9 | public class AccountConfigRepository : RepositoryAbstract, IAccountConfigRepository 10 | { 11 | public AccountConfigRepository(IDbContext context) : base(context) 12 | { 13 | } 14 | 15 | public Task GetByAccount(Guid accountId) 16 | { 17 | return GetAsync(m => m.AccountId == accountId); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/api/components/auditInfo.js: -------------------------------------------------------------------------------- 1 | import module from '../../module' 2 | 3 | export default name => { 4 | const root = `${module.code}/${name}/` 5 | const crud = $http.crud(root) 6 | const urls = { 7 | details: root + 'Details', 8 | queryLatestWeekPv: root + 'QueryLatestWeekPv', 9 | export: root + 'Export' 10 | } 11 | 12 | const details = id => { 13 | return $http.get(urls.details, { id }) 14 | } 15 | 16 | const queryLatestWeekPv = () => { 17 | return $http.get(urls.queryLatestWeekPv) 18 | } 19 | 20 | const exportData = params => { 21 | return $http.export(urls.export, params) 22 | } 23 | 24 | return { 25 | ...crud, 26 | details, 27 | queryLatestWeekPv, 28 | exportData 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/components/enum-checkbox/index.vue: -------------------------------------------------------------------------------- 1 | 32 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/AccountType.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace NetModular.Lib.Auth.Abstractions 4 | { 5 | /// 6 | /// 账户类型 7 | /// 8 | public enum AccountType 9 | { 10 | /// 11 | /// 未知 12 | /// 13 | [Description("未知")] 14 | UnKnown = -1, 15 | /// 16 | /// 管理员 17 | /// 18 | [Description("管理员")] 19 | Admin, 20 | /// 21 | /// 人员 22 | /// 23 | [Description("个人")] 24 | User, 25 | /// 26 | /// 企业 27 | /// 28 | [Description("企业")] 29 | Enterprise 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Framework/Excel/Excel.Abstractions/IExcelExportHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using NetModular.Lib.Data.Query; 4 | 5 | namespace NetModular.Lib.Excel.Abstractions 6 | { 7 | /// 8 | /// Excel导出处理接口 9 | /// 10 | public interface IExcelExportHandler 11 | { 12 | /// 13 | /// 创建导出的Excel文件 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 保存的流 19 | /// 20 | void CreateExcel(ExportModel model, IList entities, Stream stream) where T : class, new(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Qiniu.SDK/QiniuCSharpSDK.cs: -------------------------------------------------------------------------------- 1 | /// 2 | /// Qiniu (Cloud) C# SDK for .NET Framework 2.0+/Core/UWP 3 | /// Modules in this SDK: 4 | /// "Storage" 存储相关功能,上传,下载,数据处理,资源管理 5 | /// "CDN", Fusion CDN, 融合CDN加速; 6 | /// "Util", Utilities such as MD5 hashing, 实用工具(如MD5哈希计算等); 7 | /// "Http", HTTP Request Manager, HTTP请求管理器 8 | /// 9 | public class QiniuCSharpSDK 10 | { 11 | /// 12 | /// SDK名称 13 | /// 14 | public const string ALIAS = "QiniuCSharpSDK"; 15 | 16 | /// 17 | /// 目标框架 18 | /// 19 | public const string RTFX = "NETSTANDARD"; 20 | 21 | /// 22 | /// SDK版本号 23 | /// 24 | public const string VERSION = "7.3.0"; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/Framework/Data/Db/Data.SQLite/Data.SQLite.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular data implement for SQLite 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Framework/Module/Module.AspNetCore/Module.AspNetCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular module for AspNetCore 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginModels/EmailLoginModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace NetModular.Lib.Auth.Abstractions.LoginModels 4 | { 5 | /// 6 | /// 邮箱登录 7 | /// 8 | public class EmailLoginModel : LoginModel 9 | { 10 | public override LoginMode Mode => LoginMode.Email; 11 | 12 | /// 13 | /// 邮箱 14 | /// 15 | [Required(ErrorMessage = "请输入邮箱")] 16 | [EmailAddress(ErrorMessage = "请输入正确的邮箱格式")] 17 | public string Email { get; set; } 18 | 19 | /// 20 | /// 密码 21 | /// 22 | [Required(ErrorMessage = "请输入密码")] 23 | public string Password { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/api/components/config.js: -------------------------------------------------------------------------------- 1 | import module from '../../module' 2 | 3 | export default name => { 4 | const root = `${module.code}/${name}/` 5 | const urls = { 6 | ui: root + 'UI', 7 | edit: root + 'Edit', 8 | update: root + 'Update', 9 | descriptors: root + 'Descriptors' 10 | } 11 | 12 | const getUI = () => { 13 | return $http.get(urls.ui) 14 | } 15 | 16 | const edit = params => { 17 | return $http.get(urls.edit, params) 18 | } 19 | 20 | const update = params => { 21 | return $http.post(urls.update, params) 22 | } 23 | 24 | const getDescriptors = () => { 25 | return $http.get(urls.descriptors) 26 | } 27 | 28 | return { 29 | getUI, 30 | edit, 31 | update, 32 | getDescriptors 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Extensions/ArrayExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | // ReSharper disable once CheckNamespace 5 | namespace NetModular 6 | { 7 | /// 8 | /// 数组扩展 9 | /// 10 | public static class ArrayExtensions 11 | { 12 | /// 13 | /// 随机获取数组中的一个 14 | /// 15 | /// 16 | /// 17 | /// 18 | public static T RandomGet(this T[] arr) 19 | { 20 | if (arr == null || !arr.Any()) 21 | return default(T); 22 | 23 | var r = new Random(); 24 | 25 | return arr[r.Next(arr.Length)]; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Extensions/GuidExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | // ReSharper disable once CheckNamespace 4 | namespace NetModular 5 | { 6 | public static class GuidExtensions 7 | { 8 | /// 9 | /// 判断Guid是否为空 10 | /// 11 | /// 12 | /// 13 | public static bool IsEmpty(this Guid s) 14 | { 15 | return s == Guid.Empty; 16 | } 17 | 18 | /// 19 | /// 判断Guid是否不为空 20 | /// 21 | /// 22 | /// 23 | public static bool NotEmpty(this Guid s) 24 | { 25 | return s != Guid.Empty; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/Data/Data.PostgreSQL.Tests/config/db.json: -------------------------------------------------------------------------------- 1 | { 2 | //是否开启日志 3 | "Logging": false, 4 | //数据库类型 0、SqlServer 1、MySql 2、SQLite 3、PostgreSQL 5 | "Dialect": 3, 6 | //数据库版本 7 | "Version": "", 8 | //数据库地址 9 | "Server": "localhost", 10 | //端口号 11 | "Port": 0, 12 | //用户名 13 | "UserId": "postgres", 14 | //密码 15 | "Password": "postgre", 16 | //是否创建数据库和表 17 | "CreateDatabase": false, 18 | //PostgreSQL的数据库名称,默认postgres,需手动创建 19 | "NpgsqlDatabaseName": "NetModular", 20 | //模块列表 21 | "Modules": [ 22 | { 23 | //模块名称 24 | "Name": "Blog", 25 | //表前缀 26 | "Prefix": "", 27 | //数据库名称 28 | "Database": "Nm_Blog", 29 | //自定义连接信息 30 | "ConnectionString": "", 31 | //自定义版本号 32 | "Version": "" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /src/Framework/Data/Extend/Data.Query/Data.Query.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular data for query 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Qiniu/OSS.Qiniu.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Framework/Pdf/Pdf.iText/Pdf.iText.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/home/index.vue: -------------------------------------------------------------------------------- 1 | 18 | 28 | -------------------------------------------------------------------------------- /src/Framework/Config/Config.Redis/ServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using NetModular.Lib.Config.Abstractions; 3 | 4 | namespace NetModular.Lib.Config.Redis 5 | { 6 | public static class ServiceCollectionExtensions 7 | { 8 | /// 9 | /// 添加配置管理(使用Redis) 10 | /// 11 | /// 12 | /// 13 | public static IServiceCollection AddConfigWithRedis(this IServiceCollection services) 14 | { 15 | //配置核心服务 16 | services.AddConfigCore(); 17 | 18 | //配置实例提供器 19 | services.AddSingleton(); 20 | 21 | return services; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Framework/Module/Module.Abstractions/IModuleServicesConfigurator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Microsoft.Extensions.Hosting; 4 | 5 | namespace NetModular.Lib.Module.Abstractions 6 | { 7 | /// 8 | /// 模块服务配置器 9 | /// 10 | public interface IModuleServicesConfigurator 11 | { 12 | /// 13 | /// 配置 14 | /// 15 | /// 服务集合 16 | /// 模块列表 17 | /// 环境变量 18 | /// 19 | void Configure(IServiceCollection services, IModuleCollection modules, IHostEnvironment env, IConfiguration cfg); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Admin/UI/module-admin/src/views/menu/index/cols.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | name: 'id', 4 | label: '编号', 5 | show: false 6 | }, 7 | { 8 | name: 'name', 9 | label: '名称', 10 | sortable: true, 11 | width: '150' 12 | }, 13 | { 14 | name: 'typeName', 15 | label: '类型' 16 | }, 17 | { 18 | name: 'routeName', 19 | label: '路由名称', 20 | width: '150' 21 | }, 22 | { 23 | name: 'icon', 24 | label: '图标' 25 | }, 26 | { 27 | name: 'iconColor', 28 | label: '图标颜色' 29 | }, 30 | { 31 | name: 'level', 32 | label: '等级' 33 | }, 34 | { 35 | name: 'show', 36 | label: '是否显示' 37 | }, 38 | { 39 | name: 'sort', 40 | label: '排序' 41 | }, 42 | { 43 | name: 'targetName', 44 | label: '打开方式' 45 | } 46 | ] 47 | -------------------------------------------------------------------------------- /src/Framework/Config/Config.Abstractions/Impl/SystemConfig.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace NetModular.Lib.Config.Abstractions.Impl 4 | { 5 | /// 6 | /// 系统配置 7 | /// 8 | public class SystemConfig : IConfig 9 | { 10 | /// 11 | /// 系统标题 12 | /// 13 | public string Title { get; set; } 14 | 15 | /// 16 | /// Logo文件路径 17 | /// 18 | public string Logo { get; set; } 19 | 20 | /// 21 | /// 版权声明 22 | /// 23 | public string Copyright { get; set; } 24 | 25 | /// 26 | /// 用户页(前端页面路由名称) 27 | /// 28 | public string UserPage { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Framework/Module/Module.Abstractions/IModuleAssemblyDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | namespace NetModular.Lib.Module.Abstractions 4 | { 5 | /// 6 | /// 模块的程序集描述 7 | /// 8 | public interface IModuleAssemblyDescriptor 9 | { 10 | /// 11 | /// 应用层服务 12 | /// 13 | Assembly Application { get; set; } 14 | 15 | /// 16 | /// 领域 17 | /// 18 | Assembly Domain { get; set; } 19 | 20 | /// 21 | /// 基础设施 22 | /// 23 | Assembly Infrastructure { get; set; } 24 | 25 | /// 26 | /// 任务调度Quartz 27 | /// 28 | Assembly Quartz { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Role/RoleEntity.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Data.Abstractions.Attributes; 2 | using NetModular.Lib.Data.Core.Entities.Extend; 3 | 4 | namespace NetModular.Module.Admin.Domain.Role 5 | { 6 | /// 7 | /// 角色 8 | /// 9 | [Table("Role")] 10 | public partial class RoleEntity : EntityBaseWithSoftDelete 11 | { 12 | /// 13 | /// 名称 14 | /// 15 | public string Name { get; set; } 16 | 17 | /// 18 | /// 备注 19 | /// 20 | [Length(300)] 21 | public string Remarks { get; set; } 22 | 23 | /// 24 | /// 是否是指定的角色,如果是其它模块指定的,不允许删除修改 25 | /// 26 | public bool IsSpecified { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Framework/Config/Config.Core/Config.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Admin/WebHost/_modules/00_Admin/InitData/Account.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Id": "39F08CFD-8E0D-771B-A2F3-2639A62CA2FA", 4 | "TenantId": null, 5 | "Type": 0, 6 | "UserName": "admin", 7 | "Password": "E739279CB28CDAFD7373618313803524", 8 | "Name": "管理员", 9 | "Phone": "", 10 | "Email": "", 11 | "Status": 1, 12 | "IsLock": 0, 13 | "ClosedTime": "2019-09-29 10:19:21", 14 | "ClosedBy": "00000000-0000-0000-0000-000000000000", 15 | "CreatedTime": "2019-09-29 10:19:21", 16 | "CreatedBy": "00000000-0000-0000-0000-000000000000", 17 | "ModifiedTime": "2020-01-14 15:20:04", 18 | "ModifiedBy": "39F08CFD-8E0D-771B-A2F3-2639A62CA2FA", 19 | "Deleted": 0, 20 | "DeletedTime": "2019-09-29 10:19:21", 21 | "DeletedBy": "00000000-0000-0000-0000-000000000000" 22 | } 23 | ] -------------------------------------------------------------------------------- /src/Framework/Cache/Cache.Abstractions/Cache.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular cache abstraction 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Framework/Module/Module.GenericHost/Module.GenericHost.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NetModular module for GenericHost 5 | true 6 | true 7 | snupkg 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Abstractions/AliyunConfig.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.OSS.Abstractions 2 | { 3 | public class AliyunConfig 4 | { 5 | /// 6 | /// 域名 7 | /// 8 | public string Endpoint { get; set; } 9 | 10 | /// 11 | /// 访问令牌ID 12 | /// 13 | public string AccessKeyId { get; set; } 14 | 15 | /// 16 | /// 访问令牌密钥 17 | /// 18 | public string AccessKeySecret { get; set; } 19 | 20 | /// 21 | /// 存储空间名称 22 | /// 23 | public string BucketName { get; set; } 24 | 25 | /// 26 | /// 自定义域名 27 | /// 28 | public string Domain { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Local/OSS.Local.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | snupkg 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/RolePermission/RolePermissionEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Auth.Abstractions; 3 | using NetModular.Lib.Data.Abstractions.Attributes; 4 | using NetModular.Lib.Data.Core.Entities; 5 | 6 | namespace NetModular.Module.Admin.Domain.RolePermission 7 | { 8 | [Table("Role_Permission")] 9 | public class RolePermissionEntity : Entity 10 | { 11 | /// 12 | /// 角色 13 | /// 14 | public Guid RoleId { get; set; } 15 | 16 | /// 17 | /// 平台类型 18 | /// 19 | public Platform Platform { get; set; } 20 | 21 | /// 22 | /// 权限编码 23 | /// 24 | [Length(200)] 25 | public string PermissionCode { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Framework/Auth/Auth.Abstractions/LoginModels/UserNameLoginModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace NetModular.Lib.Auth.Abstractions.LoginModels 4 | { 5 | /// 6 | /// 用户名登录 7 | /// 8 | public class UserNameLoginModel : LoginModel 9 | { 10 | /// 11 | /// 登录方式 12 | /// 13 | public override LoginMode Mode => LoginMode.UserName; 14 | 15 | /// 16 | /// 用户名 17 | /// 18 | [Required(ErrorMessage = "请输入用户名")] 19 | public string UserName { get; set; } 20 | 21 | /// 22 | /// 密码 23 | /// 24 | [Required(ErrorMessage = "请输入密码")] 25 | public string Password { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Result/QueryResultModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Newtonsoft.Json; 3 | 4 | // ReSharper disable once CheckNamespace 5 | namespace NetModular 6 | { 7 | /// 8 | /// 查询结果模型 9 | /// 10 | /// 11 | public class QueryResultModel 12 | { 13 | /// 14 | /// 总数 15 | /// 16 | public long Total { get; set; } 17 | 18 | /// 19 | /// 数据集 20 | /// 21 | public IList Rows { get; set; } 22 | 23 | /// 24 | /// 其他数据 25 | /// 26 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 27 | public object Data { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Admin/Library/Application/AuthService/Defaults/DefaultPhoneVerifyCodeProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using NetModular.Lib.Auth.Abstractions.Providers; 4 | using NetModular.Lib.Utils.Core.Attributes; 5 | 6 | namespace NetModular.Module.Admin.Application.AuthService.Defaults 7 | { 8 | [Singleton] 9 | internal class DefaultPhoneVerifyCodeProvider : IPhoneVerifyCodeProvider 10 | { 11 | public Task Send(string phone, string areaCode = "086") 12 | { 13 | throw new NotImplementedException("手机号登录需要自己实现手机验证码逻辑"); 14 | } 15 | 16 | public Task Verify(string phone, string code, string areaCode = "086") 17 | { 18 | throw new NotImplementedException("手机号登录需要自己实现手机验证码逻辑"); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Framework/Module/Module.Abstractions/ModuleEnumDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace NetModular.Lib.Module.Abstractions 5 | { 6 | /// 7 | /// 模块枚举描述器 8 | /// 9 | public class ModuleEnumDescriptor 10 | { 11 | /// 12 | /// 名称 13 | /// 14 | public string Name { get; set; } 15 | 16 | /// 17 | /// 库名称 18 | /// 19 | public string LibraryName { get; set; } 20 | 21 | /// 22 | /// 枚举类型 23 | /// 24 | public Type Type { get; set; } 25 | 26 | /// 27 | /// 列表 28 | /// 29 | public List Options { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Framework/Quartz/Quartz.Abstractions/QuartzModuleDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using NetModular.Lib.Module.Abstractions; 3 | 4 | namespace NetModular.Lib.Quartz.Abstractions 5 | { 6 | /// 7 | /// 调度模块描述信息 8 | /// 9 | public class QuartzModuleDescriptor 10 | { 11 | /// 12 | /// 模块信息 13 | /// 14 | public IModuleDescriptor Module { get; set; } 15 | 16 | /// 17 | /// 任务列表 18 | /// 19 | public List Tasks { get; } = new List(); 20 | 21 | /// 22 | /// 任务下拉列表 23 | /// 24 | public List TaskSelect { get; } = new List(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/Pdf/Pdf.iText.Tests/PdfHandlerTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using NetModular.Lib.Pdf.Abstractions; 4 | using NetModular.Lib.Pdf.iText; 5 | using Xunit; 6 | 7 | namespace Pdf.iText.Tests 8 | { 9 | public class PdfHandlerTest 10 | { 11 | private readonly IPdfHandler _handler = new PdfHandler(new iTextHelper()); 12 | private readonly string _filePath = Path.Combine(AppContext.BaseDirectory, "pdfs\\再生铜、铝、铅、锌工业污染物排放标准.pdf"); 13 | 14 | [Fact] 15 | public void GetPagesTest() 16 | { 17 | var pages = _handler.GetPages(_filePath); 18 | Assert.Equal(21, pages); 19 | } 20 | 21 | [Fact] 22 | public void GetFullTextTest() 23 | { 24 | var s = _handler.GetFullText(_filePath); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/Config/ConfigEntity.cs: -------------------------------------------------------------------------------- 1 | using NetModular.Lib.Config.Abstractions; 2 | using NetModular.Lib.Data.Abstractions.Attributes; 3 | using NetModular.Lib.Data.Core.Entities; 4 | 5 | namespace NetModular.Module.Admin.Domain.Config 6 | { 7 | /// 8 | /// 配置项 9 | /// 10 | [Table("Config")] 11 | public partial class ConfigEntity : Entity 12 | { 13 | /// 14 | /// 类型 15 | /// 16 | public ConfigType Type { get; set; } 17 | 18 | /// 19 | /// 编码 20 | /// 21 | public string Code { get; set; } 22 | 23 | /// 24 | /// 值 25 | /// 26 | [Max] 27 | [Nullable] 28 | public string Value { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Admin/Library/Quartz/ModuleApiRequestCountSyncTask.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Threading.Tasks; 3 | using NetModular.Lib.Quartz.Abstractions; 4 | using NetModular.Module.Admin.Application.ModuleService; 5 | 6 | namespace NetModular.Module.Admin.Quartz 7 | { 8 | [Description("模块接口请求数量同步")] 9 | public class ModuleApiRequestCountSyncTask : TaskAbstract 10 | { 11 | private readonly IModuleService _moduleService; 12 | public ModuleApiRequestCountSyncTask(ITaskLogger logger, IModuleService moduleService) : base(logger) 13 | { 14 | _moduleService = moduleService; 15 | } 16 | 17 | public override async Task Execute(ITaskExecutionContext context) 18 | { 19 | await _moduleService.SyncApiRequestCount(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Abstractions/OSSConfig.cs: -------------------------------------------------------------------------------- 1 | namespace NetModular.Lib.OSS.Abstractions 2 | { 3 | /// 4 | /// OSSConfig 5 | /// 6 | public class OSSConfig 7 | { 8 | /// 9 | /// OSS提供器 10 | /// 11 | public OSSProvider Provider { get; set; } = OSSProvider.Local; 12 | 13 | /// 14 | /// 七牛配置 15 | /// 16 | public QiniuConfig Qiniu { get; set; } = new QiniuConfig(); 17 | 18 | /// 19 | /// 阿里云配置 20 | /// 21 | public AliyunConfig Aliyun { get; set; } = new AliyunConfig(); 22 | 23 | /// 24 | /// Minio 25 | /// 26 | public MinioConfig Minio { get; set; } = new MinioConfig(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Framework/OSS/OSS.Qiniu.SDK/Util/Mac.cs: -------------------------------------------------------------------------------- 1 | namespace Qiniu.Util 2 | { 3 | /// 4 | /// 账户访问控制(密钥) 5 | /// 6 | public class Mac 7 | { 8 | /// 9 | /// 密钥-AccessKey 10 | /// 11 | public string AccessKey { set; get; } 12 | 13 | /// 14 | /// 密钥-SecretKey 15 | /// 16 | public string SecretKey { set; get; } 17 | 18 | /// 19 | /// 初始化密钥AK/SK 20 | /// 21 | /// AccessKey 22 | /// SecretKey 23 | public Mac(string accessKey, string secretKey) 24 | { 25 | this.AccessKey = accessKey; 26 | this.SecretKey = secretKey; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Framework/Data/Core/Data.Abstractions/Attributes/PrecisionAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetModular.Lib.Data.Abstractions.Attributes 4 | { 5 | /// 6 | /// 小数精度 7 | /// 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class PrecisionAttribute : Attribute 10 | { 11 | /// 12 | /// 长度 13 | /// 14 | public int M { get; set; } 15 | 16 | /// 17 | /// 小数位长度 18 | /// 19 | public int D { get; set; } 20 | 21 | public PrecisionAttribute(int m, int d) 22 | { 23 | M = m; 24 | D = d; 25 | } 26 | 27 | public PrecisionAttribute() 28 | { 29 | M = 18; 30 | D = 4; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Framework/Utils/Utils.Core/Result/IResultModel.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | // ReSharper disable once CheckNamespace 4 | namespace NetModular 5 | { 6 | /// 7 | /// 返回结果模型接口 8 | /// 9 | public interface IResultModel 10 | { 11 | /// 12 | /// 是否成功 13 | /// 14 | [JsonIgnore] 15 | bool Successful { get; } 16 | 17 | /// 18 | /// 错误 19 | /// 20 | string Msg { get; } 21 | } 22 | 23 | /// 24 | /// 返回结果模型泛型接口 25 | /// 26 | /// 27 | public interface IResultModel : IResultModel 28 | { 29 | /// 30 | /// 返回数据 31 | /// 32 | T Data { get; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Admin/Library/Domain/RoleButton/RoleButtonEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NetModular.Lib.Data.Abstractions.Attributes; 3 | using NetModular.Lib.Data.Core.Entities; 4 | 5 | namespace NetModular.Module.Admin.Domain.RoleButton 6 | { 7 | /// 8 | /// 角色按钮绑定关系 9 | /// 10 | [Table("Role_Button")] 11 | public class RoleButtonEntity : Entity 12 | { 13 | /// 14 | /// 角色编号 15 | /// 16 | public Guid RoleId { get; set; } 17 | 18 | /// 19 | /// 页面编码 20 | /// 21 | [Length(200)] 22 | public string PageCode { get; set; } 23 | 24 | /// 25 | /// 按钮编码 26 | /// 27 | [Length(200)] 28 | public string ButtonCode { get; set; } 29 | } 30 | } 31 | --------------------------------------------------------------------------------