添加项目文件。
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using IM.Commons;
|
||||
using IM.Protocols.Grpc.Contact;
|
||||
using IM.Protocols.Grpc.User;
|
||||
using MessageService.WebApi.Application;
|
||||
using MessageService.WebApi.Application.Conversation;
|
||||
using MessageService.WebApi.Application.IntegrationServices;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace MessageService.WebApi
|
||||
{
|
||||
public class ModuleInit : IModuleInitializer
|
||||
{
|
||||
public void Initialize(IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<Application.Message.MessageService>();
|
||||
services.AddScoped<ConversationService>();
|
||||
services.AddScoped<SquenceService>();
|
||||
services.AddScoped<IContactIntegrationService, ContactIntegrationService>();
|
||||
services.AddScoped<IGroupMemberIntegrationService, GroupMemberIntegrationService>();
|
||||
services.AddGrpcClient<ContactInternal.ContactInternalClient>((sp, o) =>
|
||||
{
|
||||
var options = sp.GetRequiredService<IOptionsMonitor<GrpcOptions>>();
|
||||
o.Address = new Uri(options.CurrentValue.ContactServiceUrl);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user