Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update latest code #732

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions src/Mixcore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.auth", "platform\mix.au
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mixcore", "applications\mixcore\mixcore.csproj", "{BEFA0F34-2594-4E77-88A9-4DF2B535343A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mixcore.host.aspire.AppHost", "applications\mixcore.host.aspire\mixcore.host.aspire.AppHost\mixcore.host.aspire.AppHost.csproj", "{803BBEFE-A5AF-4C43-87FC-DA9132F18498}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mixcore.host.aspire.AppHost", "applications\mixcore.host.aspire.AppHost\mixcore.host.aspire.AppHost.csproj", "{803BBEFE-A5AF-4C43-87FC-DA9132F18498}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mixcore.host.aspire.ServiceDefaults", "applications\mixcore.host.aspire\mixcore.host.aspire.ServiceDefaults\mixcore.host.aspire.ServiceDefaults.csproj", "{3BADD396-E830-468B-B2D8-A52FD5E6C6BD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mixcore.host.aspire.ServiceDefaults", "applications\mixcore.host.aspire.ServiceDefaults\mixcore.host.aspire.ServiceDefaults.csproj", "{3BADD396-E830-468B-B2D8-A52FD5E6C6BD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mixcore.gateway", "applications\mixcore.gateway\mixcore.gateway.csproj", "{5FA252B6-6FDA-451E-BE5E-F6D82EDE9AB1}"
EndProject
Expand All @@ -121,9 +121,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mix-message-queue", "mix-me
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mix-auth-service", "mix-auth-service", "{EC933357-1D95-4CDD-B290-7A5984FC1AA2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.mq.server", "services\mix-message-queue\mix.mq.server\mix.mq.server.csproj", "{7C5101F3-E3E6-42DB-8585-D08C2BE5E30C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.mq.server", "services\core\mix-message-queue\mix.mq.server\mix.mq.server.csproj", "{7C5101F3-E3E6-42DB-8585-D08C2BE5E30C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.auth.api", "services\mix-auth-service\mix.auth.api\mix.auth.api.csproj", "{9C04921A-38D5-4EC9-8FF5-0E0D74681049}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.auth.api", "services\core\mix-auth-service\mix.auth.api\mix.auth.api.csproj", "{9C04921A-38D5-4EC9-8FF5-0E0D74681049}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -348,8 +348,8 @@ Global
{3BADD396-E830-468B-B2D8-A52FD5E6C6BD} = {4E880812-C336-4EB2-9FED-2E437957F50A}
{5FA252B6-6FDA-451E-BE5E-F6D82EDE9AB1} = {4E880812-C336-4EB2-9FED-2E437957F50A}
{F5D4C70F-DD2E-4EC9-A191-56A717B1B5EE} = {B4C40E02-E06A-4359-BDC5-349E103366AD}
{C93898B7-2001-4C29-9BBE-33A2E61C350A} = {C0A05428-767E-46C5-A31F-0D220E41F7C5}
{EC933357-1D95-4CDD-B290-7A5984FC1AA2} = {C0A05428-767E-46C5-A31F-0D220E41F7C5}
{C93898B7-2001-4C29-9BBE-33A2E61C350A} = {7C9FFA1B-D992-4E3F-B2B1-74D86E81512D}
{EC933357-1D95-4CDD-B290-7A5984FC1AA2} = {7C9FFA1B-D992-4E3F-B2B1-74D86E81512D}
{7C5101F3-E3E6-42DB-8585-D08C2BE5E30C} = {C93898B7-2001-4C29-9BBE-33A2E61C350A}
{9C04921A-38D5-4EC9-8FF5-0E0D74681049} = {EC933357-1D95-4CDD-B290-7A5984FC1AA2}
EndGlobalSection
Expand Down
24 changes: 22 additions & 2 deletions src/applications/mixcore.gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,29 @@ EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["platform/core/mix-heart/nuget.config", "platform/core/mix-heart/"]
COPY ["applications/mixcore.gateway/mixcore.gateway.csproj", "applications/mixcore.gateway/"]
COPY ["applications/mixcore.host.aspire/mixcore.host.aspire.ServiceDefaults/mixcore.host.aspire.ServiceDefaults.csproj", "applications/mixcore.host.aspire/mixcore.host.aspire.ServiceDefaults/"]
RUN dotnet restore "./applications/mixcore.gateway/./mixcore.gateway.csproj"
COPY ["platform/mix.library/mix.library.csproj", "platform/mix.library/"]
COPY ["platform/core/mix.mixdb.event/mix.mixdb.event.csproj", "platform/core/mix.mixdb.event/"]
COPY ["platform/mix.mixdb/mix.mixdb.csproj", "platform/mix.mixdb/"]
COPY ["platform/mix.database/mix.database.csproj", "platform/mix.database/"]
COPY ["platform/mix.shared/mix.shared.csproj", "platform/mix.shared/"]
COPY ["platform/core/mix-heart/src/mix.heart/mix.heart.csproj", "platform/core/mix-heart/src/mix.heart/"]
COPY ["platform/mix.constant/mix.constant.csproj", "platform/mix.constant/"]
COPY ["platform/mix.service/mix.service.csproj", "platform/mix.service/"]
COPY ["platform/mix.identity/mix.identity.csproj", "platform/mix.identity/"]
COPY ["platform/mix.auth/mix.auth.csproj", "platform/mix.auth/"]
COPY ["platform/mix.quartz/mix.quartz.csproj", "platform/mix.quartz/"]
COPY ["platform/mix.queue/mix.queue.csproj", "platform/mix.queue/"]
COPY ["services/core/mix-message-queue/mix.mq.server/mix.mq.server.csproj", "services/core/mix-message-queue/mix.mq/"]
COPY ["applications/mixcore.host.aspire.ServiceDefaults/mixcore.host.aspire.ServiceDefaults.csproj", "applications/mixcore.host.aspire.ServiceDefaults/"]
COPY ["services/core/mix-message-queue/mix.mq.lib/mix.mq.lib.csproj", "services/core/mix-message-queue/mix.mq.lib/"]
COPY ["platform/mix.signalr/mix.signalr.csproj", "platform/mix.signalr/"]
COPY ["platform/mix.repodb/mix.repodb.csproj", "platform/mix.repodb/"]
COPY ["platform/mix.communicator/mix.communicator.csproj", "platform/mix.communicator/"]
COPY ["platform/mix.signalr.hub/mix.signalr.hub.csproj", "platform/mix.signalr.hub/"]
COPY ["platform/mix.log/mix.log.lib.csproj", "platform/mix.log/"]
RUN dotnet restore "./applications/mixcore.gateway/mixcore.gateway.csproj"
COPY . .
WORKDIR "/src/applications/mixcore.gateway"
RUN dotnet build "./mixcore.gateway.csproj" -c $BUILD_CONFIGURATION -o /app/build
Expand Down
41 changes: 41 additions & 0 deletions src/applications/mixcore.gateway/Dockerfile_linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
COPY ["src/applications/mixcore.gateway/mixcore.gateway.csproj", "src/applications/mixcore.gateway/"]
COPY ["src/platform/mix.library/mix.library.csproj", "src/platform/mix.library/"]
COPY ["src/platform/core/mix.mixdb.event/mix.mixdb.event.csproj", "src/platform/core/mix.mixdb.event/"]
COPY ["src/platform/mix.mixdb/mix.mixdb.csproj", "src/platform/mix.mixdb/"]
COPY ["src/platform/mix.database/mix.database.csproj", "src/platform/mix.database/"]
COPY ["src/platform/mix.shared/mix.shared.csproj", "src/platform/mix.shared/"]
COPY ["src/platform/core/mix-heart/src/mix.heart/mix.heart.csproj", "src/platform/core/mix-heart/src/mix.heart/"]
COPY ["src/platform/mix.constant/mix.constant.csproj", "src/platform/mix.constant/"]
COPY ["src/platform/mix.service/mix.service.csproj", "src/platform/mix.service/"]
COPY ["src/platform/mix.identity/mix.identity.csproj", "src/platform/mix.identity/"]
COPY ["src/platform/mix.auth/mix.auth.csproj", "src/platform/mix.auth/"]
COPY ["src/platform/mix.quartz/mix.quartz.csproj", "src/platform/mix.quartz/"]
COPY ["src/platform/mix.queue/mix.queue.csproj", "src/platform/mix.queue/"]
COPY ["src/services/core/mix-message-queue/mix.mq.server/mix.mq.server.csproj", "src/services/core/mix-message-queue/mix.mq/"]
COPY ["src/applications/mixcore.host.aspire.ServiceDefaults/mixcore.host.aspire.ServiceDefaults.csproj", "applications/mixcore.host.aspire.ServiceDefaults/"]
COPY ["src/services/core/mix-message-queue/mix.mq.lib/mix.mq.lib.csproj", "src/services/core/mix-message-queue/mix.mq.lib/"]
COPY ["src/platform/mix.signalr/mix.signalr.csproj", "src/platform/mix.signalr/"]
COPY ["src/platform/mix.repodb/mix.repodb.csproj", "src/platform/mix.repodb/"]
COPY ["src/platform/mix.communicator/mix.communicator.csproj", "src/platform/mix.communicator/"]
COPY ["src/platform/mix.signalr.hub/mix.signalr.hub.csproj", "src/platform/mix.signalr.hub/"]
COPY ["src/platform/mix.log/mix.log.lib.csproj", "src/platform/mix.log/"]
RUN dotnet restore "src/applications/mixcore.gateway/mixcore.gateway.csproj"
COPY . .
RUN dotnet build "/src/applications/mixcore.gateway/mixcore.gateway.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "/src/applications/mixcore.gateway/mixcore.gateway.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "mixcore.gateway.dll"]
4 changes: 2 additions & 2 deletions src/applications/mixcore.gateway/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
using Mix.Database.Entities.Cms;
using Mix.Heart.Services;
using Mix.Lib.Helpers;
using Mix.Lib.Services;
using Mix.Shared.Services;
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
using System.Reflection;
using System.Text.Encodings.Web;
using System.Text.Unicode;


bool isInit = true;
Expand All @@ -36,6 +35,7 @@
builder.Services.AddControllers();
builder.Services.AddMixServices(Assembly.GetExecutingAssembly(), builder.Configuration);
builder.Services.AddMixAuthorize<MixCmsContext>(builder.Configuration);
builder.Services.AddScoped<MixIdentityService>();
builder.Services.TryAddSingleton<MixEndpointService>();
builder.Services.AddOcelot(builder.Configuration);
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
Expand Down
10 changes: 6 additions & 4 deletions src/applications/mixcore.gateway/mixcore.gateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>false</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<RootNamespace>Mixcore.Gateway</RootNamespace>
<RootNamespace>mixcore.gateway</RootNamespace>
<UserSecretsId>bbdd7c53-6dfa-4f6f-ab46-5ecda7005ed0</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ocelot" Version="21.0.0" />
<PackageReference Include="Ocelot.Cache.CacheManager" Version="21.0.0" />
<PackageReference Include="Ocelot" Version="23.2.2" />
<PackageReference Include="Ocelot.Cache.CacheManager" Version="23.2.2" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\platform\mix.library\mix.library.csproj" />
<ProjectReference Include="..\mixcore.host.aspire\mixcore.host.aspire.ServiceDefaults\mixcore.host.aspire.ServiceDefaults.csproj" />
<ProjectReference Include="..\mixcore.host.aspire.ServiceDefaults\mixcore.host.aspire.ServiceDefaults.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
37 changes: 0 additions & 37 deletions src/applications/mixcore.gateway/ocelot.json

This file was deleted.

79 changes: 0 additions & 79 deletions src/applications/mixcore.gateway/ocelot.sample.json

This file was deleted.

8 changes: 8 additions & 0 deletions src/applications/mixcore.host.aspire.AppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var builder = DistributedApplication.CreateBuilder(args);

var mixMq = builder.AddProject<Projects.mix_mq_server>("mix-mq-server");

builder.AddProject<Projects.mixcore>("mixcore").WithReference(mixMq);
builder.AddProject<Projects.mixcore_gateway>("gateway").WithReference(mixMq);

builder.Build().Run();
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16178"
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:16178",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22212"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Dashboard" Version="8.0.0-preview.2.23619.3" />
<PackageReference Include="Aspire.Hosting.AppHost" Version="8.0.0-preview.6.24214.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\services\core\mix-message-queue\mix.mq.server\mix.mq.server.csproj" />
<ProjectReference Include="..\..\services\core\mix-message-queue\mix.mq.server\mix.mq.server.csproj" />
<ProjectReference Include="..\mixcore.gateway\mixcore.gateway.csproj" />
<ProjectReference Include="..\mixcore\mixcore.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.Hosting;

public static class Extensions
{
public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder)
public static IHostApplicationBuilder AddServiceDefaults(this WebApplicationBuilder builder)
{
builder.ConfigureOpenTelemetry();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
<PackageReference Include="Grafana.OpenTelemetry" Version="0.7.0-beta.2" />
<PackageReference Include="Grafana.OpenTelemetry.Base" Version="0.7.0-beta.2" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.4.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.0-preview.2.23619.3" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.7.0-rc.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.6.0-beta.3" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
<PackageReference Include="System.Drawing.Common" Version="8.0.4" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="8.0.0" />
</ItemGroup>

Expand Down

This file was deleted.

This file was deleted.

Loading
Loading