diff --git a/JiShe.CollectBus.Main.sln b/JiShe.CollectBus.Main.sln index 96fb672..3fa5f95 100644 --- a/JiShe.CollectBus.Main.sln +++ b/JiShe.CollectBus.Main.sln @@ -52,8 +52,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0.Docs", "0.Docs", "{D8346C Temp.Dockerfile = Temp.Dockerfile EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBus.Analyzers.Shared", "shared\JiShe.CollectBus.Analyzers.Shared\JiShe.CollectBus.Analyzers.Shared.csproj", "{DD68F314-BC66-5601-B094-B1A7BE93F4E0}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -112,10 +110,6 @@ Global {75B7D419-C261-577D-58D6-AA3ACED9129F}.Debug|Any CPU.Build.0 = Debug|Any CPU {75B7D419-C261-577D-58D6-AA3ACED9129F}.Release|Any CPU.ActiveCfg = Release|Any CPU {75B7D419-C261-577D-58D6-AA3ACED9129F}.Release|Any CPU.Build.0 = Release|Any CPU - {DD68F314-BC66-5601-B094-B1A7BE93F4E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD68F314-BC66-5601-B094-B1A7BE93F4E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD68F314-BC66-5601-B094-B1A7BE93F4E0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD68F314-BC66-5601-B094-B1A7BE93F4E0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -134,7 +128,6 @@ Global {8A61DF78-069B-40B5-8811-614E2960443E} = {3C3F9DB2-EC97-4464-B49F-BF1A0C2B46DC} {E27377CC-E2D3-4237-060F-96EA214D3129} = {3C3F9DB2-EC97-4464-B49F-BF1A0C2B46DC} {75B7D419-C261-577D-58D6-AA3ACED9129F} = {3C3F9DB2-EC97-4464-B49F-BF1A0C2B46DC} - {DD68F314-BC66-5601-B094-B1A7BE93F4E0} = {EBF7C01F-9B4F-48E6-8418-2CBFDA51EB0B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} diff --git a/protocols/JiShe.CollectBus.Protocol.Contracts/ProtocolPools/IPluginContainer.cs b/protocols/JiShe.CollectBus.Protocol.Contracts/ProtocolPools/IPluginContainer.cs deleted file mode 100644 index c34a1eb..0000000 --- a/protocols/JiShe.CollectBus.Protocol.Contracts/ProtocolPools/IPluginContainer.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace JiShe.CollectBus.Protocol.Contracts.ProtocolPools -{ - public interface IPluginContainer - { - } -} diff --git a/protocols/JiShe.CollectBus.Protocol.Contracts/ProtocolPools/PluginContainer.cs b/protocols/JiShe.CollectBus.Protocol.Contracts/ProtocolPools/PluginContainer.cs deleted file mode 100644 index 116eccc..0000000 --- a/protocols/JiShe.CollectBus.Protocol.Contracts/ProtocolPools/PluginContainer.cs +++ /dev/null @@ -1,26 +0,0 @@ -using JiShe.CollectBus.Interfaces; - -namespace JiShe.CollectBus.Protocol.Contracts.ProtocolPools -{ - public class PluginContainer: IPluginContainer - { - public Dictionary ProtocolPools; - - public PluginContainer() - { - - - } - - - } - - public static class ServiceProviderKeyedServiceExtensions - { - //public static Task AddKeyedSingleton(this IServiceProvider provider, string key) - //{ - // //var aa = Activator.CreateInstance(); - - //} - } -} diff --git a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusDbContext.cs b/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusDbContext.cs deleted file mode 100644 index bf57b27..0000000 --- a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusDbContext.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace JiShe.CollectBus.EntityFrameworkCore; - -[ConnectionStringName("Default")] -public class CollectBusDbContext : - AbpDbContext -{ - /* Add DbSet properties for your Aggregate Roots / Entities here. */ - - - #region Entities from the modules - - /* Notice: We only implemented IIdentityProDbContext and ISaasDbContext - * and replaced them for this DbContext. This allows you to perform JOIN - * queries for the entities of these modules over the repositories easily. You - * typically don't need that for other modules. But, if you need, you can - * implement the DbContext interface of the needed module and use ReplaceDbContext - * attribute just like IIdentityProDbContext and ISaasDbContext. - * - * More info: Replacing a DbContext of a module ensures that the related module - * uses this DbContext on runtime. Otherwise, it will use its own DbContext class. - */ - - #endregion - - public CollectBusDbContext(DbContextOptions options) - : base(options) - { - - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - } -} diff --git a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusDbContextFactory.cs b/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusDbContextFactory.cs deleted file mode 100644 index 07cc790..0000000 --- a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusDbContextFactory.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.IO; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; -using Microsoft.Extensions.Configuration; - -namespace JiShe.CollectBus.EntityFrameworkCore; - -/* This class is needed for EF Core console commands - * (like Add-Migration and Update-Database commands) */ -public class CollectBusDbContextFactory : IDesignTimeDbContextFactory -{ - public CollectBusDbContext CreateDbContext(string[] args) - { - var configuration = BuildConfiguration(); - - CollectBusEfCoreEntityExtensionMappings.Configure(); - - var builder = new DbContextOptionsBuilder() - .UseMySql(configuration.GetConnectionString("Default"), MySqlServerVersion.LatestSupportedServerVersion); - - return new CollectBusDbContext(builder.Options); - } - - private static IConfigurationRoot BuildConfiguration() - { - var builder = new ConfigurationBuilder() - .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../JiShe.CollectBus.DbMigrator/")) - .AddJsonFile("appsettings.json", optional: false); - - return builder.Build(); - } -} diff --git a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusEfCoreEntityExtensionMappings.cs b/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusEfCoreEntityExtensionMappings.cs deleted file mode 100644 index 8f002f3..0000000 --- a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusEfCoreEntityExtensionMappings.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Identity; -using Volo.Abp.ObjectExtending; -using Volo.Abp.Threading; - -namespace JiShe.CollectBus.EntityFrameworkCore; - -public static class CollectBusEfCoreEntityExtensionMappings -{ - private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); - - public static void Configure() - { - CollectBusGlobalFeatureConfigurator.Configure(); - CollectBusModuleExtensionConfigurator.Configure(); - - OneTimeRunner.Run(() => - { - /* You can configure extra properties for the - * entities defined in the modules used by your application. - * - * This class can be used to map these extra properties to table fields in the database. - * - * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING. - * USE CollectBusModuleExtensionConfigurator CLASS (in the Domain.Shared project) - * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES - * - * Example: Map a property to a table field: - - ObjectExtensionManager.Instance - .MapEfCoreProperty( - "MyProperty", - (entityBuilder, propertyBuilder) => - { - propertyBuilder.HasMaxLength(128); - } - ); - - * See the documentation for more: - * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities - */ - }); - } -} diff --git a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusEntityFrameworkCoreModule.cs b/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusEntityFrameworkCoreModule.cs deleted file mode 100644 index bb34e67..0000000 --- a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/CollectBusEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AuditLogging.EntityFrameworkCore; -using Volo.Abp.BackgroundJobs.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore.MySQL; -using Volo.Abp.FeatureManagement.EntityFrameworkCore; -using Volo.Abp.Identity.EntityFrameworkCore; -using Volo.Abp.Modularity; -using Volo.Abp.PermissionManagement.EntityFrameworkCore; -using Volo.Abp.SettingManagement.EntityFrameworkCore; -using Volo.Abp.BlobStoring.Database.EntityFrameworkCore; - -namespace JiShe.CollectBus.EntityFrameworkCore; - -[DependsOn( - typeof(CollectBusDomainModule), - typeof(AbpPermissionManagementEntityFrameworkCoreModule), - typeof(AbpSettingManagementEntityFrameworkCoreModule), - typeof(AbpEntityFrameworkCoreMySQLModule), - typeof(AbpBackgroundJobsEntityFrameworkCoreModule), - typeof(AbpAuditLoggingEntityFrameworkCoreModule), - typeof(AbpFeatureManagementEntityFrameworkCoreModule), - typeof(AbpIdentityEntityFrameworkCoreModule), - typeof(BlobStoringDatabaseEntityFrameworkCoreModule) - )] -public class CollectBusEntityFrameworkCoreModule : AbpModule -{ - public override void PreConfigureServices(ServiceConfigurationContext context) - { - - CollectBusEfCoreEntityExtensionMappings.Configure(); - } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAbpDbContext(options => - { - /* Remove "includeAllEntities: true" to create - * default repositories only for aggregate roots */ - options.AddDefaultRepositories(includeAllEntities: true); - }); - - Configure(options => - { - /* The main point to change your DBMS. - * See also CollectBusDbContextFactory for EF Core tooling. */ - options.UseMySQL(); - }); - } -} diff --git a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreCollectBusDbSchemaMigrator.cs b/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreCollectBusDbSchemaMigrator.cs deleted file mode 100644 index 2b3509a..0000000 --- a/services/JiShe.CollectBus.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreCollectBusDbSchemaMigrator.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using JiShe.CollectBus.Data; -using Volo.Abp.DependencyInjection; - -namespace JiShe.CollectBus.EntityFrameworkCore; - -public class EntityFrameworkCoreCollectBusDbSchemaMigrator - : ICollectBusDbSchemaMigrator, ITransientDependency -{ - private readonly IServiceProvider _serviceProvider; - - public EntityFrameworkCoreCollectBusDbSchemaMigrator(IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - } - - public async Task MigrateAsync() - { - /* We intentionally resolving the CollectBusDbContext - * from IServiceProvider (instead of directly injecting it) - * to properly get the connection string of the current tenant in the - * current scope. - */ - - await _serviceProvider - .GetRequiredService() - .Database - .MigrateAsync(); - } -} diff --git a/services/JiShe.CollectBus.EntityFrameworkCore/FodyWeavers.xml b/services/JiShe.CollectBus.EntityFrameworkCore/FodyWeavers.xml deleted file mode 100644 index 00e1d9a..0000000 --- a/services/JiShe.CollectBus.EntityFrameworkCore/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/services/JiShe.CollectBus.EntityFrameworkCore/JiShe.CollectBus.EntityFrameworkCore.abppkg b/services/JiShe.CollectBus.EntityFrameworkCore/JiShe.CollectBus.EntityFrameworkCore.abppkg deleted file mode 100644 index e1c64f0..0000000 --- a/services/JiShe.CollectBus.EntityFrameworkCore/JiShe.CollectBus.EntityFrameworkCore.abppkg +++ /dev/null @@ -1,3 +0,0 @@ -{ - "role": "lib.ef" -} \ No newline at end of file diff --git a/services/JiShe.CollectBus.EntityFrameworkCore/JiShe.CollectBus.EntityFrameworkCore.csproj b/services/JiShe.CollectBus.EntityFrameworkCore/JiShe.CollectBus.EntityFrameworkCore.csproj deleted file mode 100644 index e6a6338..0000000 --- a/services/JiShe.CollectBus.EntityFrameworkCore/JiShe.CollectBus.EntityFrameworkCore.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - net8.0 - enable - JiShe.CollectBus - - - - - - - - - - - - - - - - - - - - - - - - - - - runtime; build; native; contentfiles; analyzers - compile; contentFiles; build; buildMultitargeting; buildTransitive; analyzers; native - - - - diff --git a/services/JiShe.CollectBus.EntityFrameworkCore/Properties/AssemblyInfo.cs b/services/JiShe.CollectBus.EntityFrameworkCore/Properties/AssemblyInfo.cs deleted file mode 100644 index 23df7c8..0000000 --- a/services/JiShe.CollectBus.EntityFrameworkCore/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,2 +0,0 @@ -using System.Runtime.CompilerServices; -[assembly:InternalsVisibleToAttribute("JiShe.CollectBus.EntityFrameworkCore.Tests")] diff --git a/shared/JiShe.CollectBus.Analyzers.Shared/EntityMemberInfo.cs b/shared/JiShe.CollectBus.Analyzers.Shared/EntityMemberInfo.cs deleted file mode 100644 index 523a5df..0000000 --- a/shared/JiShe.CollectBus.Analyzers.Shared/EntityMemberInfo.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace JiShe.CollectBus.Analyzers.Shared -{ - /// - /// 实体成员信息 - /// - public sealed class EntityMemberInfo - { - /// - /// 名称或者路径 - /// - public string NameOrPath { get; set; } - - /// - /// 声明的类型 - /// - public Type DeclaredType { get; set; } - - /// - /// 声明的类型的名称 - /// - public string DeclaredTypeName { get; } - - /// - /// 获取值 - /// - public Func Getter { get; } - - /// - /// 设置值 - /// - public Action Setter { get; } - - /// - /// 自定义Attribute集合 - /// - public List CustomAttributes { get; set; } - - - public EntityMemberInfo( - string nameOrPath, - Type declaredType, - string declaredTypeName, - Func getter, - Action setter) - { - NameOrPath = nameOrPath; - this.DeclaredType = declaredType; - DeclaredTypeName = declaredTypeName; - Getter = getter; - Setter = setter; - } - - public object GetValue(object entity) => Getter(entity); - public void SetValue(object entity, object value) => Setter(entity, value); - } -} diff --git a/shared/JiShe.CollectBus.Analyzers.Shared/EntityTypeEnum.cs b/shared/JiShe.CollectBus.Analyzers.Shared/EntityTypeEnum.cs deleted file mode 100644 index bddaa86..0000000 --- a/shared/JiShe.CollectBus.Analyzers.Shared/EntityTypeEnum.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace JiShe.CollectBus.Analyzers.Shared -{ - /// - /// 实体类型枚举 - /// - public enum EntityTypeEnum - { - /// - /// IoTDB树模型 - /// - TreeModel = 1, - - /// - /// IoTDB表模型 - /// - TableModel = 2, - - /// - /// 其他情况 - /// - Other = 3 - } -} diff --git a/shared/JiShe.CollectBus.Analyzers.Shared/ISourceEntityAccessor.cs b/shared/JiShe.CollectBus.Analyzers.Shared/ISourceEntityAccessor.cs deleted file mode 100644 index 2c3a5b0..0000000 --- a/shared/JiShe.CollectBus.Analyzers.Shared/ISourceEntityAccessor.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; - -namespace JiShe.CollectBus.Analyzers.Shared -{ - public interface ISourceEntityAccessor - { - /// - /// 实体类名称 - /// - string EntityName { get; } - - /// - /// 实体类型 - /// - EntityTypeEnum? EntityType { get;} - - /// - /// 获取属性值 - /// - /// - /// - /// - object GetPropertyValue(T entity, string propertyName); - - /// - /// 设置属性值 - /// - /// - /// - /// - void SetPropertyValue(T entity, string propertyName, object value); - - /// - /// 属性名称集合 - /// - List PropertyNameList { get; } - - /// - /// 属性信息集合 - /// - List MemberList { get; } - } -} diff --git a/shared/JiShe.CollectBus.Analyzers.Shared/JiShe.CollectBus.Analyzers.Shared.csproj b/shared/JiShe.CollectBus.Analyzers.Shared/JiShe.CollectBus.Analyzers.Shared.csproj deleted file mode 100644 index 3ae7562..0000000 --- a/shared/JiShe.CollectBus.Analyzers.Shared/JiShe.CollectBus.Analyzers.Shared.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - netstandard2.0 - - - diff --git a/shared/JiShe.CollectBus.Analyzers.Shared/SourceAnalyzersAttribute.cs b/shared/JiShe.CollectBus.Analyzers.Shared/SourceAnalyzersAttribute.cs deleted file mode 100644 index ad02607..0000000 --- a/shared/JiShe.CollectBus.Analyzers.Shared/SourceAnalyzersAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace JiShe.CollectBus.Analyzers.Shared -{ - /// - /// 标记需要生成源码的类 - /// - [AttributeUsage(AttributeTargets.Class)] - public class SourceAnalyzersAttribute : Attribute - { - public EntityTypeEnum EntityType { get; } - - - public SourceAnalyzersAttribute(EntityTypeEnum entityType) - { - EntityType = entityType; - } - } -}