Browse Source

feat: reduce dependencies and remove useless query criteria

pull/315/head
cKey 4 years ago
parent
commit
9247c044fe
  1. 7
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 4
      aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalROptions.cs
  3. 19
      aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs
  4. 4
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs
  5. 2
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Group/IUserGroupStore.cs
  6. 2
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs
  7. 3
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageBlocker.cs
  8. 23
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageProcessor.cs
  9. 5
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs
  10. 6
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageState.cs
  11. 19
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageProcessor.cs
  12. 11
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Settings/AbpIMSettingNames.cs
  13. 2
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalROptions.cs
  14. 9
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs
  15. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs
  16. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs
  17. 1
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj
  18. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs
  19. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs
  20. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs
  21. 2
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupUserGetByPagedDto.cs
  22. 2
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs
  23. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs
  24. 2
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/UserNotificationGetByPagedDto.cs
  25. 6
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/ChatAppService.cs
  26. 8
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs
  27. 2
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/MyNotificationAppService.cs
  28. 2
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/MessageServiceResource.cs
  29. 4
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs
  30. 30
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingDefinitionProvider.cs
  31. 11
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingNames.cs
  32. 9
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs
  33. 12
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs
  34. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs
  35. 2
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs
  36. 5
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs
  37. 82
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs
  38. 9
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs
  39. 19
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs
  40. 2
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Group/IUserChatGroupRepository.cs
  41. 3
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Group/UserGroupStore.cs
  42. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/IUserNotificationRepository.cs
  43. 3
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs
  44. 29
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs
  45. 21
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs
  46. 17
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs
  47. 4
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Group/EfCoreUserChatGroupRepository.cs
  48. 6
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs
  49. 4
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj
  50. 4
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatModule.cs
  51. 15
      aspnet-core/services/account/AuthServer.Host/Startup.cs
  52. 18
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs
  53. 1
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Dockerfile
  54. 14
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj
  55. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Account.Application.Contracts.dll
  56. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Aliyun.SettingManagement.dll
  57. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Aliyun.dll
  58. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.IM.dll
  59. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Identity.Application.Contracts.dll
  60. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Identity.Domain.Shared.dll
  61. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.IdentityServer.Application.Contracts.dll
  62. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.LocalizationManagement.Application.Contracts.dll
  63. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.LocalizationManagement.Domain.Shared.dll
  64. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.MessageService.Application.Contracts.dll
  65. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.MessageService.Domain.Shared.dll
  66. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Notifications.dll
  67. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.OssManagement.Application.Contracts.dll
  68. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.OssManagement.Domain.Shared.dll
  69. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.RealTime.dll
  70. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Sms.Aliyun.dll
  71. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.WeChat.MiniProgram.dll
  72. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.WeChat.Official.dll
  73. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.WeChat.SettingManagement.dll
  74. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.WeChat.dll
  75. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.ApiGateway.Application.Contracts.dll
  76. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.ApiGateway.Domain.Shared.dll
  77. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Platform.Application.Contracts.dll
  78. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Platform.Domain.Shared.dll
  79. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Account.Application.Contracts.dll
  80. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Identity.Application.Contracts.dll
  81. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Identity.Domain.Shared.dll
  82. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.IdentityServer.Domain.Shared.dll
  83. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Users.Abstractions.dll
  84. BIN
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Users.Domain.Shared.dll
  85. 15
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Startup.cs
  86. 15
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Startup.cs
  87. 15
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Startup.cs
  88. 15
      aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/Startup.cs
  89. 15
      aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/Startup.cs
  90. 15
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Startup.cs
  91. 15
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Startup.cs
  92. 31
      build/build-aspnetcore-modules.ps1
  93. 51
      build/modules.dependencies.json
  94. 1
      docker-compose.override.yml

7
aspnet-core/LINGYUN.MicroService.All.sln

@ -327,8 +327,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Rules.RulesEngi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.HttpOverrides", "modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj", "{13219C1C-23E1-4EBA-93FB-86830C93A800}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.ApiGateway.Host", "services\apigateway\LINGYUN.Abp.ApiGateway.Host\LINGYUN.Abp.ApiGateway.Host.csproj", "{A320E23E-792D-4736-B963-381F9D7AF605}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundWorkers.Hangfire", "modules\common\LINGYUN.Abp.BackgroundWorkers.Hangfire\LINGYUN.Abp.BackgroundWorkers.Hangfire.csproj", "{60D0BEF2-FEAF-4066-8377-6C873CB24858}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Hangfire.Dashboard", "modules\common\LINGYUN.Abp.Hangfire.Dashboard\LINGYUN.Abp.Hangfire.Dashboard.csproj", "{340BE5AC-68EC-41A5-9D0D-266037C58F13}"
@ -859,10 +857,6 @@ Global
{13219C1C-23E1-4EBA-93FB-86830C93A800}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13219C1C-23E1-4EBA-93FB-86830C93A800}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13219C1C-23E1-4EBA-93FB-86830C93A800}.Release|Any CPU.Build.0 = Release|Any CPU
{A320E23E-792D-4736-B963-381F9D7AF605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A320E23E-792D-4736-B963-381F9D7AF605}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A320E23E-792D-4736-B963-381F9D7AF605}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A320E23E-792D-4736-B963-381F9D7AF605}.Release|Any CPU.Build.0 = Release|Any CPU
{60D0BEF2-FEAF-4066-8377-6C873CB24858}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60D0BEF2-FEAF-4066-8377-6C873CB24858}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60D0BEF2-FEAF-4066-8377-6C873CB24858}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -1032,7 +1026,6 @@ Global
{4D83BDA7-2059-41C7-85AE-FEFAD5CD9498} = {6084D52D-775B-4A39-8CD5-AA2F362B5A61}
{8EF31071-3521-409D-9740-BBFBFC04C50E} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{13219C1C-23E1-4EBA-93FB-86830C93A800} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{A320E23E-792D-4736-B963-381F9D7AF605} = {19E6BD61-062B-4FAD-A51A-B55F5CE88B7A}
{60D0BEF2-FEAF-4066-8377-6C873CB24858} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{340BE5AC-68EC-41A5-9D0D-266037C58F13} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
EndGlobalSection

4
aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalROptions.cs

@ -12,8 +12,8 @@
public string UserOnlineMethod { get; set; }
public AbpIMSignalROptions()
{
GetChatMessageMethod = "getChatMessage";
UserOnlineMethod = "onUserOnlined";
GetChatMessageMethod = "get-chat-message";
UserOnlineMethod = "on-user-onlined";
}
}
}

19
aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs

