From abcd4c9ed0712bfd0b1922314f1be4a6573cd8ce Mon Sep 17 00:00:00 2001 From: "SHUANGBAOJUN\\Administrator" <11> Date: Mon, 22 Nov 2021 22:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=97=A5=E5=B8=B8Bug=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aspnet-core/Directory.Build.props | 64 ++++++++++--------- ...ame.DataDictionaryManagement.Domain.csproj | 2 +- ...me.DataDictionaryManagement.HttpApi.csproj | 2 +- ....NotificationManagement.Application.csproj | 2 +- ...Name.NotificationManagement.HttpApi.csproj | 2 +- .../Notifications/NotificationController.cs | 12 +++- .../Pages/Login.cshtml.cs | 4 +- .../ProjectNameHttpApiHostModule.cs | 6 +- ...asticSearchApplicationAutoMapperProfile.cs | 18 ++++++ ...ntityServerApplicationAutoMapperProfile.cs | 1 - .../IProjectNameDbContext.cs | 16 +++++ .../ProjectNameDbContext.cs | 10 +-- .../Controllers/ProjectNameController.cs | 2 +- 13 files changed, 93 insertions(+), 48 deletions(-) create mode 100644 aspnet-core/services/src/CompanyName.ProjectName.Application/ElasticSearchs/ElasticSearchApplicationAutoMapperProfile.cs create mode 100644 aspnet-core/services/src/CompanyName.ProjectName.EntityFrameworkCore/EntityFrameworkCore/IProjectNameDbContext.cs diff --git a/aspnet-core/Directory.Build.props b/aspnet-core/Directory.Build.props index 391d0a7a..29c76653 100644 --- a/aspnet-core/Directory.Build.props +++ b/aspnet-core/Directory.Build.props @@ -1,36 +1,38 @@  - - 4.4.0 - - 5.1.4 - 5.0.12 - 13.0.1 - 5.0.0 - 5.0.0 - 5.0.0 - 1.5.0 - 2.10.0 - 3.0.1 - 1.4.0 - 5.0.0 - 3.1.1 - 4.1.0 - 7.0.0 - 3.1.0 - 8.4.1 - 7.15.1 - 2.0.3 - 6.1.4 - 16.9.1 - 4.2.2 - 4.0.3 - 2.4.1 - 2.4.3 - 17.0.0 - 6.2.3 - 2.5.200 + + 4.4.0 - + 5.1.4 + 5.0.12 + 13.0.1 + 5.0.0 + 5.0.0 + 5.0.0 + 1.5.0 + 2.10.0 + 3.0.1 + 1.4.0 + 5.0.0 + 3.1.1 + 4.1.0 + 7.0.0 + 3.1.0 + 8.4.1 + 7.15.1 + 2.0.3 + 6.1.4 + 16.9.1 + 4.2.2 + 4.0.3 + 2.4.1 + 2.4.3 + 17.0.0 + 6.2.3 + 2.5.200 + + 2.5.200 + + \ No newline at end of file diff --git a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj index c233f5b4..9689a68c 100644 --- a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj +++ b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj @@ -9,7 +9,7 @@ - + diff --git a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.HttpApi/CompanyName.ProjectName.DataDictionaryManagement.HttpApi.csproj b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.HttpApi/CompanyName.ProjectName.DataDictionaryManagement.HttpApi.csproj index bf3b16fe..822bbb1b 100644 --- a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.HttpApi/CompanyName.ProjectName.DataDictionaryManagement.HttpApi.csproj +++ b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.HttpApi/CompanyName.ProjectName.DataDictionaryManagement.HttpApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/CompanyName.ProjectName.NotificationManagement.Application.csproj b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/CompanyName.ProjectName.NotificationManagement.Application.csproj index b33512ca..c09d77a4 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/CompanyName.ProjectName.NotificationManagement.Application.csproj +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/CompanyName.ProjectName.NotificationManagement.Application.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/CompanyName.ProjectName.NotificationManagement.HttpApi.csproj b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/CompanyName.ProjectName.NotificationManagement.HttpApi.csproj index 9ead986e..ea7fc73b 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/CompanyName.ProjectName.NotificationManagement.HttpApi.csproj +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/CompanyName.ProjectName.NotificationManagement.HttpApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/Notifications/NotificationController.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/Notifications/NotificationController.cs index fe8ff838..cf8dc48c 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/Notifications/NotificationController.cs +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.HttpApi/Notifications/NotificationController.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading.Tasks; using CompanyName.ProjectName.NotificationManagement.Notifications.Dtos; using Microsoft.AspNetCore.Mvc; using Swashbuckle.AspNetCore.Annotations; @@ -9,7 +10,7 @@ using Volo.Abp.AspNetCore.Mvc; namespace CompanyName.ProjectName.NotificationManagement.Notifications { [Route("Notification")] - public class NotificationController : AbpController, IApplicationService + public class NotificationController : AbpController, INotificationAppService { private readonly INotificationAppService _notificationAppService; @@ -61,5 +62,12 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications { return _notificationAppService.CreateAsync(input); } + + [HttpPost("SendMessage")] + [SwaggerOperation(summary: "发送消息-测试使用", Tags = new[] { "Notification" })] + public Task SendMessageAsync(string title, string content, MessageType messageType, List users) + { + return _notificationAppService.SendMessageAsync(title, content, messageType, users); + } } } \ No newline at end of file diff --git a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Pages/Login.cshtml.cs b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Pages/Login.cshtml.cs index dcb27b29..4ce450a3 100644 --- a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Pages/Login.cshtml.cs +++ b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Pages/Login.cshtml.cs @@ -40,6 +40,7 @@ namespace CompanyName.ProjectName.Pages if (userName.IsNullOrWhiteSpace() || password.IsNullOrWhiteSpace()) { Response.Redirect("/Login"); + return; } try @@ -56,7 +57,7 @@ namespace CompanyName.ProjectName.Pages var result = await _accountAppService.LoginAsync(new LoginInput() - { Name = userName, Password = password }); + { Name = userName, Password = password }); Response.Cookies.Append(ProjectNameHttpApiHostConsts.DefaultCookieName, result.Token, options); } @@ -64,6 +65,7 @@ namespace CompanyName.ProjectName.Pages { _logger.LogError($"登录失败:{e.Message}"); Response.Redirect("/Login"); + return; } Response.Redirect("/monitor"); diff --git a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs index f1a46778..971b88d0 100644 --- a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs +++ b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs @@ -293,13 +293,13 @@ namespace CompanyName.ProjectName options.AddSecurityDefinition(JwtBearerDefaults.AuthenticationScheme, new OpenApiSecurityScheme() { - Description = - "Please enter into field the word 'Bearer' followed by a space and the JWT value", + Description = "直接在下框输入JWT生成的Token", Name = "Authorization", In = ParameterLocation.Header, Type = SecuritySchemeType.Http, Scheme = JwtBearerDefaults.AuthenticationScheme, BearerFormat = "JWT" + }); options.AddSecurityRequirement(new OpenApiSecurityRequirement { @@ -320,7 +320,7 @@ namespace CompanyName.ProjectName Type = SecuritySchemeType.ApiKey, In = ParameterLocation.Header, Name = "Accept-Language", - Description = "多语言" + Description = "多语言设置,系统预设语言有zh-Hans、en,默认为zh-Hans" }); options.AddSecurityRequirement(new OpenApiSecurityRequirement diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application/ElasticSearchs/ElasticSearchApplicationAutoMapperProfile.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application/ElasticSearchs/ElasticSearchApplicationAutoMapperProfile.cs new file mode 100644 index 00000000..4fc9cc0c --- /dev/null +++ b/aspnet-core/services/src/CompanyName.ProjectName.Application/ElasticSearchs/ElasticSearchApplicationAutoMapperProfile.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using CompanyName.ProjectName.ElasticsearchRepository.Dto; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CompanyName.ProjectName.ElasticSearchs +{ + public class ElasticSearchApplicationAutoMapperProfile : Profile + { + public ElasticSearchApplicationAutoMapperProfile() + { + CreateMap(); + } + } +} \ No newline at end of file diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Application/IdentityServers/IdentityServerApplicationAutoMapperProfile.cs b/aspnet-core/services/src/CompanyName.ProjectName.Application/IdentityServers/IdentityServerApplicationAutoMapperProfile.cs index 843988f4..edfd966b 100644 --- a/aspnet-core/services/src/CompanyName.ProjectName.Application/IdentityServers/IdentityServerApplicationAutoMapperProfile.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.Application/IdentityServers/IdentityServerApplicationAutoMapperProfile.cs @@ -38,7 +38,6 @@ namespace CompanyName.ProjectName.IdentityServers.Mappers CreateMap(); CreateMap(); - CreateMap(); } } } \ No newline at end of file diff --git a/aspnet-core/services/src/CompanyName.ProjectName.EntityFrameworkCore/EntityFrameworkCore/IProjectNameDbContext.cs b/aspnet-core/services/src/CompanyName.ProjectName.EntityFrameworkCore/EntityFrameworkCore/IProjectNameDbContext.cs new file mode 100644 index 00000000..413318f2 --- /dev/null +++ b/aspnet-core/services/src/CompanyName.ProjectName.EntityFrameworkCore/EntityFrameworkCore/IProjectNameDbContext.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace CompanyName.ProjectName.EntityFrameworkCore +{ + [ConnectionStringName("Default")] + public interface IProjectNameDbContext : IEfCoreDbContext + { + + } +} diff --git a/aspnet-core/services/src/CompanyName.ProjectName.EntityFrameworkCore/EntityFrameworkCore/ProjectNameDbContext.cs b/aspnet-core/services/src/CompanyName.ProjectName.EntityFrameworkCore/EntityFrameworkCore/ProjectNameDbContext.cs index 5d34127e..34954062 100644 --- a/aspnet-core/services/src/CompanyName.ProjectName.EntityFrameworkCore/EntityFrameworkCore/ProjectNameDbContext.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.EntityFrameworkCore/EntityFrameworkCore/ProjectNameDbContext.cs @@ -36,7 +36,7 @@ namespace CompanyName.ProjectName.EntityFrameworkCore * used modules (as explained above). See ProjectNameMigrationsDbContext for migrations. */ [ConnectionStringName("Default")] - public class ProjectNameDbContext : AbpDbContext, + public class ProjectNameDbContext : AbpDbContext, IProjectNameDbContext, IFeatureManagementDbContext, IIdentityDbContext, IPermissionManagementDbContext, @@ -70,7 +70,7 @@ namespace CompanyName.ProjectName.EntityFrameworkCore protected override void OnModelCreating(ModelBuilder builder) { - + // 如何设置表前缀 // Abp框架表前缀 Abp得不建议修改表前缀 // AbpCommonDbProperties.DbTablePrefix = "xxx"; @@ -80,7 +80,7 @@ namespace CompanyName.ProjectName.EntityFrameworkCore //NotificationManagementDbProperties = "xxx" base.OnModelCreating(builder); - builder.ConfigurePermissionManagement( ); + builder.ConfigurePermissionManagement(); builder.ConfigureSettingManagement(); builder.ConfigureBackgroundJobs(); builder.ConfigureAuditLogging(); @@ -89,8 +89,8 @@ namespace CompanyName.ProjectName.EntityFrameworkCore builder.ConfigureTenantManagement(); builder.ConfigureIdentityServer(); builder.ConfigureProjectName(); - - + + // 数据字典 builder.ConfigureDataDictionaryManagement(); diff --git a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/ProjectNameController.cs b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/ProjectNameController.cs index 708f1861..9acebfa8 100644 --- a/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/ProjectNameController.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/ProjectNameController.cs @@ -6,7 +6,7 @@ namespace CompanyName.ProjectName.Controllers { /* Inherit your controllers from this class. */ - public abstract class ProjectNameController : AbpController, IApplicationService + public abstract class ProjectNameController : AbpController { protected ProjectNameController() {