Skip to content

Commit

Permalink
build:RC升级.NET9
Browse files Browse the repository at this point in the history
  • Loading branch information
MateralCMX committed Nov 20, 2024
1 parent 66ab8fc commit 969e528
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions RC/RC.Deploy/RC.Deploy.WebAPI/RC.Deploy.WebAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Materal.MergeBlock" />
<PackageReference Include="Materal.MergeBlock.AccessLog" />
<PackageReference Include="Materal.MergeBlock.Authorization" />
<PackageReference Include="Materal.MergeBlock.Consul" />
Expand All @@ -24,7 +23,4 @@
<ItemGroup>
<ProjectReference Include="..\RC.Deploy.Application\RC.Deploy.Application.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\RC.Core\RC.Core.Abstractions\RCConfig.json" Link="RCConfig.json" CopyToOutputDirectory="Always" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace RC.EnvironmentServer.Application.EventHandlers
/// <summary>
/// 命名空间删除事件处理器
/// </summary>
public class NamespaceDeleteEventHandler(IOptionsMonitor<ApplicationConfig> applicationConfig, IOptionsMonitor<EventBusConfig> eventBusConfig, IEnvironmentServerUnitOfWork unitOfWork, IConfigurationItemRepository configurationItemRepository) : RCEnvironmentServerEventHandler<NamespaceDeleteEvent>(applicationConfig, eventBusConfig)
public class NamespaceDeleteEventHandler(IOptionsMonitor<ApplicationConfig> applicationConfig, IOptionsMonitor<RabbitMQEventBusOptions> eventBusConfig, IEnvironmentServerUnitOfWork unitOfWork, IConfigurationItemRepository configurationItemRepository) : RCEnvironmentServerEventHandler<NamespaceDeleteEvent>(applicationConfig, eventBusConfig)
{
/// <summary>
/// 处理
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace RC.EnvironmentServer.Application.EventHandlers
/// <summary>
/// 项目删除事件处理器
/// </summary>
public class ProjectDeleteEventHandler(IOptionsMonitor<ApplicationConfig> applicationConfig, IOptionsMonitor<EventBusConfig> eventBusConfig, IEnvironmentServerUnitOfWork unitOfWork, IConfigurationItemRepository configurationItemRepository) : RCEnvironmentServerEventHandler<ProjectDeleteEvent>(applicationConfig, eventBusConfig)
public class ProjectDeleteEventHandler(IOptionsMonitor<ApplicationConfig> applicationConfig, IOptionsMonitor<RabbitMQEventBusOptions> eventBusConfig, IEnvironmentServerUnitOfWork unitOfWork, IConfigurationItemRepository configurationItemRepository) : RCEnvironmentServerEventHandler<ProjectDeleteEvent>(applicationConfig, eventBusConfig)
{
/// <summary>
/// 处理
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace RC.EnvironmentServer.Application.EventHandlers
/// </summary>
/// <typeparam name="TEvent"></typeparam>
[QueueName("RCEnvironmentServer")]
public abstract class RCEnvironmentServerEventHandler<TEvent>(IOptionsMonitor<ApplicationConfig> applicationConfig, IOptionsMonitor<EventBusConfig> eventBusConfig) : BaseEventHandler<TEvent>, IEventHandler<TEvent>, IRabbitMQEventHandler
public abstract class RCEnvironmentServerEventHandler<TEvent>(IOptionsMonitor<ApplicationConfig> applicationConfig, IOptionsMonitor<RabbitMQEventBusOptions> eventBusConfig) : BaseEventHandler<TEvent>, IEventHandler<TEvent>, IRabbitMQEventHandler
where TEvent : IEvent
{
/// <summary>
Expand All @@ -18,6 +18,6 @@ public abstract class RCEnvironmentServerEventHandler<TEvent>(IOptionsMonitor<Ap
/// <summary>
/// 队列名称
/// </summary>
public string? QueueName => $"{AppConfig.CurrentValue.ServiceName}Queue{eventBusConfig.CurrentValue.NameSuffix}";
public string QueueName => $"{AppConfig.CurrentValue.ServiceName}Queue{eventBusConfig.CurrentValue.NameSuffix}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace RC.EnvironmentServer.Application.EventHandlers
/// <summary>
/// 同步配置事件处理器
/// </summary>
public class SyncConfigEventHandler(IOptionsMonitor<ApplicationConfig> applicationConfig, IOptionsMonitor<EventBusConfig> eventBusConfig, IMapper mapper, IEnvironmentServerUnitOfWork unitOfWork, IConfigurationItemRepository configurationItemRepository) : RCEnvironmentServerEventHandler<SyncConfigEvent>(applicationConfig, eventBusConfig)
public class SyncConfigEventHandler(IOptionsMonitor<ApplicationConfig> applicationConfig, IOptionsMonitor<RabbitMQEventBusOptions> eventBusConfig, IMapper mapper, IEnvironmentServerUnitOfWork unitOfWork, IConfigurationItemRepository configurationItemRepository) : RCEnvironmentServerEventHandler<SyncConfigEvent>(applicationConfig, eventBusConfig)
{
private static readonly object _syncLockObj = new();
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public async Task SyncConfigAsync(SyncConfigModel model)
TargetEnvironments = model.TargetEnvironments,
ConfigurationItems = Mapper.Map<List<ConfigurationItemListDTO>>(configurationItems) ?? throw new RCException("映射失败")
};
eventBus.Publish(@event);
await eventBus.PublishAsync(@event);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Materal.MergeBlock" />
<PackageReference Include="Materal.MergeBlock.AccessLog" />
<PackageReference Include="Materal.MergeBlock.Authorization" />
<PackageReference Include="Materal.MergeBlock.Consul" />
Expand All @@ -24,7 +23,4 @@
<ItemGroup>
<ProjectReference Include="..\RC.EnvironmentServer.Application\RC.EnvironmentServer.Application.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\RC.Core\RC.Core.Abstractions\RCConfig.json" Link="RCConfig.json" CopyToOutputDirectory="Always" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override async Task<Guid> AddAsync(AddNamespaceModel model)
protected override async Task DeleteAsync(Namespace domain)
{
await base.DeleteAsync(domain);
eventBus.Publish(new NamespaceDeleteEvent
await eventBus.PublishAsync(new NamespaceDeleteEvent
{
NamespaceID = domain.ID
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override async Task DeleteAsync(Project domain)
UnitOfWork.RegisterDelete(@namespace);
}
await base.DeleteAsync(domain);
eventBus.Publish(new ProjectDeleteEvent
await eventBus.PublishAsync(new ProjectDeleteEvent
{
ProjectID = domain.ID
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Materal.MergeBlock" />
<PackageReference Include="Materal.MergeBlock.AccessLog" />
<PackageReference Include="Materal.MergeBlock.Authorization" />
<PackageReference Include="Materal.MergeBlock.Consul" />
Expand All @@ -24,7 +23,4 @@
<ItemGroup>
<ProjectReference Include="..\RC.ServerCenter.Application\RC.ServerCenter.Application.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\RC.Core\RC.Core.Abstractions\RCConfig.json" Link="RCConfig.json" CopyToOutputDirectory="Always" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net8.0-windows</TargetFramework>
<TargetFramework>net9.0-windows</TargetFramework>
<ProjectGuid>5311c3e4-5e07-4283-9580-8da332c98d2e</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion RC/publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ foreach ($subfolder in $allSubfolders) {
}
}
}
Write-Host "鍙戝竷瀹屾瘯 $publishDirPath"
Write-Host "发布完成 $publishDirPath"
explorer("$publishDirPath")

0 comments on commit 969e528

Please sign in to comment.