@ -17,6 +17,8 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
[Authorize]
public class MessagesHub : OnlineClientHubBase
{
protected IMessageProcessor Processor => LazyServiceProvider.LazyGetRequiredService<IMessageProcessor>();
protected AbpIMSignalROptions Options { get; }
protected IFriendStore FriendStore { get; }
protected IMessageStore MessageStore { get; }
@ -67,8 +69,9 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
/// </summary>
/// <param name="chatMessage"></param>
/// <returns></returns>
[HubMethodName("SendMessage")]
public virtual async Task SendMessageAsync(ChatMessage chatMessage)
// [HubMethodName("SendMessage")]
[HubMethodName("send")]
public virtual async Task SendAsync(ChatMessage chatMessage)
{
// 持久化
await MessageStore.StoreMessageAsync(chatMessage, cancellationToken: Context.ConnectionAborted);
@ -83,6 +86,18 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
}
}
[HubMethodName("recall")]
public virtual async Task ReCallAsync(ChatMessage chatMessage)
{
await Processor.ReCallAsync(chatMessage);
}
[HubMethodName("read")]
public virtual async Task ReadAsync(ChatMessage chatMessage)
{
await Processor.ReadAsync(chatMessage);
}
protected virtual async Task SendMessageToGroupAsync(ChatMessage chatMessage)
{
var signalRClient = Clients.Group(chatMessage.GroupId);

4
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs

@ -26,13 +26,11 @@ namespace LINGYUN.Abp.IM.Contract
/// <param name="tenantId"></param>
/// <param name="userId"></param>
/// <param name="sorting"></param>
/// <param name="reverse"></param>
/// <returns></returns>
Task<List<UserFriend>> GetListAsync(
Guid? tenantId,
Guid userId,
string sorting = nameof(UserFriend.UserId),
bool reverse = false,
CancellationToken cancellationToken = default
);
/// <summary>
@ -54,7 +52,6 @@ namespace LINGYUN.Abp.IM.Contract
/// <param name="userId"></param>
/// <param name="filter"></param>
/// <param name="sorting"></param>
/// <param name="reverse"></param>
/// <param name="skipCount"></param>
/// <param name="maxResultCount"></param>
/// <returns></returns>
@ -63,7 +60,6 @@ namespace LINGYUN.Abp.IM.Contract
Guid userId,
string filter = "",
string sorting = nameof(UserFriend.UserId),
bool reverse = false,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default);

2
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Group/IUserGroupStore.cs

@ -66,7 +66,6 @@ namespace LINGYUN.Abp.IM.Group
/// </summary>
/// <param name="tenantId"></param>
/// <param name="groupId"></param>
/// <param name="filter"></param>
/// <param name="sorting"></param>
/// <param name="skipCount"></param>
/// <param name="maxResultCount"></param>
@ -75,7 +74,6 @@ namespace LINGYUN.Abp.IM.Group
Guid? tenantId,
long groupId,
string sorting = nameof(GroupUserCard.UserId),
bool reverse = false,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default);

2
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs

@ -33,7 +33,6 @@ namespace LINGYUN.Abp.IM
/// <param name="endAge">起止年龄</param>
/// <param name="sex">性别</param>
/// <param name="sorting">排序字段</param>
/// <param name="reverse">是否倒序</param>
/// <param name="skipCount">起始记录位置</param>
/// <param name="maxResultCount">最大返回数量</param>
/// <returns></returns>
@ -44,7 +43,6 @@ namespace LINGYUN.Abp.IM
int? endAge = null,
Sex? sex = null,
string sorting = nameof(UserCard.UserId),
bool reverse = false,
int skipCount = 0,
int maxResultCount = 10);
/// <summary>

3
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageBlocker.cs

@ -2,6 +2,9 @@
namespace LINGYUN.Abp.IM.Messages
{
/// <summary>
/// 消息拦截器
/// </summary>
public interface IMessageBlocker
{
Task InterceptAsync(ChatMessage message);

23
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageProcessor.cs

@ -0,0 +1,23 @@
using System.Threading.Tasks;
namespace LINGYUN.Abp.IM.Messages
{
/// <summary>
/// 消息处理器
/// </summary>
public interface IMessageProcessor
{
/// <summary>
/// 撤回
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
Task ReCallAsync(ChatMessage message);
/// <summary>
/// 消息已读
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
Task ReadAsync(ChatMessage message);
}
}

5
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs

@ -38,7 +38,6 @@ namespace LINGYUN.Abp.IM.Messages
/// <param name="groupId"></param>
/// <param name="filter"></param>
/// <param name="sorting"></param>
/// <param name="reverse"></param>
/// <param name="type"></param>
/// <param name="skipCount"></param>
/// <param name="maxResultCount"></param>
@ -48,7 +47,6 @@ namespace LINGYUN.Abp.IM.Messages
long groupId,
string filter = "",
string sorting = nameof(ChatMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,
@ -59,14 +57,12 @@ namespace LINGYUN.Abp.IM.Messages
/// <param name="tenantId"></param>
/// <param name="userId"></param>
/// <param name="sorting"></param>
/// <param name="reverse"></param>
/// <param name="maxResultCount"></param>
/// <returns></returns>
Task<List<LastChatMessage>> GetLastChatMessagesAsync(
Guid? tenantId,
Guid userId,
string sorting = nameof(LastChatMessage.SendTime),
bool reverse = true,
int maxResultCount = 10,
CancellationToken cancellationToken = default
);
@ -99,7 +95,6 @@ namespace LINGYUN.Abp.IM.Messages
Guid receiveUserId,
string filter = "",
string sorting = nameof(ChatMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,

6
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendState.cs → aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageState.cs

@ -3,13 +3,17 @@
/// <summary>
/// 消息状态
/// </summary>
public enum MessageSendState : sbyte
public enum MessageState : sbyte
{
/// <summary>
/// 已发送
/// </summary>
Send = 0,
/// <summary>
/// 已读
/// </summary>
Read = 1,
/// <summary>
/// 撤回
/// </summary>
ReCall = 10,

19
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageProcessor.cs

@ -0,0 +1,19 @@
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.IM.Messages
{
[Dependency(TryRegister = true)]
public class NullMessageProcessor : IMessageProcessor, ISingletonDependency
{
public Task ReadAsync(ChatMessage message)
{
return Task.CompletedTask;
}
public Task ReCallAsync(ChatMessage message)
{
return Task.CompletedTask;
}
}
}

11
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Settings/AbpIMSettingNames.cs

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace LINGYUN.Abp.IM.Settings
{
public static class AbpIMSettingNames
{
}
}

2
aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalROptions.cs

@ -9,7 +9,7 @@
public AbpNotificationsSignalROptions()
{
MethodName = "getNotification";
MethodName = "get-notification";
}
}
}

9
aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs

@ -44,7 +44,8 @@ namespace LINGYUN.Abp.Notifications.SignalR.Hubs
}
}
[HubMethodName("MySubscriptions")]
// [HubMethodName("MySubscriptions")]
[HubMethodName("my-subscriptions")]
public virtual async Task<ListResultDto<NotificationSubscriptionInfo>> GetMySubscriptionsAsync()
{
var subscriptions = await NotificationStore
@ -54,7 +55,8 @@ namespace LINGYUN.Abp.Notifications.SignalR.Hubs
}
[UnitOfWork]
[HubMethodName("GetNotification")]
// [HubMethodName("GetNotification")]
[HubMethodName("get-notifications")]
public virtual async Task<ListResultDto<NotificationInfo>> GetNotificationAsync()
{
var userNotifications = await NotificationStore
@ -63,7 +65,8 @@ namespace LINGYUN.Abp.Notifications.SignalR.Hubs
return new ListResultDto<NotificationInfo>(userNotifications);
}
[HubMethodName("ChangeState")]
// [HubMethodName("ChangeState")]
[HubMethodName("change-state")]
public virtual async Task ChangeStateAsync(string id, NotificationReadState readState = NotificationReadState.Read)
{
await NotificationStore

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs

@ -110,7 +110,6 @@ namespace LINGYUN.Abp.Notifications
Guid userId,
string filter = "",
string sorting = nameof(NotificationInfo.CreationTime),
bool reverse = true,
NotificationReadState? readState = null,
int skipCount = 1,
int maxResultCount = 10,

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs

@ -110,7 +110,6 @@ namespace LINGYUN.Abp.Notifications
Guid userId,
string filter = "",
string sorting = nameof(NotificationInfo.CreationTime),
bool reverse = true,
NotificationReadState? readState = null,
int skipCount = 1,
int maxResultCount = 10,

1
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj

@ -9,6 +9,7 @@
<ItemGroup>
<PackageReference Include="Volo.Abp.Core" Version="4.4.0" />
<PackageReference Include="Volo.Abp.Settings" Version="4.4.0" />
<PackageReference Include="Volo.Abp.EventBus.Abstractions" Version="4.4.0" />
</ItemGroup>

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs

@ -5,6 +5,5 @@ namespace LINGYUN.Abp.MessageService.Chat
public class GetMyFriendsDto : ISortedResultRequest
{
public string Sorting { get; set; }
public bool Reverse { get; set; }
}
}

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs

@ -6,6 +6,5 @@ namespace LINGYUN.Abp.MessageService.Chat
{
public int MaxResultCount { get; set; }
public string Sorting { get; set; }
public bool Reverse { get; set; }
}
}

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs

