diff --git a/JiShe.CollectBus.sln b/JiShe.CollectBus.sln index 272514c..c32791b 100644 --- a/JiShe.CollectBus.sln +++ b/JiShe.CollectBus.sln @@ -74,6 +74,26 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBus.Migration. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBus.Migration.HttpApi", "web\JiShe.CollectBus.Migration.HttpApi\JiShe.CollectBus.Migration.HttpApi.csproj", "{8A113DE5-7D50-6E6B-739F-B6EEAD5E13B4}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MainService", "MainService", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EPOService", "EPOService", "{18207368-3C39-4346-85F7-A8B499B0B458}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MigrationService", "MigrationService", "{A31EC18C-956B-4FD2-AED6-609C33B467E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBusEPO.Application.Contracts", "services\JiShe.CollectBusEPO.Application.Contracts\JiShe.CollectBusEPO.Application.Contracts.csproj", "{3B32D838-33BF-C08A-C447-3172CA62D42F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBusEPO.Application", "services\JiShe.CollectBusEPO.Application\JiShe.CollectBusEPO.Application.csproj", "{C71FF348-FB47-67E6-AF0D-6A8E48C5EDEA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBusEPO.HttpApi", "web\JiShe.CollectBusEPO.HttpApi\JiShe.CollectBusEPO.HttpApi.csproj", "{98FE468D-0C34-83D9-31BD-F59C44D00357}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBusEPO.HttpApi.Host", "web\JiShe.CollectBusEPO.HttpApi.Host\JiShe.CollectBusEPO.HttpApi.Host.csproj", "{A2DDA6F0-C760-0633-D576-E23A186504E4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MainHost", "MainHost", "{A38B5EB3-2F55-44A2-944B-31A73DE91402}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MigrationHost", "MigrationHost", "{C61007F8-51F5-409C-9FAF-DEF6A24DCDED}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EPOHost", "EPOHost", "{8D1FD3D9-3FF0-4581-ACF0-45AF9D595774}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -184,6 +204,22 @@ Global {8A113DE5-7D50-6E6B-739F-B6EEAD5E13B4}.Debug|Any CPU.Build.0 = Debug|Any CPU {8A113DE5-7D50-6E6B-739F-B6EEAD5E13B4}.Release|Any CPU.ActiveCfg = Release|Any CPU {8A113DE5-7D50-6E6B-739F-B6EEAD5E13B4}.Release|Any CPU.Build.0 = Release|Any CPU + {3B32D838-33BF-C08A-C447-3172CA62D42F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B32D838-33BF-C08A-C447-3172CA62D42F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B32D838-33BF-C08A-C447-3172CA62D42F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B32D838-33BF-C08A-C447-3172CA62D42F}.Release|Any CPU.Build.0 = Release|Any CPU + {C71FF348-FB47-67E6-AF0D-6A8E48C5EDEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C71FF348-FB47-67E6-AF0D-6A8E48C5EDEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C71FF348-FB47-67E6-AF0D-6A8E48C5EDEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C71FF348-FB47-67E6-AF0D-6A8E48C5EDEA}.Release|Any CPU.Build.0 = Release|Any CPU + {98FE468D-0C34-83D9-31BD-F59C44D00357}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98FE468D-0C34-83D9-31BD-F59C44D00357}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98FE468D-0C34-83D9-31BD-F59C44D00357}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98FE468D-0C34-83D9-31BD-F59C44D00357}.Release|Any CPU.Build.0 = Release|Any CPU + {A2DDA6F0-C760-0633-D576-E23A186504E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2DDA6F0-C760-0633-D576-E23A186504E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2DDA6F0-C760-0633-D576-E23A186504E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2DDA6F0-C760-0633-D576-E23A186504E4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -191,11 +227,11 @@ Global GlobalSection(NestedProjects) = preSolution {D64C1577-4929-4B60-939E-96DE1534891A} = {EBF7C01F-9B4F-48E6-8418-2CBFDA51EB0B} {F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {BA4DA3E7-9AD0-47AD-A0E6-A0BB6700DA23} - {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {BA4DA3E7-9AD0-47AD-A0E6-A0BB6700DA23} - {78040F9E-3501-4A40-82DF-00A597710F35} = {BA4DA3E7-9AD0-47AD-A0E6-A0BB6700DA23} + {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {78040F9E-3501-4A40-82DF-00A597710F35} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} {F1C58097-4C08-4D88-8976-6B3389391481} = {2E0FE301-34C3-4561-9CAE-C7A9E65AEE59} - {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {A02F7D8A-04DC-44D6-94D4-3F65712D6B94} - {35829A15-4127-4F69-8BDE-9405DEAACA9A} = {A02F7D8A-04DC-44D6-94D4-3F65712D6B94} + {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {A38B5EB3-2F55-44A2-944B-31A73DE91402} + {35829A15-4127-4F69-8BDE-9405DEAACA9A} = {A38B5EB3-2F55-44A2-944B-31A73DE91402} {AD2F1928-4411-4511-B564-5FB996EC08B9} = {EBF7C01F-9B4F-48E6-8418-2CBFDA51EB0B} {8BA01C3D-297D-42DF-BD63-EF07202A0A67} = {BA4DA3E7-9AD0-47AD-A0E6-A0BB6700DA23} {FE0457D9-4038-4A17-8808-DCAD06CFC0A0} = {2E0FE301-34C3-4561-9CAE-C7A9E65AEE59} @@ -211,10 +247,20 @@ Global {75B7D419-C261-577D-58D6-AA3ACED9129F} = {3C3F9DB2-EC97-4464-B49F-BF1A0C2B46DC} {DD68F314-BC66-5601-B094-B1A7BE93F4E0} = {EBF7C01F-9B4F-48E6-8418-2CBFDA51EB0B} {EB97C7BB-1E4A-CBA4-04C1-22DBF48A253A} = {2E0FE301-34C3-4561-9CAE-C7A9E65AEE59} - {E01625B5-B5B7-7A4B-468F-EC12C1BDBA2A} = {BA4DA3E7-9AD0-47AD-A0E6-A0BB6700DA23} - {B955C5DA-3C20-35D2-0770-8FE473C41C44} = {BA4DA3E7-9AD0-47AD-A0E6-A0BB6700DA23} - {995D3D91-7221-D4A3-A7B2-FEC202328A18} = {A02F7D8A-04DC-44D6-94D4-3F65712D6B94} - {8A113DE5-7D50-6E6B-739F-B6EEAD5E13B4} = {A02F7D8A-04DC-44D6-94D4-3F65712D6B94} + {E01625B5-B5B7-7A4B-468F-EC12C1BDBA2A} = {A31EC18C-956B-4FD2-AED6-609C33B467E9} + {B955C5DA-3C20-35D2-0770-8FE473C41C44} = {A31EC18C-956B-4FD2-AED6-609C33B467E9} + {995D3D91-7221-D4A3-A7B2-FEC202328A18} = {C61007F8-51F5-409C-9FAF-DEF6A24DCDED} + {8A113DE5-7D50-6E6B-739F-B6EEAD5E13B4} = {C61007F8-51F5-409C-9FAF-DEF6A24DCDED} + {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {BA4DA3E7-9AD0-47AD-A0E6-A0BB6700DA23} + {18207368-3C39-4346-85F7-A8B499B0B458} = {BA4DA3E7-9AD0-47AD-A0E6-A0BB6700DA23} + {A31EC18C-956B-4FD2-AED6-609C33B467E9} = {BA4DA3E7-9AD0-47AD-A0E6-A0BB6700DA23} + {3B32D838-33BF-C08A-C447-3172CA62D42F} = {18207368-3C39-4346-85F7-A8B499B0B458} + {C71FF348-FB47-67E6-AF0D-6A8E48C5EDEA} = {18207368-3C39-4346-85F7-A8B499B0B458} + {98FE468D-0C34-83D9-31BD-F59C44D00357} = {8D1FD3D9-3FF0-4581-ACF0-45AF9D595774} + {A2DDA6F0-C760-0633-D576-E23A186504E4} = {8D1FD3D9-3FF0-4581-ACF0-45AF9D595774} + {A38B5EB3-2F55-44A2-944B-31A73DE91402} = {A02F7D8A-04DC-44D6-94D4-3F65712D6B94} + {C61007F8-51F5-409C-9FAF-DEF6A24DCDED} = {A02F7D8A-04DC-44D6-94D4-3F65712D6B94} + {8D1FD3D9-3FF0-4581-ACF0-45AF9D595774} = {A02F7D8A-04DC-44D6-94D4-3F65712D6B94} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} diff --git a/modules/JiShe.CollectBus.IoTDB/SourceEntityAccessorFactory3.cs b/modules/JiShe.CollectBus.IoTDB/SourceEntityAccessorFactory3.cs new file mode 100644 index 0000000..4712b67 --- /dev/null +++ b/modules/JiShe.CollectBus.IoTDB/SourceEntityAccessorFactory3.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Concurrent; +using System.Reflection; + +namespace JiShe.CollectBus.Analyzers.Shared; + +public static class SourceEntityAccessorFactory3 +{ + private static readonly ConcurrentDictionary _accessors = new(); + + public static ISourceEntityAccessor GetAccessor() + { + return (ISourceEntityAccessor)_accessors.GetOrAdd(typeof(T), t => + { + // 获取泛型类型定义信息(如果是泛型类型) + var isGeneric = t.IsGenericType; + var genericTypeDef = isGeneric ? t.GetGenericTypeDefinition() : null; + var arity = isGeneric ? genericTypeDef!.GetGenericArguments().Length : 0; + + // 构建访问器类名 + var typeName = isGeneric + ? $"{t.Namespace}.{genericTypeDef!.Name.Split('`')[0]}Accessor`{arity}" + : $"{t.Namespace}.{t.Name}Accessor"; + + // 尝试从当前程序集加载 + var accessorType = Assembly.GetAssembly(t)!.GetType(typeName) + ?? throw new InvalidOperationException($"Accessor type {typeName} not found"); + + // 处理泛型参数 + if (isGeneric && accessorType.IsGenericTypeDefinition) + { + accessorType = accessorType.MakeGenericType(t.GetGenericArguments()); + } + + return Activator.CreateInstance(accessorType)!; + }); + } + + public static object GetAccessor(Type type) + { + MethodInfo getAccessorMethod = typeof(SourceEntityAccessorFactory) + .GetMethod( + name: nameof(GetAccessor), + bindingAttr: BindingFlags.Public | BindingFlags.Static, + + types: Type.EmptyTypes + ); + + MethodInfo genericMethod = getAccessorMethod.MakeGenericMethod(type); + return genericMethod.Invoke(null, null); + } +} \ No newline at end of file diff --git a/services/JiShe.CollectBus.Application/CollectBusApplicationModule.cs b/services/JiShe.CollectBus.Application/CollectBusApplicationModule.cs index b146d6f..942befc 100644 --- a/services/JiShe.CollectBus.Application/CollectBusApplicationModule.cs +++ b/services/JiShe.CollectBus.Application/CollectBusApplicationModule.cs @@ -19,8 +19,10 @@ using System.Threading.Channels; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application; +using Volo.Abp.AuditLogging; using Volo.Abp.Autofac; using Volo.Abp.AutoMapper; +using Volo.Abp.BackgroundJobs; using Volo.Abp.BackgroundWorkers; using Volo.Abp.BackgroundWorkers.Hangfire; using Volo.Abp.Modularity; @@ -38,6 +40,9 @@ namespace JiShe.CollectBus; typeof(CollectBusFreeSqlModule), typeof(CollectBusKafkaModule), typeof(CollectBusIoTDbModule), + typeof(CollectBusDomainSharedModule), + typeof(AbpAuditLoggingDomainModule), + typeof(AbpBackgroundJobsDomainModule), typeof(CollectBusCassandraModule), typeof(CollectBusProtocolModule) )] diff --git a/services/JiShe.CollectBus.Application/ScheduledMeterReading/BasicScheduledMeterReadingService.cs b/services/JiShe.CollectBus.Application/ScheduledMeterReading/BasicScheduledMeterReadingService.cs index f53b21a..85a71d8 100644 --- a/services/JiShe.CollectBus.Application/ScheduledMeterReading/BasicScheduledMeterReadingService.cs +++ b/services/JiShe.CollectBus.Application/ScheduledMeterReading/BasicScheduledMeterReadingService.cs @@ -1169,19 +1169,19 @@ namespace JiShe.CollectBus.ScheduledMeterReading item.ItemCodes = new List() { T37612012PacketItemCodeConst.AFN0CHFN129H }; } } - else if (item.MeterTypeName.Trim().Equals("西恩超声波流量计")) + else if (item.MeterTypeName.Equals("流量计") && item.BrandType.Trim().Equals("西恩超声波流量计")) { item.ItemCodes = new List() { T37612012PacketItemCodeConst.AFN09HFN01H }; } - else if (item.MeterTypeName.Trim().Equals("江苏华海涡街流量计积算仪")) + else if (item.MeterTypeName.Equals("流量计") && item.BrandType.Trim().Equals("江苏华海涡街流量计积算仪")) { item.ItemCodes = new List() { T37612012PacketItemCodeConst.AFN09HFN01H }; } - else if (item.MeterTypeName.Trim().Equals("V880BR涡街流量计")) + else if (item.MeterTypeName.Equals("流量计") && item.BrandType.Trim().Equals("V880BR涡街流量计")) { item.ItemCodes = new List() { T37612012PacketItemCodeConst.AFN09HFN01H }; } - else if (item.MeterTypeName.Trim().Equals("拓思特涡街流量计H880BR")) + else if (item.MeterTypeName.Equals("流量计") && item.BrandType.Trim().Equals("拓思特涡街流量计H880BR")) { item.ItemCodes = new List() { T37612012PacketItemCodeConst.AFN09HFN01H }; } diff --git a/services/JiShe.CollectBus.Application/ScheduledMeterReading/EnergySystemScheduledMeterReadingService.cs b/services/JiShe.CollectBus.Application/ScheduledMeterReading/EnergySystemScheduledMeterReadingService.cs index f13a158..762d001 100644 --- a/services/JiShe.CollectBus.Application/ScheduledMeterReading/EnergySystemScheduledMeterReadingService.cs +++ b/services/JiShe.CollectBus.Application/ScheduledMeterReading/EnergySystemScheduledMeterReadingService.cs @@ -600,12 +600,14 @@ namespace JiShe.CollectBus.ScheduledMeterReading TypeName = 1, TimeDensity = 60, BrandType = "云集", + MeterTypeName = "水表", MeterType = MeterTypeEnum.WaterMeter, ProjectID = 1, MeteringPort = MeteringPortConst.MeteringPortTwo, Password = "000000", LinkType = "RS-485", - TimesRate = 1.0000m, + TimesRate = 1.0000m, + Protocol = 30, }); FreeRedisProvider.Instance.Set(redisCacheDeviceInfoHashKeyTemp, deviceInfos); diff --git a/services/JiShe.CollectBus.Domain/CollectBusDomainModule.cs b/services/JiShe.CollectBus.Domain/CollectBusDomainModule.cs index 24945de..b09cbf8 100644 --- a/services/JiShe.CollectBus.Domain/CollectBusDomainModule.cs +++ b/services/JiShe.CollectBus.Domain/CollectBusDomainModule.cs @@ -10,10 +10,7 @@ using Volo.Abp.Emailing; namespace JiShe.CollectBus; [DependsOn( - typeof(CollectBusDomainSharedModule), - typeof(AbpAuditLoggingDomainModule), - typeof(AbpCachingModule), - typeof(AbpBackgroundJobsDomainModule) + typeof(AbpCachingModule) )] public class CollectBusDomainModule : AbpModule { diff --git a/services/JiShe.CollectBusEPO.Application.Contracts/CollectBusEPOApplicationContractsModule.cs b/services/JiShe.CollectBusEPO.Application.Contracts/CollectBusEPOApplicationContractsModule.cs new file mode 100644 index 0000000..1f538b1 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application.Contracts/CollectBusEPOApplicationContractsModule.cs @@ -0,0 +1,16 @@ +using JiShe.CollectBus; + +namespace JiShe.CollectBusEPO +{ + [DependsOn( + typeof(CollectBusDomainSharedModule), + typeof(AbpObjectExtendingModule) + )] + public class CollectBusEPOApplicationContractsModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + CollectBusEPODtoExtensions.Configure(); + } + } +} diff --git a/services/JiShe.CollectBusEPO.Application.Contracts/CollectBusEPODtoExtensions.cs b/services/JiShe.CollectBusEPO.Application.Contracts/CollectBusEPODtoExtensions.cs new file mode 100644 index 0000000..02e750a --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application.Contracts/CollectBusEPODtoExtensions.cs @@ -0,0 +1,25 @@ +namespace JiShe.CollectBusEPO +{ + public static class CollectBusEPODtoExtensions + { + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can add extension properties to DTOs + * defined in the depended modules. + * + * Example: + * + * ObjectExtensionManager.Instance + * .AddOrUpdateProperty("Title"); + * + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Object-Extensions + */ + }); + } + } +} \ No newline at end of file diff --git a/services/JiShe.CollectBusEPO.Application.Contracts/Files/FileUploadOutputDto.cs b/services/JiShe.CollectBusEPO.Application.Contracts/Files/FileUploadOutputDto.cs new file mode 100644 index 0000000..4ddfa20 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application.Contracts/Files/FileUploadOutputDto.cs @@ -0,0 +1,7 @@ +namespace JiShe.CollectBusEPO.Files; + +public class FileUploadOutputDto +{ + public string Name { get; set; } + public string Path { get; set; } +} diff --git a/services/JiShe.CollectBusEPO.Application.Contracts/GlobalUsings.cs b/services/JiShe.CollectBusEPO.Application.Contracts/GlobalUsings.cs new file mode 100644 index 0000000..7e82668 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application.Contracts/GlobalUsings.cs @@ -0,0 +1,11 @@ +// Global using directives + +global using System; +global using System.Threading.Tasks; +global using Volo.Abp.Application.Services; +global using Volo.Abp.Authorization.Permissions; +global using Volo.Abp.DependencyInjection; +global using Volo.Abp.Localization; +global using Volo.Abp.Modularity; +global using Volo.Abp.ObjectExtending; +global using Volo.Abp.Threading; \ No newline at end of file diff --git a/services/JiShe.CollectBusEPO.Application.Contracts/JiShe.CollectBusEPO.Application.Contracts.csproj b/services/JiShe.CollectBusEPO.Application.Contracts/JiShe.CollectBusEPO.Application.Contracts.csproj new file mode 100644 index 0000000..23e52c4 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application.Contracts/JiShe.CollectBusEPO.Application.Contracts.csproj @@ -0,0 +1,17 @@ + + + net8.0 + JiShe.CollectBusEPO + + + + + + + + + + + + + diff --git a/services/JiShe.CollectBusEPO.Application.Contracts/Jobs/IRecurringJob.cs b/services/JiShe.CollectBusEPO.Application.Contracts/Jobs/IRecurringJob.cs new file mode 100644 index 0000000..6f4df53 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application.Contracts/Jobs/IRecurringJob.cs @@ -0,0 +1,11 @@ +namespace JiShe.CollectBusEPO.Jobs +{ + public interface IRecurringJob : ITransientDependency + { + /// + /// 执行任务 + /// + /// + Task ExecuteAsync(); + } +} \ No newline at end of file diff --git a/services/JiShe.CollectBusEPO.Application.Contracts/Permissions/CollectBusEPOPermissionDefinitionProvider.cs b/services/JiShe.CollectBusEPO.Application.Contracts/Permissions/CollectBusEPOPermissionDefinitionProvider.cs new file mode 100644 index 0000000..1b673bd --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application.Contracts/Permissions/CollectBusEPOPermissionDefinitionProvider.cs @@ -0,0 +1,17 @@ +using JiShe.CollectBus.Localization; + +namespace JiShe.CollectBusEPO.Permissions +{ + public class CollectBusEPOPermissionDefinitionProvider : PermissionDefinitionProvider + { + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(CollectBusEPOPermissions.GroupName, L("Permission:CollectBus")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} \ No newline at end of file diff --git a/services/JiShe.CollectBusEPO.Application.Contracts/Permissions/CollectBusEPOPermissions.cs b/services/JiShe.CollectBusEPO.Application.Contracts/Permissions/CollectBusEPOPermissions.cs new file mode 100644 index 0000000..7acba86 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application.Contracts/Permissions/CollectBusEPOPermissions.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Reflection; + +namespace JiShe.CollectBusEPO.Permissions +{ + public static class CollectBusEPOPermissions + { + public const string GroupName = "CollectBusEPO"; + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(CollectBusEPOPermissions)); + } + + } +} \ No newline at end of file diff --git a/services/JiShe.CollectBusEPO.Application/CollectBusEPOAppService.cs b/services/JiShe.CollectBusEPO.Application/CollectBusEPOAppService.cs new file mode 100644 index 0000000..79d0366 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application/CollectBusEPOAppService.cs @@ -0,0 +1,30 @@ +using JiShe.CollectBus; +using JiShe.CollectBus.FreeRedis; +using JiShe.CollectBus.FreeSql; +using JiShe.CollectBus.Localization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Threading; + +namespace JiShe.CollectBusEPO +{ + /* Inherit your application services from this class. + */ + [Authorize] + [ApiExplorerSettings(GroupName = CollectBusDomainSharedConsts.Business)] + public abstract class CollectBusEPOAppService : ApplicationService + { + public IFreeSqlProvider SqlProvider => LazyServiceProvider.LazyGetRequiredService(); + protected IFreeRedisProvider FreeRedisProvider => LazyServiceProvider.LazyGetService()!; + private ICancellationTokenProvider CancellationTokenProvider => + LazyServiceProvider.LazyGetService(NullCancellationTokenProvider.Instance); + + protected CollectBusEPOAppService() + { + LocalizationResource = typeof(CollectBusResource); + ObjectMapperContext = typeof(CollectBusEPOApplicationModule); + } + + + + } +} diff --git a/services/JiShe.CollectBusEPO.Application/CollectBusEPOApplicationModule.cs b/services/JiShe.CollectBusEPO.Application/CollectBusEPOApplicationModule.cs new file mode 100644 index 0000000..47e8079 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application/CollectBusEPOApplicationModule.cs @@ -0,0 +1,32 @@ +using JiShe.CollectBus; +using JiShe.CollectBus.FreeRedis; +using JiShe.CollectBus.FreeSql; +using JiShe.CollectBus.IoTDB; +using JiShe.CollectBus.Kafka; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; + +namespace JiShe.CollectBusEPO +{ + [DependsOn( + typeof(CollectBusDomainModule), + typeof(CollectBusFreeRedisModule), + typeof(CollectBusFreeSqlModule), + typeof(CollectBusKafkaModule), + typeof(CollectBusIoTDbModule) + )] + public class CollectBusEPOApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { options.AddMaps(); }); + + Configure(options => + { + options.ConventionalControllers.Create(typeof(CollectBusEPOApplicationModule).Assembly); + }); + } + + } +} \ No newline at end of file diff --git a/services/JiShe.CollectBusEPO.Application/EntityHandler.cs b/services/JiShe.CollectBusEPO.Application/EntityHandler.cs new file mode 100644 index 0000000..7ca2822 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application/EntityHandler.cs @@ -0,0 +1,21 @@ +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities.Events; +using Volo.Abp.EventBus; +using Volo.Abp.MultiTenancy; + +namespace JiShe.CollectBusEPO; + +public class EntityHandler : ILocalEventHandler>>, + ITransientDependency +{ + public IAbpLazyServiceProvider LazyServiceProvider { get; set; } + + protected ICurrentTenant CurrentTenant => LazyServiceProvider.LazyGetRequiredService(); + + + public Task HandleEventAsync(EntityCreatedEventData> eventData) + { + // TO DO SOMETHING + return Task.CompletedTask; + } +} \ No newline at end of file diff --git a/services/JiShe.CollectBusEPO.Application/GlobalUsings.cs b/services/JiShe.CollectBusEPO.Application/GlobalUsings.cs new file mode 100644 index 0000000..eacabe1 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application/GlobalUsings.cs @@ -0,0 +1,9 @@ +// Global using directives + +global using Microsoft.AspNetCore.Authorization; +global using System; +global using System.Threading.Tasks; +global using Volo.Abp.Application.Services; +global using Volo.Abp.AutoMapper; +global using Volo.Abp.DependencyInjection; +global using Volo.Abp.Modularity; diff --git a/services/JiShe.CollectBusEPO.Application/JiShe.CollectBusEPO.Application.csproj b/services/JiShe.CollectBusEPO.Application/JiShe.CollectBusEPO.Application.csproj new file mode 100644 index 0000000..0bb7da1 --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application/JiShe.CollectBusEPO.Application.csproj @@ -0,0 +1,17 @@ + + + + + net8.0 + JiShe.CollectBusEPO + + + + + + + + + + + diff --git a/services/JiShe.CollectBusEPO.Application/Properties/AssemblyInfo.cs b/services/JiShe.CollectBusEPO.Application/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f46e19e --- /dev/null +++ b/services/JiShe.CollectBusEPO.Application/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("JiShe.MicroService.Application.Tests")] diff --git a/shared/JiShe.CollectBus.Analyzers.Shared/SourceEntityAccessorFactory2.cs b/shared/JiShe.CollectBus.Analyzers.Shared/SourceEntityAccessorFactory2.cs new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/shared/JiShe.CollectBus.Analyzers.Shared/SourceEntityAccessorFactory2.cs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/.config/dotnet-tools.json b/web/JiShe.CollectBusEPO.HttpApi.Host/.config/dotnet-tools.json new file mode 100644 index 0000000..76ca931 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/.config/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "8.0.10", + "commands": [ + "dotnet-ef" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/CollectBusEPOHttpApiHostConst.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/CollectBusEPOHttpApiHostConst.cs new file mode 100644 index 0000000..e4783b7 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/CollectBusEPOHttpApiHostConst.cs @@ -0,0 +1,45 @@ +namespace JiShe.CollectBusEPO +{ + public static class CollectBusEPOHttpApiHostConst + { + /// + /// 跨域策略名 + /// + public const string DefaultCorsPolicyName = "Default"; + + /// + /// Cookies名称 + /// + public const string DefaultCookieName = "JiShe.MicroService.Http.Api"; + + /// + /// SwaggerUi 端点 + /// + public const string SwaggerUiEndPoint = "/swagger"; + + /// + /// Hangfire 端点 + /// + public const string HangfireDashboardEndPoint = "/hangfire"; + + /// + /// CAP 端点 + /// + public const string CapDashboardEndPoint = "/cap"; + + + public const string MoreEndPoint = "https://doc.cncore.club/"; + + + /// + /// HMiniprofiler端点 + /// + public const string MiniprofilerEndPoint = "/profiler/results-index"; + + /// + /// HealthCheck端点 + /// + public const string HealthCheckEndPoint = "/health"; + + } +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/CollectBusEPOHttpApiHostModule.Configure.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/CollectBusEPOHttpApiHostModule.Configure.cs new file mode 100644 index 0000000..8f5f93a --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/CollectBusEPOHttpApiHostModule.Configure.cs @@ -0,0 +1,179 @@ +using JiShe.CollectBusEPO.HttpApi.Host.Swaggers; + +namespace JiShe.CollectBusEPO; + +public partial class CollectBusEPOHttpApiHostModule +{ + + /// + /// 配置JWT + /// + private void ConfigureJwtAuthentication(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddAuthentication(options => + { + options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; + }) + .AddJwtBearer(options => + { + options.TokenValidationParameters = + new TokenValidationParameters() + { + // 是否开启签名认证 + ValidateIssuerSigningKey = true, + ValidateIssuer = true, + ValidateAudience = true, + ValidateLifetime = true, + ClockSkew = TimeSpan.Zero, + ValidIssuer = configuration["Jwt:Issuer"], + ValidAudience = configuration["Jwt:Audience"], + IssuerSigningKey = + new SymmetricSecurityKey( + Encoding.ASCII.GetBytes(configuration["Jwt:SecurityKey"])) + }; + + options.Events = new JwtBearerEvents + { + OnMessageReceived = currentContext => + { + var path = currentContext.HttpContext.Request.Path; + if (path.StartsWithSegments("/login")) + { + return Task.CompletedTask; + } + + var accessToken = string.Empty; + if (currentContext.HttpContext.Request.Headers.ContainsKey("Authorization")) + { + accessToken = currentContext.HttpContext.Request.Headers["Authorization"]; + if (!string.IsNullOrWhiteSpace(accessToken)) + { + accessToken = accessToken.Split(" ").LastOrDefault(); + } + } + + if (accessToken.IsNullOrWhiteSpace()) + { + accessToken = currentContext.Request.Query["access_token"].FirstOrDefault(); + } + + if (accessToken.IsNullOrWhiteSpace()) + { + accessToken = currentContext.Request.Cookies[@CollectBusEPOHttpApiHostConst.DefaultCookieName]; + } + + currentContext.Token = accessToken; + currentContext.Request.Headers.Remove("Authorization"); + currentContext.Request.Headers.Add("Authorization", $"Bearer {accessToken}"); + + return Task.CompletedTask; + } + }; + }); + } + + + /// + /// Redis缓存 + /// + private void ConfigureCache(ServiceConfigurationContext context) + { + Configure( + options => { options.KeyPrefix = "MicroService:"; }); + var configuration = context.Services.GetConfiguration(); + var redis = ConnectionMultiplexer.Connect(configuration.GetValue("Redis:Configuration")); + context.Services + .AddDataProtection() + .PersistKeysToStackExchangeRedis(redis, "MicroService-Protection-Keys"); + } + + /// + /// 配置Identity + /// + private void ConfigureIdentity(ServiceConfigurationContext context) + { + context.Services.Configure(options => { options.Lockout = new LockoutOptions() { AllowedForNewUsers = false }; }); + } + + + private void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddSwaggerGen( + options => + { + configuration.GetSection("SwaggerConfig").Get>().ForEach(group => + { + options.SwaggerDoc(group.GroupName, + new OpenApiInfo { Title = group.Title, Version = group.Version }); + }); + + options.DocInclusionPredicate((docName, apiDes) => + { + if (docName == "Basic" && apiDes.GroupName.IsNullOrWhiteSpace()) return true; + return docName == apiDes.GroupName; + }); + + options.EnableAnnotations(); + options.DocumentFilter(); + options.SchemaFilter(); + var xmlPaths = Directory.GetFiles(AppContext.BaseDirectory, "*.xml") + .Where(a => a.EndsWith("Application.App.xml") || + a.EndsWith("Application.Contracts.App.xml") || + a.EndsWith("Application.xml") || + a.EndsWith("Application.Contracts.xml") || + a.EndsWith("HttpApi.xml") || + a.EndsWith("HttpApi.Host.xml")) + .Distinct() + .ToList(); + foreach (var xml in xmlPaths) options.IncludeXmlComments(xml, true); + }); + } + + + + /// + /// 审计日志 + /// + private void ConfigureAuditLog(ServiceConfigurationContext context) + { + Configure + ( + options => + { + options.IsEnabled = true; + options.EntityHistorySelectors.AddAllEntities(); + options.ApplicationName = "JiShe.MicroService"; + } + ); + + Configure( + options => + { + options.IgnoredUrls.Add("/AuditLogs/page"); + options.IgnoredUrls.Add("/hangfire/stats"); + options.IgnoredUrls.Add("/hangfire/recurring/trigger"); + options.IgnoredUrls.Add("/cap"); + options.IgnoredUrls.Add("/"); + }); + } + + //private void ConfigurationMultiTenancy() + //{ + // Configure(options => { options.IsEnabled = MultiTenancyConsts.IsEnabled; }); + //} + + private void ConfigureCustom(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddSingleton(); + //context.Services.AddStorage(configuration); + } + + /// + /// 配置Serilog + /// + private void ConfigureSerilog(ServiceConfigurationContext context) + { + context.Services.AddSerilog(); + } +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/CollectBusEPOHttpApiHostModule.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/CollectBusEPOHttpApiHostModule.cs new file mode 100644 index 0000000..e97e840 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/CollectBusEPOHttpApiHostModule.cs @@ -0,0 +1,73 @@ +using JiShe.CollectBusEPO.Extensions.HealthCheck; +using JiShe.CollectBusEPO.HttpApi.Host.Swaggers; +using Microsoft.AspNetCore.Diagnostics.HealthChecks; +using Volo.Abp.Swashbuckle; + +namespace JiShe.CollectBusEPO; + +[DependsOn( + typeof(CollectBusEPOHttpApiModule), + typeof(AbpAspNetCoreAuthenticationJwtBearerModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpSwashbuckleModule), + typeof(CollectBusEPOApplicationModule) +)] +public partial class CollectBusEPOHttpApiHostModule : AbpModule +{ + public override void OnPostApplicationInitialization(ApplicationInitializationContext context) + { + base.OnPostApplicationInitialization(context); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + ConfigureSerilog(context); + + ConfigureCache(context); + ConfigureSwaggerServices(context, configuration); + ConfigureJwtAuthentication(context, configuration); + ConfigureIdentity(context); + ConfigureAuditLog(context); + ConfigureCustom(context, configuration); + + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var configuration = context.GetConfiguration(); + app.UseCorrelationId(); + app.UseStaticFiles(); + + + app.UseRouting(); + app.UseCors(CollectBusEPOHttpApiHostConst.DefaultCorsPolicyName); + + + app.UseAuthorization(); + app.UseSwagger(); + app.UseAbpSwaggerUI(options => + { + configuration.GetSection("SwaggerConfig").Get>().ForEach(group => + { + options.SwaggerEndpoint($"/swagger/{group.GroupName}/swagger.json", group.Title); //分组显示 + }); + options.DocExpansion(DocExpansion.None); + options.DefaultModelsExpandDepth(-1); + }); + + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseUnitOfWork(); + app.UseConfiguredEndpoints(endpoints => + { + //endpoints.MapHealthChecks("/health", new HealthCheckOptions + //{ + // Predicate = _ => true, + // ResponseWriter = HealthCheckResponse.Writer + //}); + }); + + } +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Controllers/HomeController.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 0000000..4e5ab2f --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,31 @@ +using Microsoft.AspNetCore.Authorization; + +namespace JiShe.CollectBusEPO.Controllers +{ + public class HomeController : AbpController + { + private readonly ILogger _logger; + private readonly IConfiguration configuration; + + public HomeController(ILogger logger, IConfiguration configuration) + { + _logger = logger; + this.configuration = configuration; + } + + public ActionResult Index() + { + return Redirect("/Monitor"); + } + + /// + /// ������� + /// + /// + [HttpGet] + public IActionResult Health() + { + return Ok(); + } + } +} diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/Dockerfile b/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/Dockerfile new file mode 100644 index 0000000..75a20a7 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/Dockerfile @@ -0,0 +1,47 @@ +FROM docker.jisheyun.com/jisheyun/aspnetcore:8.0.10_basic_ub24 AS base + +# 这里确定使用的端口 +EXPOSE 8080 +EXPOSE 443 + + +COPY publish /app + +WORKDIR /app +ARG BUD_ENV=Development + +# 这里确定生产环境还是DEV环境等 +ENV RUN_ENV=$BUD_ENV + +# 根据 RUN_ENV 的值删除特定的配置文件 +# 只在构建过程中执行的指令 +RUN if [ "$RUN_ENV" = "Development" ]; then \ + rm -f ./appsettings.Production.json; \ + fi + +RUN if [ "$RUN_ENV" = "Production" ]; then \ + rm -f ./appsettings.Development.json; \ + fi + +ENTRYPOINT ["dotnet", "JiShe.MicroService.HttpApi.Host.dll"] + +##See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. +# +#FROM mcr.microsoft.com/dotnet/aspnet:8.0.10-noble AS base + # +#WORKDIR /app +# +##USER root +# +## apt-get源 使用aliyun的源 +#COPY ["sources.list", "/etc/apt/"] +# +## 转换时区 +#RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ + #&& echo 'Asia/Shanghai' >/etc/timezone \ +## 更新系统并安装网络调试工具 + #&& apt-get update \ + #&& apt-get install -y \ + #vim \ + #net-tools \ + #iputils-ping \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/dockerbuild_dev.ps1 b/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/dockerbuild_dev.ps1 new file mode 100644 index 0000000..09dc2cd --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/dockerbuild_dev.ps1 @@ -0,0 +1,26 @@ +# 汾 +$version = "1.0.2" + +$csprojFile = '..\.\*.csproj' +$files = Get-ChildItem -Path $csprojFile +$fullPath = $files[0] +$name = $fullPath.BaseName + +Write-Host "׼¼ֿ" +docker login 192.168.111.248:10001 --username=jenkins --password GTCz3pV8kdme4rh5 + +$lowerName = $name.toLower() + +$tagName = "$($lowerName):$($version)" + +Write-Host "ʼ" +Write-Host $tagName + +docker build --build-arg BUD_ENV=Development --progress=plain -t $tagName . + +Write-Host "ɹ"; + +docker tag $tagName "192.168.111.248:10001/jisheyun/jishe.testservice:$($version)" + +Write-Host "ʼ;"; +#docker push "192.168.111.248:10001/jisheyun/jishe.testservice:$($version)" diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/dockerbuild_pro.ps1 b/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/dockerbuild_pro.ps1 new file mode 100644 index 0000000..5145ec3 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/dockerbuild_pro.ps1 @@ -0,0 +1,26 @@ +# 汾 +$version = "1.0.2" + +$csprojFile = '..\.\*.csproj' +$files = Get-ChildItem -Path $csprojFile +$fullPath = $files[0] +$name = $fullPath.BaseName + +Write-Host "׼¼ֿ" +docker login 192.168.111.248:10001 --username=jenkins --password GTCz3pV8kdme4rh5 + +$lowerName = $name.toLower() + +$tagName = "$($lowerName):$($version)" + +Write-Host "ʼ" +Write-Host $tagName + +docker build --build-arg BUD_ENV=Production --progress=plain -t $tagName . + +Write-Host "ɹ"; + +docker tag $tagName "192.168.111.248:10001/jisheyun/jishe.testservice:$($version)" + +Write-Host "ʼ;"; +#docker push "192.168.111.248:10001/jisheyun/jishe.testservice:$($version)" diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/sources.list b/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/sources.list new file mode 100644 index 0000000..d2814c4 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Docker/sources.list @@ -0,0 +1,10 @@ +deb http://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Extensions/HealthCheck/Extensions.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/Extensions/HealthCheck/Extensions.cs new file mode 100644 index 0000000..9a65556 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Extensions/HealthCheck/Extensions.cs @@ -0,0 +1,88 @@ +using Microsoft.Extensions.Diagnostics.HealthChecks; + +namespace JiShe.CollectBusEPO.Extensions.HealthCheck +{ + public static class Extensions + { + /// + /// 添加监控检查,支持配置文件配置 + /// + /// + /// + /// + public static IServiceCollection AddHealthChecks( + this IServiceCollection services, IConfiguration configuration) + { + if (Convert.ToBoolean(configuration["HealthCheck:IsEnable"])) + { + var healthChecksService = services + .AddHealthChecks(); + + //添加对mysql的监控检查 + //if (Convert.ToBoolean(configuration["HealthCheck:MySql:IsEnable"])) + //{ + // var connectionString = configuration["HealthCheck:MySql:Connection"]; + // if (connectionString.IsNullOrWhiteSpace()) + // connectionString = configuration.GetConnectionString("Default"); + // healthChecksService.AddMySql( + // connectionString, + // "Mysql", + // HealthStatus.Degraded, + // new string[] { "db", "sql", "mysql" } + // ); + //} + //添加对Pings的监控检查 + //if (Convert.ToBoolean(configuration["HealthCheck:Pings:IsEnable"])) + // healthChecksService.AddPingHealthCheck(setup => + // { + // setup.AddHost(configuration["HealthCheck:Pings:Host"], Convert.ToInt32(configuration["HealthCheck:Pings:TimeOut"])); + // }, tags: new string[] { "ping" }); + + ////添加对postgresql的监控检查 + //if (Convert.ToBoolean(configuration["HealthCheck:PostgreSql:IsEnable"])) + // healthChecksService.AddNpgSql( + // configuration["ConnectionStrings:Default"], + // name: configuration["HealthCheck:PostgreSql:Name"], + // failureStatus: HealthStatus.Degraded, + // tags: new string[] { "db", "sql", "postgresql" } + // ); + + ////添加对Redis的监控检查 + //if (Convert.ToBoolean(configuration["HealthCheck:Redis:IsEnable"])) + // healthChecksService.AddRedis( + // configuration["HealthCheck:Redis:ConnectionString"], + // tags: new string[] { "redis" } + // ); + + ////添加对RabbitMq的监控检查 + //if (Convert.ToBoolean(configuration["HealthCheck:RabbitMq:IsEnable"])) + // healthChecksService.AddRabbitMQ( + // rabbitConnectionString: configuration["HealthCheck:RabbitMq:ConnectionString"], + // tags: new string[] { "redis" } + // ); + + ////添加对sql server的监控检查 + //if (Convert.ToBoolean(configuration["HealthCheck:SqlServer:IsEnable"])) + // healthChecksService.AddSqlServer( + // configuration["ConnectionStrings:Default"], + // "SELECT 1;", + // configuration["HealthCheck:SqlServer:Name"], + // HealthStatus.Degraded, + // new string[] { "db", "sql", "sqlserver" } + + ////添加对Hangfire的监控检查 + //if (Convert.ToBoolean(configuration["HealthCheck:Hangfire:IsEnable"])) + // healthChecksService.AddHangfire(options => + // { + // options.MaximumJobsFailed = Convert.ToInt32(configuration["HealthCheck:Hangfire:MaximumJobsFailed"]); + // options.MinimumAvailableServers = Convert.ToInt32(configuration["HealthCheck:Hangfire:MinimumAvailableServers"]); + // }, tags: new string[] { "hangfire" }); + + ////添加对SignalR的监控检查 + //if (Convert.ToBoolean(configuration["HealthCheck:SignalR:IsEnable"])) + // healthChecksService.AddSignalRHub(configuration["HealthCheck:SignalR:Url"], tags: new string[] { "signalr" }); + } + return services; + } + } +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Extensions/HealthCheck/HealthCheckResponse.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/Extensions/HealthCheck/HealthCheckResponse.cs new file mode 100644 index 0000000..9fe52ef --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Extensions/HealthCheck/HealthCheckResponse.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.Diagnostics.HealthChecks; +using Newtonsoft.Json; + +namespace JiShe.CollectBusEPO.Extensions.HealthCheck +{ + public class HealthCheckResponse + { + public static Task Writer(HttpContext context, HealthReport healthReport) + { + context.Response.ContentType = "application/json"; + + var result = JsonConvert.SerializeObject(new + { + status = healthReport.Status.ToString(), + errors = healthReport.Entries.Select(e => new + { + key = e.Key, + value = e.Value.Status.ToString() + }) + }); + return context.Response.WriteAsync(result); + + } + } +} diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/GlobalUsings.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/GlobalUsings.cs new file mode 100644 index 0000000..c588db2 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/GlobalUsings.cs @@ -0,0 +1,32 @@ +// Global using directives + +global using Microsoft.AspNetCore.Authentication.JwtBearer; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.AspNetCore.DataProtection; +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Identity; +global using Microsoft.AspNetCore.Mvc; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Hosting; +global using Microsoft.Extensions.Logging; +global using Microsoft.IdentityModel.Tokens; +global using Microsoft.OpenApi.Models; +global using Serilog; +global using StackExchange.Redis; +global using Swashbuckle.AspNetCore.SwaggerUI; +global using System; +global using System.Collections.Generic; +global using System.IO; +global using System.Linq; +global using System.Text; +global using System.Threading.Tasks; +global using Volo.Abp; +global using Volo.Abp.AspNetCore.Auditing; +global using Volo.Abp.AspNetCore.Authentication.JwtBearer; +global using Volo.Abp.AspNetCore.Mvc; +global using Volo.Abp.AspNetCore.Serilog; +global using Volo.Abp.Auditing; +global using Volo.Abp.Caching; +global using Volo.Abp.Modularity; diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/JiShe.CollectBusEPO.HttpApi.Host.csproj b/web/JiShe.CollectBusEPO.HttpApi.Host/JiShe.CollectBusEPO.HttpApi.Host.csproj new file mode 100644 index 0000000..1c0e309 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/JiShe.CollectBusEPO.HttpApi.Host.csproj @@ -0,0 +1,62 @@ + + + net8.0 + JiShe.CollectBusEPO + true + JiShe.MicroService-4681b4fd-151f-4221-84a4-929d86723e4c + Linux + ..\.. + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ContentIncludedByDefault Remove="wwwroot\files\a.txt" /> + + + + + + diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Pages/Monitor.cshtml b/web/JiShe.CollectBusEPO.HttpApi.Host/Pages/Monitor.cshtml new file mode 100644 index 0000000..1825dbb --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Pages/Monitor.cshtml @@ -0,0 +1,193 @@ +@page "/Monitor" +@using JiShe.CollectBusEPO +@model JiShe.CollectBusEPO.Pages.Monitor + + +@{ + Layout = null; +} + + + + + + + + + + 后端服务 + + + +
+ +
+
+
+ + + +
+

+ SwaggerUI +

+
+
+
+ +
+
+ + + +
+

+ CAP面板 +

+
+
+
+ +
+
+ + + +
+

+ Hangfire面板 +

+
+
+
+
+
+ + + +
+

+ Miniprofiler +

+
+
+
+
+
+ + + +
+

+ HealthCheck +

+
+
+
+
+
+ + + \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Pages/Monitor.cshtml.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/Pages/Monitor.cshtml.cs new file mode 100644 index 0000000..d57d898 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Pages/Monitor.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace JiShe.CollectBusEPO.Pages +{ + public class Monitor : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Program.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/Program.cs new file mode 100644 index 0000000..20b7d21 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Program.cs @@ -0,0 +1,39 @@ +namespace JiShe.CollectBusEPO +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + + } + + private static IHostBuilder CreateHostBuilder(string[] args) + { + var env = Environment.GetEnvironmentVariable("RUN_ENV") ?? "Development"; + + return Host.CreateDefaultBuilder(args) + .UseEnvironment(env) + .ConfigureAppConfiguration((context, builder) => + { + var c = builder.Build(); + + builder.AddJsonFile($"appsettings.json", false, true); + builder.AddJsonFile($"appsettings.{env}.json", false, true); + + //builder.AddNacosV2Configuration(c.GetSection("NacosConfig")); + }) + .ConfigureWebHostDefaults(webBuilder => + { + var runPort = Environment.GetEnvironmentVariable("RUN_PORT") ?? "8088"; + webBuilder.ConfigureKestrel((context, options) => { options.Limits.MaxRequestBodySize = 1024 * 50; }); + webBuilder.UseStartup(); + webBuilder.UseUrls($"http://*:{runPort}"); + }) + .UseSerilog((context, loggerConfiguration) => + { + loggerConfiguration.ReadFrom.Configuration(context.Configuration); + }).UseAutofac(); + } + } +} diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Properties/launchSettings.json b/web/JiShe.CollectBusEPO.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 0000000..8481021 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,13 @@ +{ + "profiles": { + "JiShe.MicroService.HttpApi.Host": { + "commandName": "Project", + "commandLineArgs": "serviceip=192.168.111.174 serviceport=8088", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:8088" + } + } +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Startup.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/Startup.cs new file mode 100644 index 0000000..f655483 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Startup.cs @@ -0,0 +1,23 @@ +namespace JiShe.CollectBusEPO +{ + public class Startup + { + private readonly IConfiguration _configuration; + + public Startup(IConfiguration configuration) + { + _configuration = configuration; + } + + + public void ConfigureServices(IServiceCollection services) + { + services.AddApplication(); + } + + public void Configure(IApplicationBuilder app,IHostApplicationLifetime lifetime) + { + app.InitializeApplication(); + } + } +} diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Swaggers/EnumSchemaFilter.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/Swaggers/EnumSchemaFilter.cs new file mode 100644 index 0000000..c31c8c2 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Swaggers/EnumSchemaFilter.cs @@ -0,0 +1,24 @@ +using Microsoft.OpenApi.Any; +using Microsoft.OpenApi.Interfaces; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JiShe.CollectBusEPO.HttpApi.Host.Swaggers +{ + /// + /// swagger 枚举映射, + /// 原因:前端代理生成枚举是数字 + /// + public class EnumSchemaFilter : ISchemaFilter + { + public void Apply(OpenApiSchema schema, SchemaFilterContext context) + { + if (!context.Type.IsEnum) + return; + OpenApiArray openApiArray = new OpenApiArray(); + openApiArray.AddRange((IEnumerable)Enum.GetNames(context.Type).Select(n => new OpenApiString(n))); + schema.Extensions.Add("x-enumNames", openApiArray); + schema.Extensions.Add("x-enum-varnames", openApiArray); + } + } +} diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Swaggers/HiddenAbpDefaultApiFilter.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/Swaggers/HiddenAbpDefaultApiFilter.cs new file mode 100644 index 0000000..31dbca5 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Swaggers/HiddenAbpDefaultApiFilter.cs @@ -0,0 +1,54 @@ +using System.Reflection; +using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JiShe.CollectBusEPO.HttpApi.Host.Swaggers +{ + /// + /// 在使用nswag的时候,原生默认的api导致生产的代理类存在问题 + /// 所有隐藏原生的api,重写路由 + /// + public class HiddenAbpDefaultApiFilter : IDocumentFilter + { + public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) + { + foreach (ApiDescription apiDescription in context.ApiDescriptions) + { + if (apiDescription.TryGetMethodInfo(out MethodInfo _)) + { + string key = "/" + apiDescription.RelativePath; + if (IsHidden(key)) + swaggerDoc.Paths.Remove(key); + } + } + } + + private bool IsHidden(string key) + { + foreach (string hiddenAbpDefaultApi in GetHiddenAbpDefaultApiList()) + { + if (key.Contains(hiddenAbpDefaultApi)) + return true; + } + return false; + } + + private List GetHiddenAbpDefaultApiList() + { + return new List() + { + "/api/abp/multi-tenancy/tenants", + "/api/account", + "/api/feature-management/features", + "/api/permission-management/permissions", + "/api/identity/my-profile", + "/api/identity", + "/api/multi-tenancy/tenants", + "/api/setting-management/emailing", + "/configuration", + "/outputcache" + }; + } + } +} diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/Swaggers/SwaggerConfig.cs b/web/JiShe.CollectBusEPO.HttpApi.Host/Swaggers/SwaggerConfig.cs new file mode 100644 index 0000000..9b6de43 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/Swaggers/SwaggerConfig.cs @@ -0,0 +1,11 @@ +namespace JiShe.CollectBusEPO.HttpApi.Host.Swaggers +{ + public class SwaggerConfig + { + public string GroupName { get; set; } + + public string Title { get; set; } + + public string Version { get; set; } + } +} diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/appsettings.Development.json b/web/JiShe.CollectBusEPO.HttpApi.Host/appsettings.Development.json new file mode 100644 index 0000000..c1860fa --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/appsettings.Development.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/appsettings.Production.json b/web/JiShe.CollectBusEPO.HttpApi.Host/appsettings.Production.json new file mode 100644 index 0000000..c1860fa --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/appsettings.Production.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/appsettings.json b/web/JiShe.CollectBusEPO.HttpApi.Host/appsettings.json new file mode 100644 index 0000000..92d8dc2 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/appsettings.json @@ -0,0 +1,104 @@ +{ + "Serilog": { + "Using": [ + "Serilog.Sinks.Console", + "Serilog.Sinks.File" + ], + "MinimumLevel": { + "Default": "Debug", + "Override": { + "Microsoft": "Information", + "Volo.Abp": "Information", + "Hangfire": "Information", + "DotNetCore.CAP": "Information", + "Serilog.AspNetCore": "Information", + "Microsoft.EntityFrameworkCore": "Warning", + "Microsoft.AspNetCore": "Information" + } + }, + "WriteTo": [ + { + "Name": "Console" + }, + { + "Name": "File", + "Args": { + "path": "logs/logs-.txt", + "rollingInterval": "Day" + } + } + ] + }, + "ConnectionStrings": { + "Default": "mongodb://mongo_PmEeF3:lixiao1980@192.168.5.9:27017/JiSheCollectBus?authSource=admin&maxPoolSize=400&minPoolSize=10&waitQueueTimeoutMS=5000", + "Kafka": "192.168.5.9:29092,192.168.5.9:39092,192.168.5.9:49092", + "PrepayDB": "server=118.190.144.92;database=jishe.sysdb;uid=sa;pwd=admin@2023;Encrypt=False;Trust Server Certificate=False", + "EnergyDB": "server=118.190.144.92;database=db_energy;uid=sa;pwd=admin@2023;Encrypt=False;Trust Server Certificate=False" + }, + "Redis": { + "Configuration": "192.168.5.9:6380,password=1q2w3e!@#,syncTimeout=30000,abortConnect=false,connectTimeout=30000,allowAdmin=true", + "MaxPoolSize": "50", + "DefaultDB": "14", + "HangfireDB": "13" + }, + "Kafka": { + "BootstrapServers": "192.168.5.9:29092,192.168.5.9:39092,192.168.5.9:49092", + "EnableFilter": true, + "EnableAuthorization": false, + "SecurityProtocol": "SaslPlaintext", + "SaslMechanism": "Plain", + "SaslUserName": "lixiao", + "SaslPassword": "lixiao1980", + "KafkaReplicationFactor": 3, + "NumPartitions": 30, + "FirstCollectionTime": "2025-04-22 16:07:00" + }, + "IoTDBOptions": { + "UserName": "root", + "Password": "root", + "ClusterList": [ "121.42.175.177:16667" ], + "PoolSize": 32, + "DataBaseName": "energy", + "OpenDebugMode": true, + "UseTableSessionPoolByDefault": false + }, + "App": { + "SelfUrl": "http://localhost:44315", + "CorsOrigins": "http://localhost:4200,http://localhost:3100" + }, + "Jwt": { + "Audience": "JiShe.CollectBus", + "SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=", + "Issuer": "JiShe.CollectBus", + "ExpirationTime": 2 + }, + "HealthChecks": { + "IsEnable": false, + "HealthCheckDatabaseName": "HealthChecks", + "EvaluationTimeInSeconds": 10, + "MinimumSecondsBetweenFailureNotifications": 60 + }, + "SwaggerConfig": [ + { + "GroupName": "Basic", + "Title": "【后台管理】基础模块", + "Version": "V1" + }, + { + "GroupName": "Business", + "Title": "【后台管理】业务模块", + "Version": "V1" + } + ], + "ServerApplicationOptions": { + "ServerTagName": "JiSheCollectBus99", + "SystemType": "Energy", + "FirstCollectionTime": "2025-04-28 15:07:00", + "AutomaticVerificationTime": "16:07:00", + "AutomaticTerminalVersionTime": "17:07:00", + "AutomaticTelematicsModuleTime": "17:30:00", + "AutomaticDayFreezeTime": "02:30:00", + "AutomaticMonthFreezeTime": "03:30:00", + "DefaultProtocolPlugin": "T37612012ProtocolPlugin" + } +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/tempkey.jwk b/web/JiShe.CollectBusEPO.HttpApi.Host/tempkey.jwk new file mode 100644 index 0000000..b4f8b7d --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/tempkey.jwk @@ -0,0 +1 @@ +{"AdditionalData":{},"Alg":"RS256","Crv":null,"D":"eH-Ld45J684VguyI2jACQEEVGtTx79Nt7ElT20JeUi-pbVnhJxxAJwnAe68d9Q8skpv6BxZs5QuyIORwfGpJK-lKVuo8EtyUQTuUuPmP4o1YK4cv2FIi5xN18tddTltg2JmJi1sN2AD5z-zwm45YNvoFxdQYlnUlA9lJL8QfG0HQLMQX1sv2_lgND8RfRGQBCpVXC2kcap4GvkFVQpKaQ5xaUqvNdH6ftwkGMdFfMRlHGhyYyabIjs4T16HslofvXiHbOCAzk37HtBNNsBpeoQuZul1-G7tAndHe1XtuGvuE-k1fyqdm3YiCU8wK7FpvQU3x6JqvfqmWgMAPnWKOtQ","DP":"hd3I9Nc3LlaZDoPg20JZu48kpv9rMMQ0rLtcZ0UPB_HpZWBC_No-3t3t1HFRbD4iz0MCpCR6gb5q4UsL2N2xh3Q8OhQ1Zrl76UKDZrVKs3oE0VVr9K2VUU3s1sytE4OWSv7PAHYURygcx_MrunMn8Ryd4ZJBQ_g5M2GvpBj1o5M","DQ":"T3ibciK4KxGGHqau9dnWxE6l3fGtcNw1GcjV93Lxe0NKTbfrwPEIFVVAyPsFS8QdmRXEgyunkDFKLHyq2hXBi2fZCwXGoWkUqVUKAKMaNYZaDDd_XeJKOu7mwNY8rgxNETHCyMSnnNNPNabBf2iiXmrBnMwesle2L1kwky42yns","E":"AQAB","K":null,"KeyId":"0D94529E740F5FD50EC6B8A19FF460D6","Kid":"0D94529E740F5FD50EC6B8A19FF460D6","Kty":"RSA","N":"w2jhtWb6a3kH4VqAPfuuvdF5hBh7U6gwMRnddHAH7zaVL6aYwjpCzNW56RQy4W4Zabv1My4Yw9GZpjrOcyr3Bm669eZjn_JC0O00eRTNStNgmg2kB_6AB6ROkEW7br1JC0jKr_dXhOYPBMmR-KHvpwaZXA9R1xOqY02S3JD0KB-TGMSC9q1RlVydt81aMOHFzWVyruLsYGdmcKhRPKDtL6GXpU_DG1gzzOYbk795x_D_UUTOJYuhIDEj7aYi3o32yXLEBvh4Q7HPLjLcWzV-EzCn6Ossl-EVJ2TrR53Eln03R93Vmo63DzQbLIOi3yTcZD2a3O6mpGLiqyZjUducIQ","Oth":null,"P":"y84cEtE6IRBeU2sDJxjDYb50HB4nAF7-bfvbEq0haQL2sFBz-Q-uOUAeXhaS74Gh_IagmW1TzOKblVilijMHCsfOFTWlCljaDoNfdl31enh50HMFvUu8IFjcWiQ9fjR5no8n5-jDeRO5zVfgcWoRHfVTOq4Di7WlVHJRr8FB-R8","Q":"9XRZvvMIvoumlDAVxWZHkb7_an0_dFwBLqc8v74XBZhiK5SLuBqmsJICB5kwNTKzORH7yedx-RXOJWkchJLlEtmH_cQO_6WKQQAyc1PMnLPa0tYkhjotWo8VRE9bAdVmrR0cnJeudfSJ-6gDpUBQYy9g1m8cAfWbTAk3at2_gr8","QI":"xRLXLwhTdNbevlEzANlDDnU9lDeKZWV9-YrvUxHMJBBygBNVqkNFWiee7LNUi82YgTHRn46rpHY9TZf6oQbgk6xa86MyDYXGU2uGO8DHm5oh20Spp7A-RlzZ4JRXAJ3eAYMZHQIP45JApVvKbgHh_pUGjNaiqZKZ9IN6H_L9k1s","Use":null,"X":null,"X5t":null,"X5tS256":null,"X5u":null,"Y":null,"KeySize":2048,"HasPrivateKey":true,"CryptoProviderFactory":{"CryptoProviderCache":{},"CustomCryptoProvider":null,"CacheSignatureProviders":true}} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/tempkey.rsa b/web/JiShe.CollectBusEPO.HttpApi.Host/tempkey.rsa new file mode 100644 index 0000000..ed0defa --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi.Host/tempkey.rsa @@ -0,0 +1 @@ +{"KeyId":"600caa200caf5d805eba9f06ace9e236","Parameters":{"D":"KCNDHA96eimN+UqchSKocgYITGflaAIwxzCS5KqSTkYAFliPthQx7LySuLor4F1+uLvwnh3ZocyI3y43GZu+eVHD256sxdV8/UsQz1HC23RRFqcUiAZjze8K5VMVStrBOxaa/Ds1U9/bpuNE7jZdcgFIEHsdZtCACqwtlE4nlIs1/GLiokqjBOESgxJMy9WUeDbWcvoo+YdwgKf5jt6AZHOYSS+TokLL+Y7TEfGMXe3jZD9VtSMkBSM8wGB89zNGR0FZB9maCG/BCoRJqxdYRyeb4FFXJclQtK3DexyDVqlNZQaNKVHu0tVAnVNKKcd7Iex8gA+5DNqqucUA7C/F6Q==","DP":"fr9iaNb1W4YZ/NJ56+N3SCeDQYuKobq1qeaQWmHlQsOHKoHhNZJQZ5x0M9PQilou16AwVlNGCJncMwxsSUxXn6itG0LcBnvfMeo2v3xKcij1BtFR9qfXecwEn2nnhI3mpXtZxyCdP3NIYUp9qViLJUjGJqrbQk+OIAGRQd2rRe0=","DQ":"o1umLkDodtwvpCsDguQYSjd3iob+WHNmfe/9HyjADmUehP8b9SpUgcrb+QF301J8YmQMnYZKWW5rEwKOtwsWNswgXfMnXeWerlZmz0tj9y38YczS70liU0vETsRefhrRCaXHraMvneqYNNedhsrCNalWK+DNwcixi4L59vA8ofs=","Exponent":"AQAB","InverseQ":"btd1nwwxl/E3ryfDi2bN12TuVDvv7yoPvryIlLgu+FiLpe4vaA1omDLliQBcl7oeyA563HBUop4D5oE7si+jD64N8XgFz37dD3KqUokeQ4lrTSSOePT1K+nWIl30sqDd7YE4auz4CvSjm2wXmN31+CXW1hp3YWN2972yrUt+R5U=","Modulus":"uwMB6reAVtm/Cq0BRPZ0ozBq6g3wDh2kzqFKBf8I7u8d9p7i5ExLSrOWPupHwPr/IW1VUn2TKHrJ8OnyYhznKIRxqlxj0U3D2GXijz5kfFOoHK+mlfKaDMqweRoS0UzEz58kMlgwUoDraUj6dTHTPCVPo3TqA2ImRw50j6D+jobFrY5321EFvlirZViMPDAgB8Ca7wGCqNBcCxvIPYw1O6WZmcVmjG7umelD3XjcUIQlEbIyAmi/3gXAo7NdPmgOamla6bnSWsy429HfsNpXyCfPBzV3QS3ubpTekWPoPcOVZbWwVPYtFQbhRh8PmWATRx0cV6oePZNZGxGeJl8WYQ==","P":"wplelBfVmiOPmr6iUxtOgIzuvwSqvP6Rqmh8dhaGDiJjU8OqZ0tZhuh0G+xnMLPIHb2fMeg0dqZMJZ5iXaIi1QycYn/JKz1i4cUonJ6IIQeKKf67tvzn/BY0V0N8rJw8hVfzou+/5sRBCbiHtJ2KIN1YJQuWGFFfrZJOJzc95ss=","Q":"9gTGKoDiOdrY8kqIXJ2nMhoeNryAH4q3EUrROJ7simqc28oYlGx24Sco/wOoeB2xxrdcF5JYOlyJ7H2YY/huLvJISaw/wHLPskiKiYQ78tuNwW0ip+5ceB1dSToHcEe3sR30+OeTh0Z4ZKoqthKziFGIt3EhEgiGq1gjZuWB5gM="}} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/TemporaryFiles/.gitkeep b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/TemporaryFiles/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/cap.png b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/cap.png new file mode 100644 index 0000000..76c667e Binary files /dev/null and b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/cap.png differ diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/hangfire.png b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/hangfire.png new file mode 100644 index 0000000..5cdeb40 Binary files /dev/null and b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/hangfire.png differ diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/healthchecks.png b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/healthchecks.png new file mode 100644 index 0000000..63950e4 Binary files /dev/null and b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/healthchecks.png differ diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/miniprofiler.png b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/miniprofiler.png new file mode 100644 index 0000000..244c702 Binary files /dev/null and b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/miniprofiler.png differ diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/more.png b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/more.png new file mode 100644 index 0000000..55c056f Binary files /dev/null and b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/more.png differ diff --git a/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/swagger.png b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/swagger.png new file mode 100644 index 0000000..7bcbd43 Binary files /dev/null and b/web/JiShe.CollectBusEPO.HttpApi.Host/wwwroot/images/swagger.png differ diff --git a/web/JiShe.CollectBusEPO.HttpApi/CollectBusEPOHttpApiModule.cs b/web/JiShe.CollectBusEPO.HttpApi/CollectBusEPOHttpApiModule.cs new file mode 100644 index 0000000..100383b --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi/CollectBusEPOHttpApiModule.cs @@ -0,0 +1,39 @@ + +using JiShe.CollectBus; +using JiShe.CollectBus.Localization; +using Microsoft.Extensions.DependencyInjection; + +namespace JiShe.CollectBusEPO +{ + [DependsOn( + typeof(CollectBusEPOApplicationContractsModule), + typeof(CollectBusEPOApplicationModule), + typeof(AbpAspNetCoreMvcModule) + )] + public class CollectBusEPOHttpApiModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(CollectBusEPOHttpApiModule).Assembly); + }); + + Configure(options => + { + options.ConventionalControllers + .Create(typeof(CollectBusEPOHttpApiModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + } + } +} diff --git a/web/JiShe.CollectBusEPO.HttpApi/Controllers/CollectBusEPOController.cs b/web/JiShe.CollectBusEPO.HttpApi/Controllers/CollectBusEPOController.cs new file mode 100644 index 0000000..cd8ffa8 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi/Controllers/CollectBusEPOController.cs @@ -0,0 +1,14 @@ +using JiShe.CollectBus.Localization; + +namespace JiShe.CollectBusEPO.Controllers +{ + /* Inherit your controllers from this class. + */ + public abstract class CollectBusEPOController : AbpController + { + protected CollectBusEPOController() + { + LocalizationResource = typeof(CollectBusResource); + } + } +} \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi/GlobalUsings.cs b/web/JiShe.CollectBusEPO.HttpApi/GlobalUsings.cs new file mode 100644 index 0000000..99bd72c --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi/GlobalUsings.cs @@ -0,0 +1,6 @@ +// Global using directives + +global using Localization.Resources.AbpUi; +global using Volo.Abp.AspNetCore.Mvc; +global using Volo.Abp.Localization; +global using Volo.Abp.Modularity; \ No newline at end of file diff --git a/web/JiShe.CollectBusEPO.HttpApi/JiShe.CollectBusEPO.HttpApi.csproj b/web/JiShe.CollectBusEPO.HttpApi/JiShe.CollectBusEPO.HttpApi.csproj new file mode 100644 index 0000000..52da299 --- /dev/null +++ b/web/JiShe.CollectBusEPO.HttpApi/JiShe.CollectBusEPO.HttpApi.csproj @@ -0,0 +1,19 @@ + + + + + + net8.0 + JiShe.CollectBusEPO + + + + + + + + + + + +