Browse Source

✨ 修改通知模块

pull/11/head
王军 5 years ago
parent
commit
b9c0454292
  1. 2
      aspnet-core/gateways/CompanyName.ProjectName.WebGateway/Properties/launchSettings.json
  2. 8
      aspnet-core/gateways/CompanyName.ProjectName.WebGateway/appsettings.Production.json
  3. 12
      aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/Notifications/DapperNotificationRepository.cs
  4. 2
      aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Properties/launchSettings.json

2
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"
}
}
}

8
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",

12
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 ";
}
}

2
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"
}
}
}

Loading…
Cancel
Save