@ -8,7 +8,6 @@ namespace LINGYUN.Abp.MessageService.Chat
{
[Required]
public long GroupId { get; set; }
public bool Reverse { get; set; }
public string Filter { get; set; }
public MessageType? MessageType { get; set; }
}

2
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupUserGetByPagedDto.cs

@ -8,8 +8,6 @@ namespace LINGYUN.Abp.MessageService.Chat
[Required]
public long GroupId { get; set; }
public bool Reverse { get; set; }
public string Filter { get; set; }
}
}

2
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs

@ -5,8 +5,6 @@ namespace LINGYUN.Abp.MessageService.Chat
public class MyFriendGetByPagedDto : PagedAndSortedResultRequestDto
{
public string Filter { get; set; }
public bool Reverse { get; set; }
}
public class MyLastContractFriendGetByPagedDto : PagedResultRequestDto

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs

@ -9,7 +9,6 @@ namespace LINGYUN.Abp.MessageService.Chat
{
[Required]
public Guid ReceiveUserId { get; set; }
public bool Reverse { get; set; }
public string Filter { get; set; }
public MessageType? MessageType { get; set; }
}

2
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/UserNotificationGetByPagedDto.cs

@ -7,8 +7,6 @@ namespace LINGYUN.Abp.MessageService.Notifications
{
public string Filter { get; set; }
public bool Reverse { get; set; }
public NotificationReadState? ReadState { get; set; }
}
}

6
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/ChatAppService.cs

@ -33,7 +33,7 @@ namespace LINGYUN.Abp.MessageService.Chat
var chatMessages = await _messageStore
.GetChatMessageAsync(CurrentTenant.Id, CurrentUser.GetId(), input.ReceiveUserId,
input.Filter, input.Sorting, input.Reverse,
input.Filter, input.Sorting,
input.MessageType, input.SkipCount, input.MaxResultCount);
return new PagedResultDto<ChatMessage>(chatMessageCount, chatMessages);
@ -43,7 +43,7 @@ namespace LINGYUN.Abp.MessageService.Chat
{
var chatMessages = await _messageStore
.GetLastChatMessagesAsync(CurrentTenant.Id, CurrentUser.GetId(),
input.Sorting, input.Reverse, input.MaxResultCount);
input.Sorting, input.MaxResultCount);
return new ListResultDto<LastChatMessage>(chatMessages);
}
@ -61,7 +61,7 @@ namespace LINGYUN.Abp.MessageService.Chat
var groupMessages = await _messageStore
.GetGroupMessageAsync(CurrentTenant.Id, input.GroupId,
input.Filter, input.Sorting, input.Reverse,
input.Filter, input.Sorting,
input.MessageType, input.SkipCount, input.MaxResultCount);
return new PagedResultDto<ChatMessage>(groupMessageCount, groupMessages);

8
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs

@ -45,8 +45,10 @@ namespace LINGYUN.Abp.MessageService.Chat
public virtual async Task<ListResultDto<UserFriend>> GetAllListAsync(GetMyFriendsDto input)
{
var myFriends = await FriendStore
.GetListAsync(CurrentTenant.Id, CurrentUser.GetId(),
input.Sorting, input.Reverse);
.GetListAsync(
CurrentTenant.Id,
CurrentUser.GetId(),
input.Sorting);
return new ListResultDto<UserFriend>(myFriends);
}
@ -57,7 +59,7 @@ namespace LINGYUN.Abp.MessageService.Chat
var myFriends = await FriendStore
.GetPagedListAsync(CurrentTenant.Id, CurrentUser.GetId(),
input.Filter, input.Sorting, input.Reverse,
input.Filter, input.Sorting,
input.SkipCount, input.MaxResultCount);
return new PagedResultDto<UserFriend>(myFrientCount, myFriends);

2
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/MyNotificationAppService.cs

@ -112,7 +112,7 @@ namespace LINGYUN.Abp.MessageService.Notifications
var notifications = await NotificationStore
.GetUserNotificationsAsync(
CurrentTenant.Id, CurrentUser.GetId(),
input.Filter, input.Sorting, input.Reverse,
input.Filter, input.Sorting,
input.ReadState, input.SkipCount, input.MaxResultCount);
return new PagedResultDto<NotificationInfo>(notificationCount, notifications);

2
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/MessageServiceResource.cs

@ -2,7 +2,7 @@
namespace LINGYUN.Abp.MessageService.Localization
{
[LocalizationResourceName("MessageService")]
[LocalizationResourceName("AbpMessageService")]
public class MessageServiceResource
{
}

4
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs

@ -28,6 +28,10 @@
{
public const string Namespace = "LINGYUN.Abp.Message";
/// <summary>
/// 试图撤回过期消息
/// </summary>
public const string ExpiredMessageCannotBeReCall = Namespace + ":01303";
/// <summary>
/// 消息不完整
/// </summary>
public const string MessageIncomplete = Namespace + ":01400";

30
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingDefinitionProvider.cs

@ -0,0 +1,30 @@
using LINGYUN.Abp.MessageService.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
namespace LINGYUN.Abp.MessageService.Settings
{
public class MessageServiceSettingDefinitionProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
context.Add(
new SettingDefinition(
MessageServiceSettingNames.Messages.RecallExpirationTime,
"2",
L("DisplayName:RecallExpirationTime"),
L("Description:RecallExpirationTime"),
isVisibleToClients: false,
isEncrypted: false)
.WithProviders(
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName)
);
}
protected ILocalizableString L(string name)
{
return LocalizableString.Create<MessageServiceResource>(name);
}
}
}

11
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceSettingNames.cs → aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingNames.cs

@ -1,4 +1,4 @@
namespace LINGYUN.Abp.MessageService
namespace LINGYUN.Abp.MessageService.Settings
{
public class MessageServiceSettingNames
{
@ -12,5 +12,14 @@
/// </summary>
public const string CleanupExpirationBatchCount = Default + ".CleanupExpirationBatchCount";
}
public class Messages
{
public const string Default = GroupName + ".Messages";
/// <summary>
/// 撤回消息过期时间(分)
/// </summary>
public const string RecallExpirationTime = Default + ".RecallExpirationTime";
}
}
}

9
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs

