From b9c04542928a801a831e965a3efa919c95ebf888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=86=9B?= <510423039@qq.com> Date: Mon, 15 Nov 2021 21:03:19 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E4=BF=AE=E6=94=B9=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Properties/launchSettings.json | 2 +- .../appsettings.Production.json | 8 ++++---- .../Notifications/DapperNotificationRepository.cs | 12 ++++++------ .../Properties/launchSettings.json | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/aspnet-core/gateways/CompanyName.ProjectName.WebGateway/Properties/launchSettings.json b/aspnet-core/gateways/CompanyName.ProjectName.WebGateway/Properties/launchSettings.json index e2aab069..bc139af1 100644 --- a/aspnet-core/gateways/CompanyName.ProjectName.WebGateway/Properties/launchSettings.json +++ b/aspnet-core/gateways/CompanyName.ProjectName.WebGateway/Properties/launchSettings.json @@ -7,7 +7,7 @@ "launchUrl": "swagger", "applicationUrl": "http://localhost:44314", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Production" } } } diff --git a/aspnet-core/gateways/CompanyName.ProjectName.WebGateway/appsettings.Production.json b/aspnet-core/gateways/CompanyName.ProjectName.WebGateway/appsettings.Production.json index 3f557e88..11ae9e2d 100644 --- a/aspnet-core/gateways/CompanyName.ProjectName.WebGateway/appsettings.Production.json +++ b/aspnet-core/gateways/CompanyName.ProjectName.WebGateway/appsettings.Production.json @@ -15,7 +15,7 @@ }, "Routes": [ { - "DownstreamPathTemplate": "/swagger/ProjectName/swagger.json", + "DownstreamPathTemplate": "/{url}", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { @@ -23,7 +23,7 @@ "Port": 44315 } ], - "UpstreamPathTemplate": "/ProjectName/swagger.json", + "UpstreamPathTemplate": "/gateway/{url}", "UpstreamHttpMethod": [ "Get", "Post", @@ -33,14 +33,14 @@ }, { "DownstreamPathTemplate": "/{url}", - "DownstreamScheme": "http", + "DownstreamScheme": "ws", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44315 } ], - "UpstreamPathTemplate": "/{url}", + "UpstreamPathTemplate": "/ws/{url}", "UpstreamHttpMethod": [ "Get", "Post", diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/Notifications/DapperNotificationRepository.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/Notifications/DapperNotificationRepository.cs index b2133f6e..0522a5bf 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/Notifications/DapperNotificationRepository.cs +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/Notifications/DapperNotificationRepository.cs @@ -101,7 +101,7 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not + $"left join {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b on b.NotificationId=a.Id " + "where a.IsDeleted=0 " + "and a.MessageType=20 " - + "and b.ReceiveId=@userId " + + "and b.ReceiveId=?userId " + "order by b.Read, CreationTime desc "; } @@ -113,7 +113,7 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not + $"left join {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b on b.NotificationId=a.Id " + "where a.IsDeleted=0 " + "and a.MessageType=20 " - + "and b.ReceiveId=@userId "; + + "and b.ReceiveId=?userId "; } private string BuildPageBroadCastCountSql() @@ -126,7 +126,7 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not + "and a.Id not in " + " (select NotificationId " + $"from {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b " - + " where b.ReceiveId = @userId) " + + " where b.ReceiveId = ?userId) " + "union " + " select a.Id, a.Title, a.Content, a.CreationTime, a.SenderId, true as \"Read\" " + $"from {NotificationManagementDbProperties.DbTablePrefix}Notification a " @@ -135,7 +135,7 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not + "and a.Id in " + $" (select {NotificationManagementDbProperties.DbTablePrefix}NotificationId " + $"from {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b " - + "where b.ReceiveId = @userId) " + + "where b.ReceiveId = ?userId) " + " ) as tt "; } @@ -149,7 +149,7 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not + "and a.Id not in " + " (select NotificationId " + $"from {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b " - + " where b.ReceiveId = @userId) " + + " where b.ReceiveId = ?userId) " + "union" + " select a.Id, a.Title, a.Content, a.CreationTime, a.SenderId, true as \"Read\" " + $"from {NotificationManagementDbProperties.DbTablePrefix}Notification a " @@ -158,7 +158,7 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not + "and a.Id in " + " (select NotificationId " + $"from {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b " - + "where b.ReceiveId = @userId)" + + "where b.ReceiveId = ?userId)" + " ) as tt order by tt.Read,tt.CreationTime "; } } diff --git a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Properties/launchSettings.json b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Properties/launchSettings.json index d1785b53..ec45c5f9 100644 --- a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Properties/launchSettings.json +++ b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Properties/launchSettings.json @@ -5,7 +5,7 @@ "launchBrowser": true, "applicationUrl": "http://localhost:44315", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Production" } } }