diff --git a/Readme.md b/Readme.md index 604050f2..923f834b 100644 --- a/Readme.md +++ b/Readme.md @@ -35,9 +35,13 @@ - [x] 用户管理 - [x] 角色管理 - [x] 审计日志 -- [x] 后台任务(hangfire) -- [x] 集成事件(dotnetcore.cap) -- [x] IdentityServer4 - [x] 客户端管理 - [x] Api 资源管理 - [x] ApiScope 管理 - [x] Identity 资源管理 +- [x] 后台任务 +- [x] 集成事件 +- [x] IdentityServer4 + - [x] 客户端管理 + - [x] Api 资源管理 + - [x] ApiScope 管理 + - [x] Identity 资源管理 - [x] SinglaR 消息通知 - [x] 多语言 - [x] FreeSql diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/ICommandNotificationAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/ICommandNotificationAppService.cs deleted file mode 100644 index 132c360f..00000000 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/ICommandNotificationAppService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Application.Services; -using CompanyName.ProjectName.NotificationManagement.Notifications.Dtos; - -namespace CompanyName.ProjectName.NotificationManagement.Notifications -{ - public interface ICommandNotificationAppService : IApplicationService - { - /// - /// 消息设置为已读 - /// - /// - /// - Task SetReadAsync(SetReadInput input); - - /// - /// 创建一个消息 - /// 测试使用 - /// - /// - /// - Task CreateAsync(CreateNotificationInput input); - } -} \ No newline at end of file diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/INotificationAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/INotificationAppService.cs index c2617707..91bf6982 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/INotificationAppService.cs +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/INotificationAppService.cs @@ -12,5 +12,20 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications /// /// Task SendMessageAsync(string title, string content, MessageType messageType, List users); + + /// + /// 消息设置为已读 + /// + /// + /// + Task SetReadAsync(SetReadInput input); + + /// + /// 创建一个消息 + /// 测试使用 + /// + /// + /// + Task CreateAsync(CreateNotificationInput input); } } \ No newline at end of file diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Samples/ISampleAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Samples/ISampleAppService.cs deleted file mode 100644 index ef610631..00000000 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Samples/ISampleAppService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Application.Services; - -namespace CompanyName.ProjectName.NotificationManagement.Samples -{ - public interface ISampleAppService : IApplicationService - { - Task GetAsync(); - - Task GetAuthorizedAsync(); - } -} diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Samples/SampleDto.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Samples/SampleDto.cs deleted file mode 100644 index 601f2917..00000000 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Samples/SampleDto.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace CompanyName.ProjectName.NotificationManagement.Samples -{ - public class SampleDto - { - public int Value { get; set; } - } -} \ No newline at end of file diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/CommandNotificationAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/CommandNotificationAppService.cs deleted file mode 100644 index 10efd5d6..00000000 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/CommandNotificationAppService.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Threading.Tasks; -using CompanyName.ProjectName.NotificationManagement.Notifications.Dtos; -using Volo.Abp.Users; - -namespace CompanyName.ProjectName.NotificationManagement.Notifications -{ - public class CommandNotificationAppService : NotificationManagementAppService, ICommandNotificationAppService - { - private readonly NotificationManager _notificationManager; - - private readonly ICurrentUser _currentUser; - public CommandNotificationAppService(NotificationManager notificationManager, ICurrentUser currentUser) - { - _notificationManager = notificationManager; - _currentUser = currentUser; - } - - public Task SetReadAsync(SetReadInput input) - { - return _notificationManager.SetReadAsync(input.Id, input.ReceiveId); - } - - public async Task CreateAsync(CreateNotificationInput input) - { - if (_currentUser.Id != null) - await _notificationManager.CreateAsync(input.Title, input.Content, _currentUser.Id.Value, input.ReceiveIds, - input.MessageType); - } - } -} \ No newline at end of file diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/CreatedNotificationDistributedEventHandler.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/NotificationCreatedDistributedEventHandler.cs similarity index 89% rename from aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/CreatedNotificationDistributedEventHandler.cs rename to aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/NotificationCreatedDistributedEventHandler.cs index 4ac3f81c..acd0c069 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/CreatedNotificationDistributedEventHandler.cs +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/DistributedEventHandlers/NotificationCreatedDistributedEventHandler.cs @@ -10,12 +10,12 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications.Distribut /// 创建消息事件处理 /// public class - CreatedNotificationDistributedEventHandler : IDistributedEventHandler, + NotificationCreatedDistributedEventHandler : IDistributedEventHandler, ITransientDependency { private readonly INotificationAppService _hubAppService; - public CreatedNotificationDistributedEventHandler(INotificationAppService hubAppService) + public NotificationCreatedDistributedEventHandler(INotificationAppService hubAppService) { _hubAppService = hubAppService; } diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/NotificationAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/NotificationAppService.cs index 2f11de40..e6a86d47 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/NotificationAppService.cs +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/NotificationAppService.cs @@ -24,6 +24,18 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications _currentUser = currentUser; } + public Task SetReadAsync(SetReadInput input) + { + return _notificationManager.SetReadAsync(input.Id, input.ReceiveId); + } + + public async Task CreateAsync(CreateNotificationInput input) + { + if (_currentUser.Id != null) + await _notificationManager.CreateAsync(input.Title, input.Content, _currentUser.Id.Value, input.ReceiveIds, + input.MessageType); + } + /// /// 发送消息 /// diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Samples/SampleAppService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Samples/SampleAppService.cs deleted file mode 100644 index 19b780b8..00000000 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Samples/SampleAppService.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; - -namespace CompanyName.ProjectName.NotificationManagement.Samples -{ - public class SampleAppService : NotificationManagementAppService, ISampleAppService - { - public Task GetAsync() - { - return Task.FromResult( - new SampleDto - { - Value = 42 - } - ); - } - - [Authorize] - public Task GetAuthorizedAsync() - { - return Task.FromResult( - new SampleDto - { - Value = 42 - } - ); - } - } -} \ No newline at end of file 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 f2ad6bc3..b2133f6e 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 @@ -11,10 +11,11 @@ using Volo.Abp.EntityFrameworkCore; namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Notifications { - public class DapperNotificationRepository : DapperRepository, + public class DapperNotificationRepository : DapperRepository, IDapperNotificationRepository { - public DapperNotificationRepository(IDbContextProvider dbContextProvider) : + public DapperNotificationRepository( + IDbContextProvider dbContextProvider) : base(dbContextProvider) { } @@ -23,16 +24,18 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not /// 分页查询广播消息 /// /// - public async Task> GetPageBroadCastNotificationByUserIdAsync( - Guid userId, - int maxResultCount = 10, - int skipCount = 0, - CancellationToken cancellationToken = default) + public async Task> + GetPageBroadCastNotificationByUserIdAsync( + Guid userId, + int maxResultCount = 10, + int skipCount = 0, + CancellationToken cancellationToken = default) { var sql = BuildPageBroadCastSql(); sql += $" LIMIT {maxResultCount} OFFSET {skipCount}"; var tran = await GetDbTransactionAsync(); - return (await (await GetDbConnectionAsync()).QueryAsync(sql, new {userId}, + return (await (await GetDbConnectionAsync()).QueryAsync( + sql, new { userId }, transaction: tran)) .ToList(); } @@ -47,7 +50,8 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not { var sql = BuildPageBroadCastCountSql(); var tran = await GetDbTransactionAsync(); - return (await (await GetDbConnectionAsync()).QueryAsync(sql, new {userId}, transaction: tran)) + return (await (await GetDbConnectionAsync()).QueryAsync(sql, new { userId }, + transaction: tran)) .FirstOrDefault(); } @@ -64,7 +68,8 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not var sql = BuildPageTextSql(); sql += $" LIMIT {maxResultCount} OFFSET {skipCount}"; var tran = await GetDbTransactionAsync(); - return (await (await GetDbConnectionAsync()).QueryAsync(sql, new {userId}, + return (await (await GetDbConnectionAsync()).QueryAsync( + sql, new { userId }, transaction: tran)) .ToList(); } @@ -79,7 +84,8 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not { var sql = BuildPageTextCountSql(); var tran = await GetDbTransactionAsync(); - return (await (await GetDbConnectionAsync()).QueryAsync(sql, new {userId}, transaction: tran)) + return (await (await GetDbConnectionAsync()).QueryAsync(sql, new { userId }, + transaction: tran)) .FirstOrDefault(); } @@ -91,8 +97,8 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not + "a.Content," + "a.CreationTime, " + "b.Read " - + "from Notification a " - + "left join NotificationSubscription b on b.NotificationId=a.Id " + + $"from {NotificationManagementDbProperties.DbTablePrefix}Notification a " + + $"left join {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b on b.NotificationId=a.Id " + "where a.IsDeleted=0 " + "and a.MessageType=20 " + "and b.ReceiveId=@userId " @@ -104,7 +110,7 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not return "select " + "count(1) as count " + "from Notification a " - + "left join NotificationSubscription b on b.NotificationId=a.Id " + + $"left join {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b on b.NotificationId=a.Id " + "where a.IsDeleted=0 " + "and a.MessageType=20 " + "and b.ReceiveId=@userId "; @@ -114,21 +120,21 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not { return "select count(1) as count from (" + "select a.Id, a.Title, a.Content, a.CreationTime, a.SenderId, false as \"Read\" " - + "from Notification a " + + $"from {NotificationManagementDbProperties.DbTablePrefix}Notification a " + "where a.IsDeleted = 0 " + "and a.MessageType = 10 " + "and a.Id not in " + " (select NotificationId " - + "from NotificationSubscription b " - + " where b.ReceiveId = '39febd0a-4c5d-d3b8-b223-ef49e7a3d7e2') " + + $"from {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b " + + " where b.ReceiveId = @userId) " + "union " + " select a.Id, a.Title, a.Content, a.CreationTime, a.SenderId, true as \"Read\" " - + "from Notification a " + + $"from {NotificationManagementDbProperties.DbTablePrefix}Notification a " + " where a.IsDeleted = 0 " + " and a.MessageType = 10 " + "and a.Id in " - + " (select NotificationId " - + "from NotificationSubscription b " + + $" (select {NotificationManagementDbProperties.DbTablePrefix}NotificationId " + + $"from {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b " + "where b.ReceiveId = @userId) " + " ) as tt "; } @@ -137,21 +143,21 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Not { return "select * from (" + "select a.Id, a.Title, a.Content, a.CreationTime, a.SenderId, false as \"Read\" " - + "from Notification a " + + $"from {NotificationManagementDbProperties.DbTablePrefix}Notification a " + "where a.IsDeleted = 0 " + "and a.MessageType = 10 " + "and a.Id not in " + " (select NotificationId " - + "from NotificationSubscription b " - + " where b.ReceiveId = '39febd0a-4c5d-d3b8-b223-ef49e7a3d7e2') " + + $"from {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b " + + " where b.ReceiveId = @userId) " + "union" + " select a.Id, a.Title, a.Content, a.CreationTime, a.SenderId, true as \"Read\" " - + "from Notification a " + + $"from {NotificationManagementDbProperties.DbTablePrefix}Notification a " + " where a.IsDeleted = 0 " + " and a.MessageType = 10 " + "and a.Id in " + " (select NotificationId " - + "from NotificationSubscription b " + + $"from {NotificationManagementDbProperties.DbTablePrefix}NotificationSubscription b " + "where b.ReceiveId = @userId)" + " ) as tt order by tt.Read,tt.CreationTime "; } 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 d906a85d..9f9b5e9e 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 @@ -12,13 +12,13 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications public class NotificationController : AbpController, IApplicationService { private readonly IQueryNotificationAppService _queryNotificationAppService; - private readonly ICommandNotificationAppService _commandNotificationAppService; + private readonly INotificationAppService _notificationAppService; public NotificationController(IQueryNotificationAppService queryNotificationAppService, - ICommandNotificationAppService commandNotificationAppService) + INotificationAppService notificationAppService) { _queryNotificationAppService = queryNotificationAppService; - _commandNotificationAppService = commandNotificationAppService; + _notificationAppService = notificationAppService; } @@ -52,14 +52,14 @@ namespace CompanyName.ProjectName.NotificationManagement.Notifications [SwaggerOperation(summary: "消息设置为已读", Tags = new[] {"Notification"})] public Task SetReadAsync(SetReadInput input) { - return _commandNotificationAppService.SetReadAsync(input); + return _notificationAppService.SetReadAsync(input); } [HttpPost("Create")] [SwaggerOperation(summary: "创建消息-测试使用", Tags = new[] {"Notification"})] public Task CreateAsync(CreateNotificationInput input) { - return _commandNotificationAppService.CreateAsync(input); + return _notificationAppService.CreateAsync(input); } } } \ No newline at end of file diff --git a/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.Application.Tests/Samples/SampleAppService_Tests.cs b/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.Application.Tests/Samples/SampleAppService_Tests.cs deleted file mode 100644 index 6b83c537..00000000 --- a/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.Application.Tests/Samples/SampleAppService_Tests.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Threading.Tasks; -using Shouldly; -using Xunit; - -namespace CompanyName.ProjectName.NotificationManagement.Samples -{ - public class SampleAppService_Tests : NotificationManagementApplicationTestBase - { - private readonly ISampleAppService _sampleAppService; - - public SampleAppService_Tests() - { - _sampleAppService = GetRequiredService(); - } - - [Fact] - public async Task GetAsync() - { - var result = await _sampleAppService.GetAsync(); - result.Value.ShouldBe(42); - } - - [Fact] - public async Task GetAuthorizedAsync() - { - var result = await _sampleAppService.GetAuthorizedAsync(); - result.Value.ShouldBe(42); - } - } -} diff --git a/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.Domain.Tests/Samples/SampleManager_Tests.cs b/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.Domain.Tests/Samples/SampleManager_Tests.cs deleted file mode 100644 index f2d24a34..00000000 --- a/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.Domain.Tests/Samples/SampleManager_Tests.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Threading.Tasks; -using Xunit; - -namespace CompanyName.ProjectName.NotificationManagement.Samples -{ - public class SampleManager_Tests : NotificationManagementDomainTestBase - { - //private readonly SampleManager _sampleManager; - - public SampleManager_Tests() - { - //_sampleManager = GetRequiredService(); - } - - - } -} diff --git a/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs b/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs deleted file mode 100644 index 5c96e1cb..00000000 --- a/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs +++ /dev/null @@ -1,12 +0,0 @@ -using CompanyName.ProjectName.NotificationManagement.Samples; - -namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore.Samples -{ - public class SampleRepository_Tests : SampleRepository_Tests - { - /* Don't write custom repository tests here, instead write to - * the base class. - * One exception can be some specific tests related to EF core. - */ - } -} diff --git a/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.TestBase/Samples/SampleRepository_Tests.cs b/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.TestBase/Samples/SampleRepository_Tests.cs deleted file mode 100644 index a4863403..00000000 --- a/aspnet-core/modules/NotificationManagement/test/CompanyName.ProjectName.NotificationManagement.TestBase/Samples/SampleRepository_Tests.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Modularity; -using Xunit; - -namespace CompanyName.ProjectName.NotificationManagement.Samples -{ - /* Write your custom repository tests like that, in this project, as abstract classes. - * Then inherit these abstract classes from EF Core & MongoDB test projects. - * In this way, both database providers are tests with the same set tests. - */ - public abstract class SampleRepository_Tests : NotificationManagementTestBase - where TStartupModule : IAbpModule - { - //private readonly ISampleRepository _sampleRepository; - - protected SampleRepository_Tests() - { - //_sampleRepository = GetRequiredService(); - } - - } -} 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 43a15ac7..f5734fed 100644 --- a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs +++ b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs @@ -78,8 +78,6 @@ namespace CompanyName.ProjectName ConfigureHangfireMysql(context); ConfigurationCap(context); ConfigurationStsHttpClient(context); - - } public override void OnApplicationInitialization(ApplicationInitializationContext context) @@ -122,7 +120,7 @@ namespace CompanyName.ProjectName Authorization = new[] { new CustomHangfireAuthorizeFilter() }, IgnoreAntiforgeryToken = true }); - + if (configuration.GetValue("Consul:Enabled", false)) { app.UseConsul(); diff --git a/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/ProjectNameIdentityServerModule.cs b/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/ProjectNameIdentityServerModule.cs index ded2833d..024b928e 100644 --- a/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/ProjectNameIdentityServerModule.cs +++ b/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/ProjectNameIdentityServerModule.cs @@ -1,5 +1,4 @@ using System; -using System.IO; using System.Linq; using Localization.Resources.AbpUi; using Microsoft.AspNetCore.Builder; @@ -11,16 +10,11 @@ using CompanyName.ProjectName.EntityFrameworkCore; using CompanyName.ProjectName.Extensions; using CompanyName.ProjectName.Localization; using CompanyName.ProjectName.MultiTenancy; -using IdentityServer4.Configuration; -using IdentityServer4.Extensions; -using IdentityServer4.Models; using Microsoft.Extensions.Configuration; using StackExchange.Redis; using Volo.Abp; using Volo.Abp.Account; using Volo.Abp.Account.Web; -using Volo.Abp.AspNetCore.Mvc.UI; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; @@ -34,7 +28,6 @@ using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation.Urls; -using Volo.Abp.UI; using Volo.Abp.VirtualFileSystem; namespace CompanyName.ProjectName diff --git a/aspnet-core/services/src/CompanyName.ProjectName.DbMigrator/appsettings.secrets.json b/aspnet-core/services/src/CompanyName.ProjectName.DbMigrator/appsettings.secrets.json deleted file mode 100644 index 7a73a41b..00000000 --- a/aspnet-core/services/src/CompanyName.ProjectName.DbMigrator/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Domain/Data/Seeds/AbpSettingDataSeedContributor.cs b/aspnet-core/services/src/CompanyName.ProjectName.Domain/Data/Seeds/AbpSettingDataSeedContributor.cs index 8a3ac7ee..de8af03d 100644 --- a/aspnet-core/services/src/CompanyName.ProjectName.Domain/Data/Seeds/AbpSettingDataSeedContributor.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.Domain/Data/Seeds/AbpSettingDataSeedContributor.cs @@ -18,11 +18,7 @@ namespace CompanyName.ProjectName.Data.Seeds public async Task SeedAsync(DataSeedContext context) { // 设置默认语言 - var defaultLanguage = await _settingManager.GetOrNullGlobalAsync(DefaultLanguageKey); - if (defaultLanguage == null) - { - await _settingManager.SetGlobalAsync(DefaultLanguageKey, DefaultLanguage); - } + await _settingManager.SetGlobalAsync(DefaultLanguageKey, DefaultLanguage); } } } \ No newline at end of file diff --git a/aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/CompanyName.ProjectName.Shared.Hosting.Microservices.csproj b/aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/CompanyName.ProjectName.Shared.Hosting.Microservices.csproj index 0536976b..7b36972d 100644 --- a/aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/CompanyName.ProjectName.Shared.Hosting.Microservices.csproj +++ b/aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/CompanyName.ProjectName.Shared.Hosting.Microservices.csproj @@ -7,6 +7,7 @@ +