@ -136,13 +136,12 @@ namespace LINGYUN.Abp.MessageService.Chat
Guid? tenantId,
Guid userId,
string sorting = nameof(UserFriend.UserId),
bool reverse = false,
CancellationToken cancellationToken = default
)
{
using (_currentTenant.Change(tenantId))
{
return await GetAllFriendByCacheItemAsync(userId, sorting, reverse, cancellationToken);
return await GetAllFriendByCacheItemAsync(userId, sorting, cancellationToken);
}
}
@ -164,7 +163,6 @@ namespace LINGYUN.Abp.MessageService.Chat
Guid userId,
string filter = "",
string sorting = nameof(UserFriend.UserId),
bool reverse = false,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
@ -172,7 +170,7 @@ namespace LINGYUN.Abp.MessageService.Chat
using (_currentTenant.Change(tenantId))
{
return await _userChatFriendRepository
.GetMembersAsync(userId, filter, sorting, reverse,
.GetMembersAsync(userId, filter, sorting,
skipCount, maxResultCount, cancellationToken);
}
}
@ -254,7 +252,6 @@ namespace LINGYUN.Abp.MessageService.Chat
protected virtual async Task<List<UserFriend>> GetAllFriendByCacheItemAsync(
Guid userId,
string sorting = nameof(UserFriend.UserId),
bool reverse = false,
CancellationToken cancellationToken = default
)
{
@ -270,7 +267,7 @@ namespace LINGYUN.Abp.MessageService.Chat
_logger.LogDebug($"Not found in the cache: {cacheKey}");
var friends = await _userChatFriendRepository
.GetAllMembersAsync(userId, sorting, reverse, cancellationToken);
.GetAllMembersAsync(userId, sorting, cancellationToken);
cacheItem = new UserFriendCacheItem(friends);
_logger.LogDebug($"Set item in the cache: {cacheKey}");
await _cache.SetAsync(cacheKey, cacheItem, token: cancellationToken);

12
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs

@ -13,10 +13,18 @@ namespace LINGYUN.Abp.MessageService.Chat
UserMessage userMessage,
CancellationToken cancellationToken = default);
Task UpdateUserMessageAsync(
UserMessage userMessage,
CancellationToken cancellationToken = default);
Task InsertGroupMessageAsync(
GroupMessage groupMessage,
CancellationToken cancellationToken = default);
Task UpdateGroupMessageAsync(
GroupMessage groupMessage,
CancellationToken cancellationToken = default);
Task<UserMessage> GetUserMessageAsync(
long id,
CancellationToken cancellationToken = default);
@ -48,7 +56,6 @@ namespace LINGYUN.Abp.MessageService.Chat
Task<List<LastChatMessage>> GetLastMessagesByOneFriendAsync(
Guid userId,
string sorting = nameof(LastChatMessage.SendTime),
bool reverse = true,
int maxResultCount = 10,
CancellationToken cancellationToken = default);
@ -57,7 +64,6 @@ namespace LINGYUN.Abp.MessageService.Chat
Guid receiveUserId,
string filter = "",
string sorting = nameof(UserMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,
@ -73,7 +79,6 @@ namespace LINGYUN.Abp.MessageService.Chat
long groupId,
string filter = "",
string sorting = nameof(UserMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,
@ -91,7 +96,6 @@ namespace LINGYUN.Abp.MessageService.Chat
long groupId,
string filter = "",
string sorting = nameof(UserMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs

@ -26,7 +26,6 @@ namespace LINGYUN.Abp.MessageService.Chat
int? endAge = null,
Sex? sex = null,
string sorting = nameof(UserChatCard.UserId),
bool reverse = false,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default);

2
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs

@ -27,7 +27,6 @@ namespace LINGYUN.Abp.MessageService.Chat
Task<List<UserFriend>> GetAllMembersAsync(
Guid userId,
string sorting = nameof(UserChatFriend.RemarkName),
bool reverse = false,
CancellationToken cancellationToken = default);
Task<int> GetMembersCountAsync(
@ -39,7 +38,6 @@ namespace LINGYUN.Abp.MessageService.Chat
Guid userId,
string filter = "",
string sorting = nameof(UserChatFriend.UserId),
bool reverse = false,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default);

5
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs

@ -31,7 +31,7 @@ namespace LINGYUN.Abp.MessageService.Chat
/// <summary>
/// 发送状态
/// </summary>
public virtual MessageSendState SendState { get; protected set; }
public virtual MessageState SendState { get; protected set; }
protected Message() { }
public Message(long id, Guid sendUserId, string sendUserName, string content, MessageType type = MessageType.Text)
{
@ -41,9 +41,10 @@ namespace LINGYUN.Abp.MessageService.Chat
Content = content;
Type = type;
CreationTime = DateTime.Now;
ChangeSendState();
}
public void ChangeSendState(MessageSendState state = MessageSendState.Send)
public void ChangeSendState(MessageState state = MessageState.Send)
{
SendState = state;
}

82
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs

@ -0,0 +1,82 @@
using LINGYUN.Abp.IM.Messages;
using LINGYUN.Abp.MessageService.Settings;
using System;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Settings;
using Volo.Abp.Timing;
namespace LINGYUN.Abp.MessageService.Chat
{
[Dependency(ReplaceServices = true)]
public class MessageProcessor : IMessageProcessor, ITransientDependency
{
private readonly IClock _clock;
private readonly IMessageRepository _repository;
private readonly ISettingProvider _settingProvider;
public MessageProcessor(IMessageRepository repository)
{
_repository = repository;
}
public virtual async Task ReadAsync(ChatMessage message)
{
if (!message.GroupId.IsNullOrWhiteSpace())
{
long groupId = long.Parse(message.GroupId);
var groupMessage = await _repository.GetGroupMessageAsync(groupId);
groupMessage.ChangeSendState(MessageState.Read);
await _repository.UpdateGroupMessageAsync(groupMessage);
}
else
{
long messageId = long.Parse(message.MessageId);
var userMessage = await _repository.GetUserMessageAsync(messageId);
userMessage.ChangeSendState(MessageState.Read);
await _repository.UpdateUserMessageAsync(userMessage);
}
}
public virtual async Task ReCallAsync(ChatMessage message)
{
var expiration = await _settingProvider.GetAsync(
MessageServiceSettingNames.Messages.RecallExpirationTime, 2d);
Func<Message, bool> hasExpiredMessage = (Message msg) =>
msg.CreationTime.AddMinutes(expiration) < _clock.Now;
if (!message.GroupId.IsNullOrWhiteSpace())
{
long groupId = long.Parse(message.GroupId);
var groupMessage = await _repository.GetGroupMessageAsync(groupId);
if (hasExpiredMessage(groupMessage))
{
throw new BusinessException(MessageServiceErrorCodes.ExpiredMessageCannotBeReCall)
.WithData("Time", expiration);
}
groupMessage.ChangeSendState(MessageState.ReCall);
await _repository.UpdateGroupMessageAsync(groupMessage);
}
else
{
long messageId = long.Parse(message.MessageId);
var userMessage = await _repository.GetUserMessageAsync(messageId);
if (hasExpiredMessage(userMessage))
{
throw new BusinessException(MessageServiceErrorCodes.ExpiredMessageCannotBeReCall)
.WithData("Time", expiration);
}
userMessage.ChangeSendState(MessageState.ReCall);
await _repository.UpdateUserMessageAsync(userMessage);
}
}
}
}

9
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs

@ -74,7 +74,6 @@ namespace LINGYUN.Abp.MessageService.Chat
long groupId,
string filter = "",
string sorting = nameof(ChatMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,
@ -83,7 +82,7 @@ namespace LINGYUN.Abp.MessageService.Chat
using (_currentTenant.Change(tenantId))
{
var groupMessages = await _messageRepository
.GetGroupMessagesAsync(groupId, filter, sorting, reverse, type, skipCount, maxResultCount, cancellationToken);
.GetGroupMessagesAsync(groupId, filter, sorting, type, skipCount, maxResultCount, cancellationToken);
var chatMessages = _objectMapper.Map<List<GroupMessage>, List<ChatMessage>>(groupMessages);
@ -97,7 +96,6 @@ namespace LINGYUN.Abp.MessageService.Chat
Guid receiveUserId,
string filter = "",
string sorting = nameof(ChatMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,
@ -106,7 +104,7 @@ namespace LINGYUN.Abp.MessageService.Chat
using (_currentTenant.Change(tenantId))
{
var userMessages = await _messageRepository
.GetUserMessagesAsync(sendUserId, receiveUserId, filter, sorting, reverse, type, skipCount, maxResultCount, cancellationToken);
.GetUserMessagesAsync(sendUserId, receiveUserId, filter, sorting, type, skipCount, maxResultCount, cancellationToken);
var chatMessages = _objectMapper.Map<List<UserMessage>, List<ChatMessage>>(userMessages);
@ -118,7 +116,6 @@ namespace LINGYUN.Abp.MessageService.Chat
Guid? tenantId,
Guid userId,
string sorting = nameof(LastChatMessage.SendTime),
bool reverse = true,
int maxResultCount = 10,
CancellationToken cancellationToken = default
)
@ -126,7 +123,7 @@ namespace LINGYUN.Abp.MessageService.Chat
using (_currentTenant.Change(tenantId))
{
return await _messageRepository
.GetLastMessagesByOneFriendAsync(userId, sorting, reverse, maxResultCount, cancellationToken);
.GetLastMessagesByOneFriendAsync(userId, sorting, maxResultCount, cancellationToken);
}
}

19
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs

@ -20,7 +20,12 @@ namespace LINGYUN.Abp.MessageService.Chat
_userChatCardRepository = userChatCardRepository;
}
public virtual async Task<int> GetCountAsync(Guid? tenantId, string findUserName = "", int? startAge = null, int? endAge = null, Sex? sex = null)
public virtual async Task<int> GetCountAsync(
Guid? tenantId,
string findUserName = "",
int? startAge = null,
int? endAge = null,
Sex? sex = null)
{
using (_currentTenant.Change(tenantId))
{
@ -29,13 +34,21 @@ namespace LINGYUN.Abp.MessageService.Chat
}
}
public virtual async Task<List<UserCard>> GetListAsync(Guid? tenantId, string findUserName = "", int? startAge = null, int? endAge = null, Sex? sex = null, string sorting = nameof(UserCard.UserId), bool reverse = false, int skipCount = 0, int maxResultCount = 10)
public virtual async Task<List<UserCard>> GetListAsync(
Guid? tenantId,
string findUserName = "",
int? startAge = null,
int? endAge = null,
Sex? sex = null,
string sorting = nameof(UserCard.UserId),
int skipCount = 0,
int maxResultCount = 10)
{
using (_currentTenant.Change(tenantId))
{
return await _userChatCardRepository
.GetMembersAsync(findUserName, startAge, endAge, sex,
sorting, reverse, skipCount, maxResultCount);
sorting, skipCount, maxResultCount);
}
}

2
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Group/IUserChatGroupRepository.cs

@ -44,7 +44,6 @@ namespace LINGYUN.Abp.MessageService.Group
/// </summary>
/// <param name="groupId"></param>
/// <param name="sorting"></param>
/// <param name="reverse"></param>
/// <param name="skipCount"></param>
/// <param name="maxResultCount"></param>
/// <param name="cancellationToken"></param>
@ -52,7 +51,6 @@ namespace LINGYUN.Abp.MessageService.Group
Task<List<GroupUserCard>> GetMembersAsync(
long groupId,
string sorting = nameof(GroupUserCard.UserId),
bool reverse = false,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default);

3
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Group/UserGroupStore.cs

@ -133,14 +133,13 @@ namespace LINGYUN.Abp.MessageService.Group
Guid? tenantId,
long groupId,
string sorting = nameof(GroupUserCard.UserId),
bool reverse = false,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
using (_currentTenant.Change(tenantId))
{
return await _userChatGroupRepository.GetMembersAsync(groupId, sorting, reverse, skipCount, maxResultCount, cancellationToken);
return await _userChatGroupRepository.GetMembersAsync(groupId, sorting, skipCount, maxResultCount, cancellationToken);
}
}
}

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/IUserNotificationRepository.cs

