From 2d765cdb960f009734236666b4b6fac3962a1b57 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 24 Apr 2026 16:56:50 +0800 Subject: [PATCH] feat: Optimize the data export interface --- .../AbpExporterMagicodesIEExcelModule.cs | 13 ------------- .../Exporter/MagicodesIEExcelExporterProvider.cs | 5 +++++ .../Exporter/MagicodesIEExcelImporterProvider.cs | 4 ++++ .../Abp/Exporter/AbpExporterMiniExcelModule.cs | 16 +--------------- .../Abp/Exporter/MiniExcelExporterProvider.cs | 6 ++++++ .../Abp/Exporter/MiniExcelImporterProvider.cs | 6 ++++++ .../MiniSoftware/MiniExcelExporterProvider.cs | 4 ++++ .../MiniSoftware/MiniExcelImporterProvider.cs | 5 +++++ 8 files changed, 31 insertions(+), 28 deletions(-) diff --git a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpExporterMagicodesIEExcelModule.cs b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpExporterMagicodesIEExcelModule.cs index 534b82df1..6d0f59f7f 100644 --- a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpExporterMagicodesIEExcelModule.cs +++ b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpExporterMagicodesIEExcelModule.cs @@ -1,7 +1,6 @@ using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; using Volo.Abp.Modularity; namespace LINGYUN.Abp.Exporter.MagicodesIE.Excel; @@ -12,19 +11,7 @@ public class AbpExporterMagicodesIEExcelModule : AbpModule public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddScoped(); - context.Services.AddScoped(); - context.Services.AddScoped(); - - context.Services.Replace( - ServiceDescriptor.Transient( - typeof(IExporterProvider), - typeof(MagicodesIEExcelExporterProvider))); - - context.Services.Replace( - ServiceDescriptor.Transient( - typeof(IImporterProvider), - typeof(MagicodesIEExcelImporterProvider))); } } \ No newline at end of file diff --git a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelExporterProvider.cs b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelExporterProvider.cs index dd30f5e7e..0870369a1 100644 --- a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelExporterProvider.cs +++ b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelExporterProvider.cs @@ -9,6 +9,11 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; namespace LINGYUN.Abp.Exporter.MagicodesIE.Excel; + +#pragma warning disable CS0618 +[ExposeServices(typeof(IExporterProvider))] +#pragma warning restore CS0618 +[ExposeServices(typeof(IExcelExporterProvider))] public class MagicodesIEExcelExporterProvider : IExcelExporterProvider, #pragma warning disable CS0618 diff --git a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelImporterProvider.cs b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelImporterProvider.cs index 34c9e47c4..ca847c5fb 100644 --- a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelImporterProvider.cs +++ b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelImporterProvider.cs @@ -12,6 +12,10 @@ using Volo.Abp.Json; namespace LINGYUN.Abp.Exporter.MagicodesIE.Excel; +#pragma warning disable CS0618 +[ExposeServices(typeof(IImporterProvider))] +#pragma warning restore CS0618 +[ExposeServices(typeof(IExcelImporterProvider))] public class MagicodesIEExcelImporterProvider : IExcelImporterProvider, #pragma warning disable CS0618 diff --git a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/AbpExporterMiniExcelModule.cs b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/AbpExporterMiniExcelModule.cs index 413f8d8b3..10a1ed554 100644 --- a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/AbpExporterMiniExcelModule.cs +++ b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/AbpExporterMiniExcelModule.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; -using System; +using System; using Volo.Abp.Modularity; namespace LINGYUN.Abp.Exporter.MiniExcel; @@ -9,16 +7,4 @@ namespace LINGYUN.Abp.Exporter.MiniExcel; [DependsOn(typeof(AbpExporterCoreModule))] public class AbpExporterMiniExcelModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.Replace( - ServiceDescriptor.Transient( - typeof(IExporterProvider), - typeof(MiniExcelExporterProvider))); - - context.Services.Replace( - ServiceDescriptor.Transient( - typeof(IImporterProvider), - typeof(MiniExcelImporterProvider))); - } } \ No newline at end of file diff --git a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelExporterProvider.cs b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelExporterProvider.cs index 3d0c0f473..a2ac56433 100644 --- a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelExporterProvider.cs +++ b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelExporterProvider.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Options; using MiniExcelLibs; using MiniExcelLibs.OpenXml; +using System; using System.Collections.Generic; using System.IO; using System.Threading; @@ -8,6 +9,11 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; namespace LINGYUN.Abp.Exporter.MiniExcel; + +#pragma warning disable CS0618 +[ExposeServices(typeof(IExporterProvider))] +#pragma warning restore CS0618 +[Obsolete("Use AbpExporterMiniSoftwareModule")] public class MiniExcelExporterProvider : IExporterProvider, ITransientDependency { private readonly AbpExporterMiniExcelOptions _options; diff --git a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelImporterProvider.cs b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelImporterProvider.cs index f655dc333..582877234 100644 --- a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelImporterProvider.cs +++ b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelImporterProvider.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Options; using MiniExcelLibs; using MiniExcelLibs.OpenXml; +using System; using System.Collections.Generic; using System.Collections.Immutable; using System.IO; @@ -8,6 +9,11 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; namespace LINGYUN.Abp.Exporter.MiniExcel; + +#pragma warning disable CS0618 +[ExposeServices(typeof(IImporterProvider))] +#pragma warning restore CS0618 +[Obsolete("Use AbpExporterMiniSoftwareModule")] public class MiniExcelImporterProvider : IImporterProvider, ITransientDependency { private readonly AbpExporterMiniExcelOptions _options; diff --git a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniSoftware/LINGYUN/Abp/Exporter/MiniSoftware/MiniExcelExporterProvider.cs b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniSoftware/LINGYUN/Abp/Exporter/MiniSoftware/MiniExcelExporterProvider.cs index c7ae06be2..165102775 100644 --- a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniSoftware/LINGYUN/Abp/Exporter/MiniSoftware/MiniExcelExporterProvider.cs +++ b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniSoftware/LINGYUN/Abp/Exporter/MiniSoftware/MiniExcelExporterProvider.cs @@ -10,6 +10,10 @@ using Volo.Abp.DependencyInjection; namespace LINGYUN.Abp.Exporter.MiniSoftware; +#pragma warning disable CS0618 +[ExposeServices(typeof(IExporterProvider))] +#pragma warning restore CS0618 +[ExposeServices(typeof(IExcelExporterProvider))] public class MiniExcelExporterProvider : IExcelExporterProvider, #pragma warning disable CS0618 diff --git a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniSoftware/LINGYUN/Abp/Exporter/MiniSoftware/MiniExcelImporterProvider.cs b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniSoftware/LINGYUN/Abp/Exporter/MiniSoftware/MiniExcelImporterProvider.cs index 1daf8a318..d3319839e 100644 --- a/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniSoftware/LINGYUN/Abp/Exporter/MiniSoftware/MiniExcelImporterProvider.cs +++ b/aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniSoftware/LINGYUN/Abp/Exporter/MiniSoftware/MiniExcelImporterProvider.cs @@ -8,6 +8,11 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; namespace LINGYUN.Abp.Exporter.MiniSoftware; + +#pragma warning disable CS0618 +[ExposeServices(typeof(IImporterProvider))] +#pragma warning restore CS0618 +[ExposeServices(typeof(IExcelImporterProvider))] public class MiniExcelImporterProvider : IExcelImporterProvider, #pragma warning disable CS0618