2021-10-12 17:07:27 +08:00
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using Microsoft.OpenApi.Models;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using Yi.Framework.Common.IOCOptions;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.WebCore.MiddlewareExtend
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Redis扩展
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static class RabbitMQExtension
|
|
|
|
|
|
{
|
|
|
|
|
|
public static IServiceCollection AddRabbitMQService(this IServiceCollection services)
|
|
|
|
|
|
{
|
2021-10-26 15:09:07 +08:00
|
|
|
|
if (Appsettings.appBool("RabbitMQ_Enabled"))
|
|
|
|
|
|
{
|
|
|
|
|
|
services.Configure<RabbitMQOptions>(Appsettings.appConfiguration("RabbitConn"));
|
|
|
|
|
|
}
|
2021-10-12 17:07:27 +08:00
|
|
|
|
return services;
|
2021-10-26 15:09:07 +08:00
|
|
|
|
|
2021-10-12 17:07:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|