@ -39,7 +39,6 @@ namespace LINGYUN.Abp.MessageService.Notifications
Guid userId,
string filter = "",
string sorting = nameof(Notification.CreationTime),
bool reverse = true,
NotificationReadState? readState = null,
int skipCount = 0,
int maxResultCount = 10,

3
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs

@ -247,7 +247,6 @@ namespace LINGYUN.Abp.MessageService.Notifications
Guid userId,
string filter = "",
string sorting = nameof(NotificationInfo.CreationTime),
bool reverse = true,
NotificationReadState? readState = null,
int skipCount = 1,
int maxResultCount = 10,
@ -256,7 +255,7 @@ namespace LINGYUN.Abp.MessageService.Notifications
using (_currentTenant.Change(tenantId))
{
var notifications = await _userNotificationRepository
.GetListAsync(userId, filter, sorting, reverse, readState, skipCount, maxResultCount, cancellationToken);
.GetListAsync(userId, filter, sorting, readState, skipCount, maxResultCount, cancellationToken);
return _objectMapper.Map<List<Notification>, List<NotificationInfo>>(notifications);
}

29
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs

@ -37,13 +37,11 @@ namespace LINGYUN.Abp.MessageService.Chat
long groupId,
string filter = "",
string sorting = nameof(UserMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
sorting = reverse ? sorting + " desc" : sorting;
var groupMessages = await (await GetDbContextAsync()).Set<GroupMessage>()
.Distinct()
.Where(x => x.GroupId.Equals(groupId))
@ -77,13 +75,11 @@ namespace LINGYUN.Abp.MessageService.Chat
long groupId,
string filter = "",
string sorting = nameof(UserMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
sorting = reverse ? sorting + " desc" : sorting;
var groupMessages = await (await GetDbContextAsync()).Set<GroupMessage>()
.Distinct()
.Where(x => x.GroupId.Equals(groupId) && x.CreatorId.Equals(sendUserId))
@ -153,13 +149,9 @@ namespace LINGYUN.Abp.MessageService.Chat
public virtual async Task<List<LastChatMessage>> GetLastMessagesByOneFriendAsync(
Guid userId,
string sorting = nameof(LastChatMessage.SendTime),
bool reverse = true,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
sorting ??= nameof(LastChatMessage.SendTime);
sorting = reverse ? sorting + " DESC" : sorting;
var dbContext = await GetDbContextAsync();
var groupMsgQuery = dbContext.Set<UserMessage>()
.Where(msg => msg.ReceiveUserId == userId || msg.CreatorId == userId)
@ -187,7 +179,7 @@ namespace LINGYUN.Abp.MessageService.Chat
};
return await userMessageQuery
.OrderBy(sorting)
.OrderBy(sorting ?? nameof(LastChatMessage.SendTime))
.Take(maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}
@ -197,20 +189,17 @@ namespace LINGYUN.Abp.MessageService.Chat
Guid receiveUserId,
string filter = "",
string sorting = nameof(UserMessage.MessageId),
bool reverse = true,
MessageType? type = null,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
sorting ??= nameof(UserMessage.MessageId);
sorting = reverse ? sorting + " desc" : sorting;
var userMessages = await (await GetDbContextAsync()).Set<UserMessage>()
.Where(x => (x.CreatorId.Equals(sendUserId) && x.ReceiveUserId.Equals(receiveUserId)) ||
x.CreatorId.Equals(receiveUserId) && x.ReceiveUserId.Equals(sendUserId))
.WhereIf(type != null, x => x.Type.Equals(type))
.WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter))
.OrderBy(sorting)
.OrderBy(sorting ?? nameof(UserMessage.MessageId))
.PageBy(skipCount, maxResultCount)
.AsNoTracking()
.ToListAsync(GetCancellationToken(cancellationToken));
@ -243,6 +232,13 @@ namespace LINGYUN.Abp.MessageService.Chat
.AddAsync(groupMessage, GetCancellationToken(cancellationToken));
}
public virtual async Task UpdateGroupMessageAsync(
GroupMessage groupMessage,
CancellationToken cancellationToken = default)
{
(await GetDbContextAsync()).Set<GroupMessage>().Update(groupMessage);
}
public virtual async Task InsertUserMessageAsync(
UserMessage userMessage,
CancellationToken cancellationToken = default)
@ -250,5 +246,12 @@ namespace LINGYUN.Abp.MessageService.Chat
await (await GetDbContextAsync()).Set<UserMessage>()
.AddAsync(userMessage, GetCancellationToken(cancellationToken));
}
public virtual async Task UpdateUserMessageAsync(
UserMessage userMessage,
CancellationToken cancellationToken = default)
{
(await GetDbContextAsync()).Set<UserMessage>().Update(userMessage);
}
}
}

21
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs

@ -35,7 +35,12 @@ namespace LINGYUN.Abp.MessageService.Chat
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<int> GetMemberCountAsync(string findUserName = "", int? startAge = null, int? endAge = null, Sex? sex = null, CancellationToken cancellationToken = default)
public virtual async Task<int> GetMemberCountAsync(
string findUserName = "",
int? startAge = null,
int? endAge = null,
Sex? sex = null,
CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.WhereIf(!findUserName.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(findUserName))
@ -45,16 +50,22 @@ namespace LINGYUN.Abp.MessageService.Chat
.CountAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<UserCard>> GetMembersAsync(string findUserName = "", int? startAge = null, int? endAge = null, Sex? sex = null, string sorting = nameof(UserChatCard.UserId), bool reverse = false, int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default)
public virtual async Task<List<UserCard>> GetMembersAsync(
string findUserName = "",
int? startAge = null,
int? endAge = null,
Sex? sex = null,
string sorting = nameof(UserChatCard.UserId),
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
sorting ??= nameof(UserChatCard.UserId);
sorting = reverse ? sorting + " desc" : sorting;
return await (await GetDbSetAsync())
.WhereIf(!findUserName.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(findUserName))
.WhereIf(startAge.HasValue, ucc => ucc.Age >= startAge.Value)
.WhereIf(endAge.HasValue, ucc => ucc.Age <= endAge.Value)
.WhereIf(sex.HasValue, ucc => ucc.Sex == sex)
.OrderBy(sorting)
.OrderBy(sorting ?? nameof(UserChatCard.UserId))
.PageBy(skipCount, maxResultCount)
.Select(ucc => ucc.ToUserCard())
.ToListAsync(GetCancellationToken(cancellationToken));

17
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs

@ -30,11 +30,8 @@ namespace LINGYUN.Abp.MessageService.Chat
public virtual async Task<List<UserFriend>> GetAllMembersAsync(
Guid userId,
string sorting = nameof(UserChatFriend.RemarkName),
bool reverse = false,
CancellationToken cancellationToken = default)
{
sorting = reverse ? sorting + " DESC" : sorting;
var dbContext = await GetDbContextAsync();
var userFriendQuery = from ucf in dbContext.Set<UserChatFriend>()
join ucc in dbContext.Set<UserChatCard>()
@ -61,7 +58,7 @@ namespace LINGYUN.Abp.MessageService.Chat
};
return await userFriendQuery
.OrderBy(sorting ?? $"{nameof(UserChatFriend.RemarkName)} DESC")
.OrderBy(sorting ?? nameof(UserChatFriend.RemarkName))
.ToListAsync(GetCancellationToken(cancellationToken));
}
@ -95,10 +92,14 @@ namespace LINGYUN.Abp.MessageService.Chat
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
}
public virtual async Task<List<UserFriend>> GetMembersAsync(Guid userId, string filter = "", string sorting = nameof(UserChatFriend.UserId), bool reverse = false, int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default)
public virtual async Task<List<UserFriend>> GetMembersAsync(
Guid userId,
string filter = "",
string sorting = nameof(UserChatFriend.UserId),
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
sorting = reverse ? sorting + " desc" : sorting;
var dbContext = await GetDbContextAsync();
// 过滤用户资料
var userChatCardQuery = dbContext.Set<UserChatCard>()
@ -134,7 +135,7 @@ namespace LINGYUN.Abp.MessageService.Chat
};
return await userFriendQuery
.OrderBy(sorting)
.OrderBy(sorting ?? nameof(UserChatFriend.UserId))
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}

4
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Group/EfCoreUserChatGroupRepository.cs

@ -61,14 +61,10 @@ namespace LINGYUN.Abp.MessageService.Group
public virtual async Task<List<GroupUserCard>> GetMembersAsync(
long groupId,
string sorting = nameof(UserChatCard.UserId),
bool reverse = false,
int skipCount = 0,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
sorting ??= nameof(UserChatCard.UserId);
sorting = reverse ? sorting + " desc" : sorting;
var dbContext = await GetDbContextAsync();
var cardQuery = from gp in dbContext.Set<ChatGroup>()
join ucg in dbContext.Set<UserChatGroup>()

6
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs

@ -101,15 +101,11 @@ namespace LINGYUN.Abp.MessageService.Notifications
Guid userId,
string filter = "",
string sorting = nameof(Notification.CreationTime),
bool reverse = true,
NotificationReadState? readState = null,
int skipCount = 1,
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
sorting ??= nameof(Notification.CreationTime);
sorting = reverse ? sorting + " DESC" : sorting;
var dbContext = await GetDbContextAsync();
var userNotifilerQuery = dbContext.Set<UserNotification>()
.Where(x => x.UserId == userId)
@ -124,7 +120,7 @@ namespace LINGYUN.Abp.MessageService.Notifications
.WhereIf(!filter.IsNullOrWhiteSpace(), nf =>
nf.NotificationName.Contains(filter) ||
nf.NotificationTypeName.Contains(filter))
.OrderBy(sorting)
.OrderBy(sorting ??= nameof(Notification.CreationTime))
.PageBy(skipCount, maxResultCount)
.AsNoTracking()
.ToListAsync(GetCancellationToken(cancellationToken));

4
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
@ -21,7 +21,7 @@
<PackageReference Include="Volo.Abp.Features" Version="4.4.0" />
<PackageReference Include="Volo.Abp.Caching" Version="4.4.0" />
<PackageReference Include="Volo.Abp.Json" Version="4.4.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.*" />
</ItemGroup>
</Project>

4
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatModule.cs

@ -1,6 +1,5 @@
using LINGYUN.Abp.WeChat.Localization;
using Microsoft.Extensions.DependencyInjection;
using Polly;
using System;
using Volo.Abp.Caching;
using Volo.Abp.Features;
@ -37,8 +36,7 @@ namespace LINGYUN.Abp.WeChat
options =>
{
options.BaseAddress = new Uri("https://api.weixin.qq.com");
}).AddTransientHttpErrorPolicy(builder =>
builder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))));
});
}
}
}

15
aspnet-core/services/account/AuthServer.Host/Startup.cs

@ -2,6 +2,9 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System.IO;
using Volo.Abp.IO;
using Volo.Abp.Modularity.PlugIns;
namespace AuthServer.Host
{
@ -9,7 +12,17 @@ namespace AuthServer.Host
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AuthIdentityServerModule>();
services.AddApplication<AuthIdentityServerModule>(options =>
{
// 搜索 Modules 目录下所有文件作为插件
// 取消显示引用所有其他项目的模块,改为通过插件的形式引用
var pluginFolder = Path.Combine(
Directory.GetCurrentDirectory(), "Modules");
DirectoryHelper.CreateIfNotExists(pluginFolder);
options.PlugInSources.AddFolder(
pluginFolder,
SearchOption.AllDirectories);
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)

18
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs

@ -1,23 +1,16 @@
using DotNetCore.CAP;
using LINGYUN.Abp.Aliyun.SettingManagement;
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.Auditing;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.ExceptionHandling;
using LINGYUN.Abp.ExceptionHandling.Emailing;
using LINGYUN.Abp.FeatureManagement;
using LINGYUN.Abp.LocalizationManagement;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.MessageService;
using LINGYUN.Abp.MultiTenancy.DbFinder;
using LINGYUN.Abp.OssManagement;
using LINGYUN.Abp.PermissionManagement.Identity;
using LINGYUN.Abp.SettingManagement;
using LINGYUN.Abp.Sms.Aliyun;
using LINGYUN.Abp.TenantManagement;
using LINGYUN.Abp.WeChat.SettingManagement;
using LINGYUN.ApiGateway;
using LINGYUN.Platform;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
@ -51,7 +44,6 @@ using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.Identity.Localization;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
@ -71,14 +63,6 @@ namespace LINGYUN.Abp.BackendAdmin
{
[DependsOn(
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(PlatformApplicationContractModule),
typeof(ApiGatewayApplicationContractsModule),
typeof(AbpOssManagementApplicationContractsModule),
typeof(AbpMessageServiceApplicationContractsModule),
typeof(AbpLocalizationManagementApplicationContractsModule),
typeof(LINGYUN.Abp.Account.AbpAccountApplicationContractsModule),// 引用类似的包主要用于聚合权限管理和设置
typeof(LINGYUN.Abp.Identity.AbpIdentityApplicationContractsModule),
typeof(LINGYUN.Abp.IdentityServer.AbpIdentityServerApplicationContractsModule),
typeof(AbpSettingManagementApplicationModule),
typeof(AbpSettingManagementHttpApiModule),
typeof(AbpPermissionManagementApplicationModule),
@ -90,8 +74,6 @@ namespace LINGYUN.Abp.BackendAdmin
typeof(AbpAuditingHttpApiModule),
typeof(AbpTenantManagementApplicationModule),
typeof(AbpTenantManagementHttpApiModule),
typeof(AbpWeChatSettingManagementModule),// 微信配置管理模块
typeof(AbpAliyunSettingManagementModule),// 阿里云配置管理模块
typeof(AbpEntityFrameworkCoreMySQLModule),
typeof(AbpIdentityEntityFrameworkCoreModule),// 用户角色权限需要引用包
typeof(AbpIdentityServerEntityFrameworkCoreModule), // 客户端权限需要引用包

1
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Dockerfile

@ -9,5 +9,6 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
EXPOSE 80/tcp
VOLUME [ "./app/Logs" ]
VOLUME [ "./app/Modules" ]
ENTRYPOINT ["dotnet", "LINGYUN.Abp.BackendAdmin.HttpApi.Host.dll"]

14
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj

@ -59,37 +59,25 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\modules\account\LINGYUN.Abp.Account.Application.Contracts\LINGYUN.Abp.Account.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\apigateway\LINGYUN.ApiGateway.Application.Contracts\LINGYUN.ApiGateway.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\auditing\LINGYUN.Abp.Auditing.Application\LINGYUN.Abp.Auditing.Application.csproj" />
<ProjectReference Include="..\..\..\modules\auditing\LINGYUN.Abp.Auditing.HttpApi\LINGYUN.Abp.Auditing.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\cloud-aliyun\LINGYUN.Abp.Aliyun.SettingManagement\LINGYUN.Abp.Aliyun.SettingManagement.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.ExceptionHandling.Emailing\LINGYUN.Abp.ExceptionHandling.Emailing.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Localization.Dynamic\LINGYUN.Abp.Localization.Dynamic.csproj" />
<ProjectReference Include="..\..\..\modules\features\LINGYUN.Abp.FeatureManagement.Client\LINGYUN.Abp.FeatureManagement.Client.csproj" />
<ProjectReference Include="..\..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.Application.Contracts\LINGYUN.Abp.LocalizationManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\oss-management\LINGYUN.Abp.OssManagement.Application.Contracts\LINGYUN.Abp.OssManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.Application.Contracts\LINGYUN.Abp.IdentityServer.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\identity\LINGYUN.Abp.Identity.Application.Contracts\LINGYUN.Abp.Identity.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\..\modules\message\LINGYUN.Abp.MessageService.Application.Contracts\LINGYUN.Abp.MessageService.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Sms.Aliyun\LINGYUN.Abp.Sms.Aliyun.csproj" />
<ProjectReference Include="..\..\..\modules\platform\LINGYUN.Platform.Application.Contracts\LINGYUN.Platform.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\settings\LINGYUN.Abp.SettingManagement.Application\LINGYUN.Abp.SettingManagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\settings\LINGYUN.Abp.SettingManagement.HttpApi\LINGYUN.Abp.SettingManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\tenants\LINGYUN.Abp.MultiTenancy.DbFinder\LINGYUN.Abp.MultiTenancy.DbFinder.csproj" />
<ProjectReference Include="..\..\..\modules\tenants\LINGYUN.Abp.TenantManagement.Application\LINGYUN.Abp.TenantManagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\tenants\LINGYUN.Abp.TenantManagement.HttpApi\LINGYUN.Abp.TenantManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\wechat\LINGYUN.Abp.WeChat.SettingManagement\LINGYUN.Abp.WeChat.SettingManagement.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
</Project>

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Account.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Aliyun.SettingManagement.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Aliyun.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.IM.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Identity.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Identity.Domain.Shared.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.IdentityServer.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.LocalizationManagement.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.LocalizationManagement.Domain.Shared.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.MessageService.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.MessageService.Domain.Shared.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Notifications.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.OssManagement.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.OssManagement.Domain.Shared.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.RealTime.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.Sms.Aliyun.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.WeChat.MiniProgram.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.WeChat.Official.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.WeChat.SettingManagement.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Abp.WeChat.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.ApiGateway.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.ApiGateway.Domain.Shared.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Platform.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/LINGYUN.Platform.Domain.Shared.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Account.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Identity.Application.Contracts.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Identity.Domain.Shared.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.IdentityServer.Domain.Shared.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Users.Abstractions.dll

Binary file not shown.

BIN
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/Volo.Abp.Users.Domain.Shared.dll

Binary file not shown.

15
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Startup.cs

@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System.IO;
using Volo.Abp.IO;
using Volo.Abp.Modularity.PlugIns;
namespace LINGYUN.Abp.BackendAdmin
{
@ -7,7 +10,17 @@ namespace LINGYUN.Abp.BackendAdmin
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<BackendAdminHostModule>();
services.AddApplication<BackendAdminHostModule>(options =>
{
// 搜索 Modules 目录下所有文件作为插件
// 取消显示引用所有其他项目的模块,改为通过插件的形式引用
var pluginFolder = Path.Combine(
Directory.GetCurrentDirectory(), "Modules");
DirectoryHelper.CreateIfNotExists(pluginFolder);
options.PlugInSources.AddFolder(
pluginFolder,
SearchOption.AllDirectories);
});
}
public void Configure(IApplicationBuilder app)

15
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Startup.cs

@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System.IO;
using Volo.Abp.IO;
using Volo.Abp.Modularity.PlugIns;
namespace LINGYUN.ApiGateway
{
@ -7,7 +10,17 @@ namespace LINGYUN.ApiGateway
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<ApiGatewayHostModule>();
services.AddApplication<ApiGatewayHostModule>(options =>
{
// 搜索 Modules 目录下所有文件作为插件
// 取消显示引用所有其他项目的模块,改为通过插件的形式引用
var pluginFolder = Path.Combine(
Directory.GetCurrentDirectory(), "Modules");
DirectoryHelper.CreateIfNotExists(pluginFolder);
options.PlugInSources.AddFolder(
pluginFolder,
SearchOption.AllDirectories);
});
}
public void Configure(IApplicationBuilder app)

15
aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Startup.cs

@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System.IO;
using Volo.Abp.IO;
using Volo.Abp.Modularity.PlugIns;
namespace LINGYUN.ApiGateway
{
@ -7,7 +10,17 @@ namespace LINGYUN.ApiGateway
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<ApiGatewayHttpApiHostModule>();
services.AddApplication<ApiGatewayHttpApiHostModule>(options =>
{
// 搜索 Modules 目录下所有文件作为插件
// 取消显示引用所有其他项目的模块,改为通过插件的形式引用
var pluginFolder = Path.Combine(
Directory.GetCurrentDirectory(), "Modules");
DirectoryHelper.CreateIfNotExists(pluginFolder);
options.PlugInSources.AddFolder(
pluginFolder,
SearchOption.AllDirectories);
});
}
public void Configure(IApplicationBuilder app)

15
aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/Startup.cs

@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System.IO;
using Volo.Abp.IO;
using Volo.Abp.Modularity.PlugIns;
namespace LINGYUN.Abp.IdentityServer4
{
@ -7,7 +10,17 @@ namespace LINGYUN.Abp.IdentityServer4
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpIdentityServerAdminHttpApiHostModule>();
services.AddApplication<AbpIdentityServerAdminHttpApiHostModule>(options =>
{
// 搜索 Modules 目录下所有文件作为插件
// 取消显示引用所有其他项目的模块,改为通过插件的形式引用
var pluginFolder = Path.Combine(
Directory.GetCurrentDirectory(), "Modules");
DirectoryHelper.CreateIfNotExists(pluginFolder);
options.PlugInSources.AddFolder(
pluginFolder,
SearchOption.AllDirectories);
});
}
public void Configure(IApplicationBuilder app)

15
aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/Startup.cs

@ -5,8 +5,11 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.IO;
using Volo.Abp.Modularity.PlugIns;
namespace LINGYUN.Abp.LocalizationManagement
{
@ -14,7 +17,17 @@ namespace LINGYUN.Abp.LocalizationManagement
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpLocalizationManagementHttpApiHostModule>();
services.AddApplication<AbpLocalizationManagementHttpApiHostModule>(options =>
{
// 搜索 Modules 目录下所有文件作为插件
// 取消显示引用所有其他项目的模块,改为通过插件的形式引用
var pluginFolder = Path.Combine(
Directory.GetCurrentDirectory(), "Modules");
DirectoryHelper.CreateIfNotExists(pluginFolder);
options.PlugInSources.AddFolder(
pluginFolder,
SearchOption.AllDirectories);
});
}
public void Configure(IApplicationBuilder app)

15
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Startup.cs

@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System.IO;
using Volo.Abp.IO;
using Volo.Abp.Modularity.PlugIns;
namespace LINGYUN.Abp.MessageService
{
@ -7,7 +10,17 @@ namespace LINGYUN.Abp.MessageService
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpMessageServiceHttpApiHostModule>();
services.AddApplication<AbpMessageServiceHttpApiHostModule>(options =>
{
// 搜索 Modules 目录下所有文件作为插件
// 取消显示引用所有其他项目的模块,改为通过插件的形式引用
var pluginFolder = Path.Combine(
Directory.GetCurrentDirectory(), "Modules");
DirectoryHelper.CreateIfNotExists(pluginFolder);
options.PlugInSources.AddFolder(
pluginFolder,
SearchOption.AllDirectories);
});
}
public void Configure(IApplicationBuilder app)

15
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Startup.cs

@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System.IO;
using Volo.Abp.IO;
using Volo.Abp.Modularity.PlugIns;
namespace LINGYUN.Platform
{
@ -7,7 +10,17 @@ namespace LINGYUN.Platform
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AppPlatformHttpApiHostModule>();
services.AddApplication<AppPlatformHttpApiHostModule>(options =>
{
// 搜索 Modules 目录下所有文件作为插件
// 取消显示引用所有其他项目的模块,改为通过插件的形式引用
var pluginFolder = Path.Combine(
Directory.GetCurrentDirectory(), "Modules");
DirectoryHelper.CreateIfNotExists(pluginFolder);
options.PlugInSources.AddFolder(
pluginFolder,
SearchOption.AllDirectories);
});
}
public void Configure(IApplicationBuilder app)

31
build/build-aspnetcore-modules.ps1

@ -0,0 +1,31 @@
# COMMON PATHS
$rootFolder = (Get-Item -Path "./" -Verbose).FullName
# List of solutions used only in development mode
$dependenciesFile = Join-Path $rootFolder "../build/modules.dependencies.json"
function ReadFile($path) {
return (Get-Content -Raw -Encoding "UTF8" -Path "$path" )
}
function ReadJsonFile($path) {
$content = ReadFile $path
return ConvertFrom-Json -InputObject $content
}
$modules = (ReadJsonFile -path $dependenciesFile)
foreach ($module in $modules) {
foreach ($dependencieRoot in $module.dependencies) {
foreach ($dependencie in $dependencieRoot.dependencies) {
$thisPath = Join-Path $rootFolder $dependencieRoot.depPath
$modulePath = Join-Path $rootFolder $dependencieRoot.path
Write-host $thisPath
if (!(Test-Path $modulePath)) {
New-Item -ItemType Directory -Force -Path $modulePath
}
Copy-Item (Join-Path $thisPath $dependencie) -Destination $modulePath
}
}
}

51
build/modules.dependencies.json

@ -0,0 +1,51 @@
[
{
"tag": "net5.0",
"dependencies": [
{
"service": "Backend-Admin",
"path": "/../aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/",
"depPath": "/../aspnet-core/LocalNuget/net5.0/",
"dependencies": [
"LINGYUN.ApiGateway.Application.Contracts.dll",
"LINGYUN.ApiGateway.Domain.Shared.dll",
"LINGYUN.Abp.Aliyun.SettingManagement.dll",
"LINGYUN.Abp.Sms.Aliyun.dll",
"LINGYUN.Abp.Aliyun.dll",
"LINGYUN.Abp.WeChat.MiniProgram.dll",
"LINGYUN.Abp.WeChat.Official.dll",
"LINGYUN.Abp.WeChat.dll",
"LINGYUN.Abp.WeChat.SettingManagement.dll",
"LINGYUN.Abp.LocalizationManagement.Application.Contracts.dll",
"LINGYUN.Abp.LocalizationManagement.Domain.Shared.dll",
"LINGYUN.Abp.OssManagement.Application.Contracts.dll",
"LINGYUN.Abp.OssManagement.Domain.Shared.dll",
"LINGYUN.Abp.MessageService.Application.Contracts.dll",
"LINGYUN.Abp.IM.dll",
"LINGYUN.Abp.MessageService.Domain.Shared.dll",
"LINGYUN.Abp.RealTime.dll",
"LINGYUN.Abp.Notifications.dll",
"LINGYUN.Platform.Application.Contracts.dll",
"LINGYUN.Platform.Domain.Shared.dll"
]
},
{
"service": "Backend-Admin",
"path": "/../aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/Modules/",
"depPath": "/../aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/bin/Debug/net5.0",
"dependencies": [
"LINGYUN.Abp.Account.Application.Contracts.dll",
"Volo.Abp.Account.Application.Contracts.dll",
"Volo.Abp.Identity.Application.Contracts.dll",
"LINGYUN.Abp.Identity.Application.Contracts.dll",
"LINGYUN.Abp.Identity.Domain.Shared.dll",
"Volo.Abp.Identity.Domain.Shared.dll",
"Volo.Abp.Users.Domain.Shared.dll",
"Volo.Abp.Users.Abstractions.dll",
"LINGYUN.Abp.IdentityServer.Application.Contracts.dll",
"Volo.Abp.IdentityServer.Domain.Shared.dll"
]
}
]
}
]

1
docker-compose.override.yml

@ -22,6 +22,7 @@ services:
context: ./aspnet-core/services/Publish/admin
volumes:
- /var/opt/abp/logs/backend-admin:/app/Logs
- /var/opt/abp/data/backend-admin/Modules:/app/Modules
depends_on:
- identity-server-sts
restart: always

Loading…
Cancel
Save