Commit 966f1527 by 赵剑炜

调整框架

parent 535b4791
using RabbitMQ.Client.Events;
using RabbitMQ.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Junmp.Platform.Common.Class.RabbitMQ
{
/// <summary>
/// RabbitMQ 客户端定义。
/// </summary>
public class MqConfigInfo
{
private static ConnectionFactory? _factory;
public static ConnectionFactory GetFactory()
{
if (_factory == null)
{
ConnectionFactory factory = new ConnectionFactory();
factory.Uri = new Uri("amqp://guest:guest@127.0.0.1:5672/");
_factory = factory;
}
return _factory;
}
}
}
//-----------------------------------------------------------------------
// <Copyright>
// * Copyright (C) 2022 Admin All Rights Reserved
// </Copyright>
//-----------------------------------------------------------------------
using System;
namespace Junmp.Platform.Common.Global
{
/// <summary>
/// ActiveMQ配置
/// </summary>
public class ActiveMQConfig
{
/// <summary>
/// ActiveMQ连接串
/// </summary>
public String ConnectionString { get; set; }
/// <summary>
/// 主题名称
/// </summary>
public String TopicName { get; set; }
/// <summary>
/// 队列名称
/// </summary>
public String QueueName { get; set; }
}
}
......@@ -34,10 +34,6 @@ namespace Junmp.Platform.Common.Global
/// </summary>
public static RedisConfig RedisConfig { get; set; }
/// <summary>
/// ActiveMQ配置
/// </summary>
public static ActiveMQConfig ActiveMQConfig { get; set; }
/// <summary>
/// Jwt配置
......@@ -134,10 +130,7 @@ namespace Junmp.Platform.Common.Global
/// </summary>
public static CapConfig CapConfig { get; set; }
/// <summary>
/// Kafka配置
/// </summary>
public static KafkaConfig KafkaConfig { get; set; }
/// <summary>
/// SignalR配置
......
using System;
namespace Junmp.Platform.Common.Global
{
/// <summary>
/// Kafka配置
/// </summary>
public class KafkaConfig
{
/// <summary>
/// 地址
/// </summary>
public String BootstrapServers { get; set; }
/// <summary>
/// GroupId
/// </summary>
public String GroupId { get; set; }
/// <summary>
/// 间隔时间
/// </summary>
public int StatisticsIntervalMs { get; set; }
/// <summary>
/// 超时时间
/// </summary>
public int SessionTimeoutMs { get; set; }
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Junmp.Process.Common</RootNamespace>
<AssemblyName>Junmp.Platform.Common</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>..\Admin.Net.WebApi\Junmp.Platform.Common.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Apache.NMS.ActiveMQ.NetCore" Version="1.7.3" />
<PackageReference Include="Confluent.Kafka" Version="1.9.3" />
<PackageReference Include="CSRedisCore" Version="3.8.670" />
<PackageReference Include="Elasticsearch.Net" Version="7.17.5" />
<PackageReference Include="FluentFTP" Version="42.1.0" />
<PackageReference Include="KYSharp.SM.Core" Version="1.0.1" />
<PackageReference Include="log4net" Version="2.0.15" />
<PackageReference Include="Masuit.Tools.Core" Version="2.5.8.3" />
<PackageReference Include="MeiliSearch" Version="0.13.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="MongoDB.Driver" Version="2.18.0" />
<PackageReference Include="NEST" Version="7.17.5" />
<PackageReference Include="NPOI" Version="2.6.0" />
<PackageReference Include="Npoi.Mapper" Version="4.1.0" />
<PackageReference Include="RabbitMQ.Client" Version="6.4.0" />
<PackageReference Include="SmartThreadPool.NetCore" Version="2.3.0" />
<PackageReference Include="SSH.NET" Version="2020.0.2" />
<PackageReference Include="StackExchange.Redis" Version="2.6.86" />
<PackageReference Include="Tesseract" Version="5.2.0" />
<PackageReference Include="ZXing.Net.Bindings.ZKWeb.System.Drawing" Version="0.16.6" />
</ItemGroup>
<ItemGroup>
<None Update="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\leptonica-1.80.0.dll" Link="Lib\Tesseract\x86\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Update="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\tesseract41.dll" Link="Lib\Tesseract\x86\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Update="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\leptonica-1.80.0.dll" Link="Lib\Tesseract\x64\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Update="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\tesseract41.dll" Link="Lib\Tesseract\x64\tesseract41.dll" />
<None Update="Library\Tesseract\chi_sim.traineddata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x64\leptonica-1.82.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x64\tesseract50.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x86\leptonica-1.82.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x86\tesseract50.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x86\leptonica-1.82.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x86\tesseract50.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x64\leptonica-1.82.0.dll" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Junmp.Process.Common</RootNamespace>
<AssemblyName>Junmp.Process.Common</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>..\Admin.Net.WebApi\Admin.Net.Common.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Apache.NMS.ActiveMQ.NetCore" Version="1.7.3" />
<PackageReference Include="Confluent.Kafka" Version="1.9.3" />
<PackageReference Include="CSRedisCore" Version="3.8.670" />
<PackageReference Include="Elasticsearch.Net" Version="7.17.5" />
<PackageReference Include="FluentFTP" Version="42.1.0" />
<PackageReference Include="KYSharp.SM.Core" Version="1.0.1" />
<PackageReference Include="log4net" Version="2.0.15" />
<PackageReference Include="Masuit.Tools.Core" Version="2.5.8.3" />
<PackageReference Include="MeiliSearch" Version="0.13.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="MongoDB.Driver" Version="2.18.0" />
<PackageReference Include="NEST" Version="7.17.5" />
<PackageReference Include="NPOI" Version="2.6.0" />
<PackageReference Include="Npoi.Mapper" Version="4.1.0" />
<PackageReference Include="RabbitMQ.Client" Version="6.4.0" />
<PackageReference Include="SmartThreadPool.NetCore" Version="2.3.0" />
<PackageReference Include="SSH.NET" Version="2020.0.2" />
<PackageReference Include="StackExchange.Redis" Version="2.6.86" />
<PackageReference Include="Tesseract" Version="5.2.0" />
<PackageReference Include="ZXing.Net.Bindings.ZKWeb.System.Drawing" Version="0.16.6" />
</ItemGroup>
<ItemGroup>
<None Update="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\leptonica-1.80.0.dll" Link="Lib\Tesseract\x86\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Update="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\tesseract41.dll" Link="Lib\Tesseract\x86\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Update="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\leptonica-1.80.0.dll" Link="Lib\Tesseract\x64\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Update="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\tesseract41.dll" Link="Lib\Tesseract\x64\tesseract41.dll" />
<None Update="Library\Tesseract\chi_sim.traineddata">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x86\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\leptonica-1.80.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\pangmingjun\.nuget\packages\tesseract\4.1.1\build\\..\x64\tesseract41.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x64\leptonica-1.82.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x64\tesseract50.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x86\leptonica-1.82.0.dll" />
</ItemGroup>
<ItemGroup>
<None Remove="C:\Users\DELL\.nuget\packages\tesseract\5.2.0\build\\..\x86\tesseract50.dll" />
</ItemGroup>
</Project>
//-----------------------------------------------------------------------
// <Copyright>
// * Copyright (C) 2022 Admin All Rights Reserved
// </Copyright>
//-----------------------------------------------------------------------
using Apache.NMS;
using Apache.NMS.ActiveMQ;
using Apache.NMS.ActiveMQ.Commands;
using Junmp.Platform.Common.Global;
using System;
using System.Threading.Tasks;
namespace Junmp.Platform.Common.Utility
{
/// <summary>
/// ActiveMQ工具类
/// </summary>
public class ActiveMQContext
{
/// <summary>
/// 发送Topic
/// </summary>
/// <param name="message">消息</param>
/// <param name="topicName">topic别名</param>
/// <returns></returns>
public static void SendTopic(String message, String topicName = null)
{
SendMessage("topic", message, topicName);
}
/// <summary>
/// 发送Topic
/// </summary>
/// <param name="message">消息</param>
/// <param name="topicName">topic别名</param>
/// <returns></returns>
public static async Task SendTopicAsync(String message, String topicName = null)
{
await SendMessageAsync("topic", message, topicName);
}
/// <summary>
/// 发送Queue
/// </summary>
/// <param name="message">消息</param>
/// <param name="queueName">queue别名</param>
/// <returns></returns>
public static void SendQueue(String message, String queueName = null)
{
SendMessage("queue", message, queueName);
}
/// <summary>
/// 发送Queue
/// </summary>
/// <param name="message">消息</param>
/// <param name="queueName">queue别名</param>
/// <returns></returns>
public static async Task SendQueueAsync(String message, String queueName = null)
{
await SendMessageAsync("queue", message, queueName);
}
/// <summary>
/// 发送消息
/// </summary>
/// <param name="type">消息类型</param>
/// <param name="message">消息</param>
/// <param name="tqName">别名</param>
public static void SendMessage(String type, String message, String tqName = null)
{
Send(type, message, tqName);
}
/// <summary>
/// 发送消息
/// </summary>
/// <param name="type">消息类型</param>
/// <param name="message">消息</param>
/// <param name="tqName">别名</param>
public static async Task SendMessageAsync(String type, String message, String tqName = null)
{
await Task.Run(() => { Send(type, message, tqName); });
}
/// <summary>
/// 发送消息
/// </summary>
/// <param name="type">消息类型</param>
/// <param name="message">消息</param>
/// <param name="tqName">别名</param>
private static void Send(String type, String message, String tqName = null)
{
IConnectionFactory _factory = new ConnectionFactory(new Uri(AdminGlobalContext.ActiveMQConfig.ConnectionString));
using (IConnection _conn = _factory.CreateConnection())
{
using (ISession _session = _conn.CreateSession())
{
if (type.Equals("queue"))
{
var queueName = AdminGlobalContext.ActiveMQConfig.QueueName;
if (!String.IsNullOrEmpty(tqName))
{
queueName += tqName;
}
using (IMessageProducer producer = _session.CreateProducer(new ActiveMQQueue(queueName)))
{
ITextMessage request = _session.CreateTextMessage(message);
producer.Send(request);
}
}
else if (type.Equals("topic"))
{
var topicName = AdminGlobalContext.ActiveMQConfig.TopicName;
if (!String.IsNullOrEmpty(tqName))
{
topicName += tqName;
}
using (IMessageProducer producer = _session.CreateProducer(new ActiveMQTopic(topicName)))
{
ITextMessage request = _session.CreateTextMessage(message);
producer.Send(request);
}
}
}
}
}
}
}
using Confluent.Kafka;
using Newtonsoft.Json;
using Junmp.Platform.Common.Global;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
namespace Junmp.Platform.Common.Utility
{
/// <summary>
/// Kafka工具类
/// </summary>
public class KafkaContext
{
/// <summary>
/// 发布消息
/// </summary>
/// <typeparam name="TMessage">消息类型</typeparam>
/// <param name="topicName">主题</param>
/// <param name="message">消息</param>
/// <returns></returns>
public static async Task PublishAsync<TMessage>(string topicName, TMessage message) where TMessage : class
{
var config = new ProducerConfig
{
BootstrapServers = AdminGlobalContext.KafkaConfig.BootstrapServers
};
using var producer = new ProducerBuilder<string, string>(config).Build();
await producer.ProduceAsync(topicName, new Message<string, string>
{
Key = Guid.NewGuid().ToString(),
Value = HttpUtility.UrlEncode(JsonConvert.SerializeObject(message), Encoding.UTF8)
});
}
/// <summary>
/// 订阅kafka
/// </summary>
/// <typeparam name="TMessage">消息类型</typeparam>
/// <param name="topics">主题</param>
/// <param name="messageFunc">回调函数</param>
/// <param name="cancellationToken">取消口令</param>
/// <returns></returns>
public static async Task SubscribeAsync<TMessage>(IEnumerable<string> topics, Action<TMessage> messageFunc, CancellationToken cancellationToken) where TMessage : class
{
var config = new ConsumerConfig
{
BootstrapServers = AdminGlobalContext.KafkaConfig.BootstrapServers,
GroupId = AdminGlobalContext.KafkaConfig.GroupId,
EnableAutoCommit = false,
StatisticsIntervalMs = AdminGlobalContext.KafkaConfig.StatisticsIntervalMs,
SessionTimeoutMs = AdminGlobalContext.KafkaConfig.SessionTimeoutMs,
AutoOffsetReset = AutoOffsetReset.Earliest,
EnablePartitionEof = true
};
using var consumer = new ConsumerBuilder<Ignore, string>(config)
.SetErrorHandler((_, e) =>
{
Console.WriteLine($"Error: {e.Reason}");
})
.SetStatisticsHandler((_, json) =>
{
Console.WriteLine($" - {DateTime.Now:yyyy-MM-dd HH:mm:ss} > 消息监听中..");
})
.SetPartitionsAssignedHandler((c, partitions) =>
{
string partitionsStr = string.Join(", ", partitions);
Console.WriteLine($" - 分配的 kafka 分区: {partitionsStr}");
})
.SetPartitionsRevokedHandler((c, partitions) =>
{
string partitionsStr = string.Join(", ", partitions);
Console.WriteLine($" - 回收了 kafka 的分区: {partitionsStr}");
})
.Build();
consumer.Subscribe(topics);
try
{
while (true)
{
try
{
var consumeResult = consumer.Consume(cancellationToken);
Console.WriteLine($"Consumed message '{consumeResult.Message?.Value}' at: '{consumeResult?.TopicPartitionOffset}'.");
if (consumeResult.IsPartitionEOF)
{
Console.WriteLine($" - {DateTime.Now:yyyy-MM-dd HH:mm:ss} 已经到底了:{consumeResult.Topic}, partition {consumeResult.Partition}, offset {consumeResult.Offset}.");
continue;
}
TMessage messageResult = null;
try
{
messageResult = JsonConvert.DeserializeObject<TMessage>(consumeResult.Message.Value);
}
catch (Exception ex)
{
var errorMessage = $" - {DateTime.Now:yyyy-MM-dd HH:mm:ss}【Exception 消息反序列化失败,Value:{consumeResult.Message.Value}】 :{ex.StackTrace?.ToString()}";
Console.WriteLine(errorMessage);
messageResult = null;
}
if (messageResult != null/* && consumeResult.Offset % commitPeriod == 0*/)
{
messageFunc(messageResult);
try
{
consumer.Commit(consumeResult);
}
catch (KafkaException e)
{
Console.WriteLine(e.Message);
}
}
}
catch (ConsumeException e)
{
Console.WriteLine($"Consume error: {e.Error.Reason}");
}
}
}
catch (OperationCanceledException)
{
Console.WriteLine("Closing consumer.");
consumer.Close();
}
await Task.CompletedTask;
}
//public static void SubscribeAsync()
//{
// var cts = new CancellationTokenSource();
// Console.CancelKeyPress += (_, e) =>
// {
// e.Cancel = true;
// cts.Cancel();
// };
// await kafkaService.SubscribeAsync<XxxEventData>(topics, async (eventData) =>
// {
// // Your logic
// Console.WriteLine($" - {eventData.EventTime:yyyy-MM-dd HH:mm:ss} 【{eventData.TopicName}】- > 已处理");
// }, cts.Token);
//}
}
}
......@@ -10,7 +10,7 @@ using System;
using System.Text;
using System.Threading.Tasks;
namespace Junmp.Platform.Common.Utility
namespace Junmp.Platform.Common.Utility.RabbitMQ
{
/// <summary>
/// RabbitMQ工具类
......@@ -54,7 +54,11 @@ namespace Junmp.Platform.Common.Utility
UserName = AdminGlobalContext.RabbitMQConfig.UserName,
Password = AdminGlobalContext.RabbitMQConfig.Password,
HostName = AdminGlobalContext.RabbitMQConfig.HostName,
Port = AdminGlobalContext.RabbitMQConfig.Port
Port = AdminGlobalContext.RabbitMQConfig.Port,
RequestedHeartbeat = TimeSpan.FromSeconds(30), //心跳包
AutomaticRecoveryEnabled = true, //自动重连
TopologyRecoveryEnabled = true, //拓普重连
NetworkRecoveryInterval = TimeSpan.FromSeconds(10)
};
//创建连接对象
connection = factory.CreateConnection();
......@@ -62,6 +66,7 @@ namespace Junmp.Platform.Common.Utility
#endregion
return connection;
});
......@@ -79,17 +84,18 @@ namespace Junmp.Platform.Common.Utility
/// 发送消息
/// </summary>
/// <param name="message">消息体</param>
public static void SendMessage(String message)
public static void SendMessage(string message)
{
IConnection connection = ConnectionInstance;
//定义通道
var channel = connection.CreateModel();
//如果只有生产者,则使用以下注释内容,作为单例使用
//定义交换机
channel.ExchangeDeclare(AdminGlobalContext.RabbitMQConfig.ExchangeName, ExchangeType.Fanout, true, false);
//定义队列
channel.QueueDeclare(AdminGlobalContext.RabbitMQConfig.QueueName, false, false, false, null);
//将队列绑定到交换机
channel.QueueBind(AdminGlobalContext.RabbitMQConfig.QueueName, AdminGlobalContext.RabbitMQConfig.ExchangeName, "", null);
//channel.ExchangeDeclare(AdminGlobalContext.RabbitMQConfig.ExchangeName, ExchangeType.Fanout, true, false);
////定义队列
//channel.QueueDeclare(AdminGlobalContext.RabbitMQConfig.QueueName, false, false, false, null);
////将队列绑定到交换机
//channel.QueueBind(AdminGlobalContext.RabbitMQConfig.QueueName, AdminGlobalContext.RabbitMQConfig.ExchangeName, "", null);
//发布消息
channel.BasicPublish(AdminGlobalContext.RabbitMQConfig.ExchangeName, "", null, Encoding.Default.GetBytes(message));
}
......@@ -99,7 +105,7 @@ namespace Junmp.Platform.Common.Utility
/// </summary>
/// <param name="message">消息体</param>
/// <returns></returns>
public static async Task SendMessageAsynce(String message)
public static async Task SendMessageAsynce(string message)
{
await Task.Run(() => SendMessage(message));
}
......
using Microsoft.Extensions.Logging;
using RabbitMQ.Client.Events;
using RabbitMQ.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Junmp.Platform.Common.Class.RabbitMQ;
using Microsoft.Extensions.Hosting;
using Junmp.Platform.Common.Global;
namespace Junmp.Platform.Common.Utility.RabbitMQ
{
public class RabbitMQCustomContext : BackgroundService
{
ConnectionFactory factory = null;
IConnection connection = null;
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
try
{
//创建连接对象工厂
factory = new ConnectionFactory()
{
UserName = AdminGlobalContext.RabbitMQConfig.UserName,
Password = AdminGlobalContext.RabbitMQConfig.Password,
HostName = AdminGlobalContext.RabbitMQConfig.HostName,
Port = AdminGlobalContext.RabbitMQConfig.Port,
RequestedHeartbeat = TimeSpan.FromSeconds(30), //心跳包
AutomaticRecoveryEnabled = true, //自动重连
TopologyRecoveryEnabled = true, //拓普重连
NetworkRecoveryInterval = TimeSpan.FromSeconds(10)
};
//创建连接对象
connection = factory.CreateConnection();
IModel channel = connection.CreateModel();
channel.ExchangeDeclare(AdminGlobalContext.RabbitMQConfig.ExchangeName, ExchangeType.Fanout);
channel.QueueDeclare(AdminGlobalContext.RabbitMQConfig.QueueName, false, false, false, null);
channel.QueueBind(AdminGlobalContext.RabbitMQConfig.QueueName, AdminGlobalContext.RabbitMQConfig.ExchangeName, "", null);
var consumer = new EventingBasicConsumer(channel);
consumer.Received += (ch, ea) =>
{
var body = ea.Body.ToArray();
string str = Encoding.UTF8.GetString(body);
Console.WriteLine("接受到的mq消息:" + str);
channel.BasicAck(ea.DeliveryTag, false);
//Thread.Sleep(1000);
};
string consumerTag = channel.BasicConsume(AdminGlobalContext.RabbitMQConfig.QueueName, false, consumer);
}
catch (Exception)
{
throw;
}
}
}
}
......@@ -198,24 +198,9 @@
<param name="message">异常信息</param>
<param name="innerException">内部异常</param>
</member>
<member name="T:Junmp.Platform.Common.Global.ActiveMQConfig">
<member name="T:Junmp.Platform.Common.Class.RabbitMQ.MqConfigInfo">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.ConnectionString">
<summary>
ActiveMQ连接串
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.TopicName">
<summary>
主题名称
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.QueueName">
<summary>
队列名称
RabbitMQ 客户端定义。
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.AdminGlobalContext">
......@@ -243,11 +228,6 @@
Redis配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.ActiveMQConfig">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.JwtSettings">
<summary>
Jwt配置
......@@ -343,11 +323,6 @@
Cap分布式事务配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.SignalRConfig">
<summary>
SignalR配置
......@@ -744,31 +719,6 @@
token有效时间(分钟)
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.BootstrapServers">
<summary>
地址
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.GroupId">
<summary>
GroupId
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.StatisticsIntervalMs">
<summary>
间隔时间
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.SessionTimeoutMs">
<summary>
超时时间
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.LogConfig">
<summary>
审计日志设置
......@@ -1353,67 +1303,6 @@
结果信息 -- 结构体
</summary>
</member>
<member name="T:Junmp.Platform.Common.Utility.ActiveMQContext">
<summary>
ActiveMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopic(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopicAsync(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueue(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueueAsync(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessage(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessageAsync(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.Send(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.AesUtil">
<summary>
AES加解密工具
......@@ -1974,30 +1863,6 @@
<param name="section">节点名称</param>
<param name="path">文件路径</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.KafkaContext">
<summary>
Kafka工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.PublishAsync``1(System.String,``0)">
<summary>
发布消息
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topicName">主题</param>
<param name="message">消息</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.SubscribeAsync``1(System.Collections.Generic.IEnumerable{System.String},System.Action{``0},System.Threading.CancellationToken)">
<summary>
订阅kafka
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topics">主题</param>
<param name="messageFunc">回调函数</param>
<param name="cancellationToken">取消口令</param>
<returns></returns>
</member>
<member name="F:Junmp.Platform.Common.Utility.LoggerContext.logger">
<summary>
ILog实例
......@@ -2173,39 +2038,39 @@
<param name="imagePath"></param>
<returns></returns>
</member>
<member name="T:Junmp.Platform.Common.Utility.RabbitMQContext">
<member name="T:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext">
<summary>
RabbitMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.#ctor">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.#ctor">
<summary>
私有化构造函数
用于单例模式
</summary>
</member>
<member name="F:Junmp.Platform.Common.Utility.RabbitMQContext.LazyConnection">
<member name="F:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.LazyConnection">
<summary>
Lazy对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.ConnectionInstance">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.ConnectionInstance">
<summary>
单例对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.IsConnectionInstanceCreated">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.IsConnectionInstanceCreated">
<summary>
是否已创建
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessage(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessage(System.String)">
<summary>
发送消息
</summary>
<param name="message">消息体</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessageAsynce(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessageAsynce(System.String)">
<summary>
异步发送消息
</summary>
......
d1cf15e2a954bbc9b1a11b7e79f6e507527604ee
c37ca836ad7f1bbd701c8bde186367514188ef9f
......@@ -198,24 +198,9 @@
<param name="message">异常信息</param>
<param name="innerException">内部异常</param>
</member>
<member name="T:Junmp.Platform.Common.Global.ActiveMQConfig">
<member name="T:Junmp.Platform.Common.Class.RabbitMQ.MqConfigInfo">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.ConnectionString">
<summary>
ActiveMQ连接串
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.TopicName">
<summary>
主题名称
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.QueueName">
<summary>
队列名称
RabbitMQ 客户端定义。
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.AdminGlobalContext">
......@@ -243,11 +228,6 @@
Redis配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.ActiveMQConfig">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.JwtSettings">
<summary>
Jwt配置
......@@ -343,11 +323,6 @@
Cap分布式事务配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.SignalRConfig">
<summary>
SignalR配置
......@@ -744,31 +719,6 @@
token有效时间(分钟)
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.BootstrapServers">
<summary>
地址
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.GroupId">
<summary>
GroupId
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.StatisticsIntervalMs">
<summary>
间隔时间
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.SessionTimeoutMs">
<summary>
超时时间
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.LogConfig">
<summary>
审计日志设置
......@@ -1353,67 +1303,6 @@
结果信息 -- 结构体
</summary>
</member>
<member name="T:Junmp.Platform.Common.Utility.ActiveMQContext">
<summary>
ActiveMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopic(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopicAsync(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueue(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueueAsync(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessage(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessageAsync(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.Send(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.AesUtil">
<summary>
AES加解密工具
......@@ -1974,30 +1863,6 @@
<param name="section">节点名称</param>
<param name="path">文件路径</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.KafkaContext">
<summary>
Kafka工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.PublishAsync``1(System.String,``0)">
<summary>
发布消息
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topicName">主题</param>
<param name="message">消息</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.SubscribeAsync``1(System.Collections.Generic.IEnumerable{System.String},System.Action{``0},System.Threading.CancellationToken)">
<summary>
订阅kafka
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topics">主题</param>
<param name="messageFunc">回调函数</param>
<param name="cancellationToken">取消口令</param>
<returns></returns>
</member>
<member name="F:Junmp.Platform.Common.Utility.LoggerContext.logger">
<summary>
ILog实例
......@@ -2173,39 +2038,39 @@
<param name="imagePath"></param>
<returns></returns>
</member>
<member name="T:Junmp.Platform.Common.Utility.RabbitMQContext">
<member name="T:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext">
<summary>
RabbitMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.#ctor">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.#ctor">
<summary>
私有化构造函数
用于单例模式
</summary>
</member>
<member name="F:Junmp.Platform.Common.Utility.RabbitMQContext.LazyConnection">
<member name="F:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.LazyConnection">
<summary>
Lazy对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.ConnectionInstance">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.ConnectionInstance">
<summary>
单例对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.IsConnectionInstanceCreated">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.IsConnectionInstanceCreated">
<summary>
是否已创建
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessage(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessage(System.String)">
<summary>
发送消息
</summary>
<param name="message">消息体</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessageAsynce(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessageAsynce(System.String)">
<summary>
异步发送消息
</summary>
......
//-----------------------------------------------------------------------
// <Copyright file="BizAccountRepository.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: BizAccountRepository.cs
// * History : Created by Admin 03/14/2022 09:24:12
// </Copyright>
//-----------------------------------------------------------------------
using Microsoft.AspNetCore.Http;
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Repository.Base;
namespace Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessAccountRepository
{
/// <summary>
/// BizAccount数据访问层实现
/// </summary>
public class BizAccountRepository : AdminBaseRepository<BizAccount>, IBizAccountRepository
{
#region 属性及构造函数
/// <summary>
/// HttpContext
/// </summary>
private readonly IHttpContextAccessor context;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="context"></param>
public BizAccountRepository(IHttpContextAccessor context) : base(context)
{
this.context = context;
}
#endregion
}
}
//-----------------------------------------------------------------------
// <Copyright file="IBizAccountRepository.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: IBizAccountRepository.cs
// * History : Created by Admin 03/14/2022 09:24:12
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Repository.Base;
namespace Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessAccountRepository
{
/// <summary>
/// BizAccount数据访问层接口
/// </summary>
public interface IBizAccountRepository : IAdminBaseRepository<BizAccount>
{
}
}
//-----------------------------------------------------------------------
// <Copyright file="BizUserModuleRepository.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: BizUserModuleRepository.cs
// * History : Created by Admin 01/21/2022 13:30:46
// </Copyright>
//-----------------------------------------------------------------------
using Microsoft.AspNetCore.Http;
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Repository.Base;
namespace Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserModuleRepository
{
/// <summary>
/// BizUserModule数据访问层实现
/// </summary>
public class BizUserModuleRepository : AdminBaseRepository<BizUserModule>, IBizUserModuleRepository
{
/// <summary>
/// HttpContext
/// </summary>
private readonly IHttpContextAccessor context;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="context"></param>
public BizUserModuleRepository(IHttpContextAccessor context) : base(context)
{
this.context = context;
}
}
}
//-----------------------------------------------------------------------
// <Copyright file="IBizUserModuleRepository.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: IBizUserModuleRepository.cs
// * History : Created by Admin 01/21/2022 13:30:46
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Repository.Base;
namespace Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserModuleRepository
{
/// <summary>
/// BizUserModule数据访问层接口
/// </summary>
public interface IBizUserModuleRepository : IAdminBaseRepository<BizUserModule>
{
}
}
//-----------------------------------------------------------------------
// <Copyright file="BizUserRepository.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: BizUserRepository.cs
// * History : Created by Admin 01/21/2022 13:30:46
// </Copyright>
//-----------------------------------------------------------------------
using Microsoft.AspNetCore.Http;
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Repository.Base;
namespace Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserRepository
{
/// <summary>
/// BizUser数据访问层实现
/// </summary>
public class BizUserRepository : AdminBaseRepository<BizUser>, IBizUserRepository
{
/// <summary>
/// HttpContext
/// </summary>
private readonly IHttpContextAccessor context;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="context"></param>
public BizUserRepository(IHttpContextAccessor context) : base(context)
{
this.context = context;
}
}
}
//-----------------------------------------------------------------------
// <Copyright file="IBizUserRepository.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: IBizUserRepository.cs
// * History : Created by Admin 01/21/2022 13:30:46
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Repository.Base;
namespace Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserRepository
{
/// <summary>
/// BizUser数据访问层接口
/// </summary>
public interface IBizUserRepository : IAdminBaseRepository<BizUser>
{
}
}
using Junmp.Platform.Repository.Base;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserRepository;
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Microsoft.AspNetCore.Http;
using System;
......
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Admin.Net.Repository.BusinessRepository.KafkaRepository
{
/// <summary>
/// Kafka仓储层接口
/// </summary>
public interface IKafkaRepository
{
/// <summary>
/// 发布消息
/// </summary>
/// <typeparam name="TMessage">消息类型</typeparam>
/// <param name="topicName">主题</param>
/// <param name="message">消息</param>
/// <returns></returns>
Task PublishAsync<TMessage>(string topicName, TMessage message) where TMessage : class;
/// <summary>
/// 订阅kafka
/// </summary>
/// <typeparam name="TMessage">消息类型</typeparam>
/// <param name="topics">主题</param>
/// <param name="messageFunc">回调函数</param>
/// <param name="cancellationToken">取消口令</param>
/// <returns></returns>
Task SubscribeAsync<TMessage>(IEnumerable<string> topics, Action<TMessage> messageFunc, CancellationToken cancellationToken) where TMessage : class;
}
}
using Junmp.Platform.Common.Utility;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Admin.Net.Repository.BusinessRepository.KafkaRepository
{
/// <summary>
/// Kafka仓储层实现
/// </summary>
public class KafkaRepository : IKafkaRepository
{
/// <summary>
/// 发布消息
/// </summary>
/// <typeparam name="TMessage">消息类型</typeparam>
/// <param name="topicName">主题</param>
/// <param name="message">消息</param>
/// <returns></returns>
public async Task PublishAsync<TMessage>(string topicName, TMessage message) where TMessage : class
{
await KafkaContext.PublishAsync<TMessage>(topicName, message);
}
/// <summary>
/// 订阅kafka
/// </summary>
/// <typeparam name="TMessage">消息类型</typeparam>
/// <param name="topics">主题</param>
/// <param name="messageFunc">回调函数</param>
/// <param name="cancellationToken">取消口令</param>
/// <returns></returns>
public async Task SubscribeAsync<TMessage>(IEnumerable<string> topics, Action<TMessage> messageFunc, CancellationToken cancellationToken) where TMessage : class
{
await KafkaContext.SubscribeAsync<TMessage>(topics, messageFunc, cancellationToken);
}
}
}
......@@ -6,7 +6,7 @@
using Admin.Net.Common.Enum;
using Junmp.Platform.Common.Global;
using Junmp.Platform.Common.Utility;
using Junmp.Platform.Common.Utility.RabbitMQ;
using System;
using System.Threading.Tasks;
......@@ -25,14 +25,9 @@ namespace Admin.Net.Repository.BusinessRepository.MQRepository
/// <returns></returns>
public void SendTopic(String message, String topicName = null)
{
if (AdminGlobalContext.MomConfig.MomType == MomType.ActiveMQ)
{
ActiveMQContext.SendTopic(message, topicName);
}
else if (AdminGlobalContext.MomConfig.MomType == MomType.RabbitMQ)
{
RabbitMQContext.SendMessage(message);
}
}
/// <summary>
......@@ -43,14 +38,9 @@ namespace Admin.Net.Repository.BusinessRepository.MQRepository
/// <returns></returns>
public async Task SendTopicAsync(String message, String topicName = null)
{
if (AdminGlobalContext.MomConfig.MomType == MomType.ActiveMQ)
{
await ActiveMQContext.SendTopicAsync(message, topicName);
}
else if (AdminGlobalContext.MomConfig.MomType == MomType.RabbitMQ)
{
await RabbitMQContext.SendMessageAsynce(message);
}
}
/// <summary>
......@@ -61,14 +51,9 @@ namespace Admin.Net.Repository.BusinessRepository.MQRepository
/// <returns></returns>
public void SendQueue(String message, String queueName = null)
{
if (AdminGlobalContext.MomConfig.MomType == MomType.ActiveMQ)
{
ActiveMQContext.SendQueue(message, queueName);
}
else if (AdminGlobalContext.MomConfig.MomType == MomType.RabbitMQ)
{
RabbitMQContext.SendMessage(message);
}
}
/// <summary>
......@@ -79,14 +64,9 @@ namespace Admin.Net.Repository.BusinessRepository.MQRepository
/// <returns></returns>
public async Task SendQueueAsync(String message, String queueName = null)
{
if (AdminGlobalContext.MomConfig.MomType == MomType.ActiveMQ)
{
await ActiveMQContext.SendQueueAsync(message, queueName);
}
else if (AdminGlobalContext.MomConfig.MomType == MomType.RabbitMQ)
{
await RabbitMQContext.SendMessageAsynce(message);
}
}
}
}
......@@ -198,24 +198,9 @@
<param name="message">异常信息</param>
<param name="innerException">内部异常</param>
</member>
<member name="T:Junmp.Platform.Common.Global.ActiveMQConfig">
<member name="T:Junmp.Platform.Common.Class.RabbitMQ.MqConfigInfo">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.ConnectionString">
<summary>
ActiveMQ连接串
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.TopicName">
<summary>
主题名称
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.QueueName">
<summary>
队列名称
RabbitMQ 客户端定义。
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.AdminGlobalContext">
......@@ -243,11 +228,6 @@
Redis配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.ActiveMQConfig">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.JwtSettings">
<summary>
Jwt配置
......@@ -343,11 +323,6 @@
Cap分布式事务配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.SignalRConfig">
<summary>
SignalR配置
......@@ -744,31 +719,6 @@
token有效时间(分钟)
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.BootstrapServers">
<summary>
地址
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.GroupId">
<summary>
GroupId
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.StatisticsIntervalMs">
<summary>
间隔时间
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.SessionTimeoutMs">
<summary>
超时时间
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.LogConfig">
<summary>
审计日志设置
......@@ -1353,67 +1303,6 @@
结果信息 -- 结构体
</summary>
</member>
<member name="T:Junmp.Platform.Common.Utility.ActiveMQContext">
<summary>
ActiveMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopic(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopicAsync(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueue(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueueAsync(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessage(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessageAsync(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.Send(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.AesUtil">
<summary>
AES加解密工具
......@@ -1974,30 +1863,6 @@
<param name="section">节点名称</param>
<param name="path">文件路径</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.KafkaContext">
<summary>
Kafka工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.PublishAsync``1(System.String,``0)">
<summary>
发布消息
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topicName">主题</param>
<param name="message">消息</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.SubscribeAsync``1(System.Collections.Generic.IEnumerable{System.String},System.Action{``0},System.Threading.CancellationToken)">
<summary>
订阅kafka
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topics">主题</param>
<param name="messageFunc">回调函数</param>
<param name="cancellationToken">取消口令</param>
<returns></returns>
</member>
<member name="F:Junmp.Platform.Common.Utility.LoggerContext.logger">
<summary>
ILog实例
......@@ -2173,39 +2038,39 @@
<param name="imagePath"></param>
<returns></returns>
</member>
<member name="T:Junmp.Platform.Common.Utility.RabbitMQContext">
<member name="T:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext">
<summary>
RabbitMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.#ctor">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.#ctor">
<summary>
私有化构造函数
用于单例模式
</summary>
</member>
<member name="F:Junmp.Platform.Common.Utility.RabbitMQContext.LazyConnection">
<member name="F:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.LazyConnection">
<summary>
Lazy对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.ConnectionInstance">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.ConnectionInstance">
<summary>
单例对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.IsConnectionInstanceCreated">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.IsConnectionInstanceCreated">
<summary>
是否已创建
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessage(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessage(System.String)">
<summary>
发送消息
</summary>
<param name="message">消息体</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessageAsynce(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessageAsynce(System.String)">
<summary>
异步发送消息
</summary>
......
7ef28fbbb552f34213f5cf9c01a59a356f419cad
cff537b1491377c43bf7826d707de1cdddafaa2d
//-----------------------------------------------------------------------
// <Copyright file="BizAccountService.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: BizAccountService.cs
// * History : Created by Admin 03/14/2022 09:21:40
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessAccountRepository;
using Junmp.Platform.Service.Base;
namespace Admin.Net.Service.BusinessService.BusinessModule.BusinessAccountService
{
/// <summary>
/// BizAccount业务层实现
/// </summary>
public class BizAccountService : AdminBaseService<BizAccount>, IBizAccountService
{
#region 属性及构造函数
/// <summary>
/// 仓储实例
/// </summary>
private readonly IBizAccountRepository BizAccountRepository;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="BizAccountRepository"></param>
public BizAccountService(IBizAccountRepository BizAccountRepository) : base(BizAccountRepository)
{
this.BizAccountRepository = BizAccountRepository;
}
#endregion
}
}
//-----------------------------------------------------------------------
// <Copyright file="IBizAccountService.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: IBizAccountService.cs
// * History : Created by Admin 03/14/2022 09:21:40
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Service.Base;
namespace Admin.Net.Service.BusinessService.BusinessModule.BusinessAccountService
{
/// <summary>
/// BizAccount业务层接口
/// </summary>
public interface IBizAccountService : IAdminBaseService<BizAccount>
{
}
}
//-----------------------------------------------------------------------
// <Copyright file="BizModuleService.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: BizModuleService.cs
// * History : Created by Admin 01/21/2022 13:40:04
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessModuleRepository;
using Junmp.Platform.Service.Base;
namespace Admin.Net.Service.BusinessService.BusinessModule.BusinessModuleService
{
/// <summary>
/// BizModule业务层实现
/// </summary>
public class BizModuleService : AdminBaseService<BizModule>, IBizModuleService
{
/// <summary>
/// 仓储实例
/// </summary>
private readonly IBizModuleRepository BizModuleRepository;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="BizModuleRepository"></param>
public BizModuleService(IBizModuleRepository BizModuleRepository) : base(BizModuleRepository)
{
this.BizModuleRepository = BizModuleRepository;
}
}
}
//-----------------------------------------------------------------------
// <Copyright file="IBizModuleService.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: IBizModuleService.cs
// * History : Created by Admin 01/21/2022 13:40:04
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Service.Base;
namespace Admin.Net.Service.BusinessService.BusinessModule.BusinessModuleService
{
/// <summary>
/// BizModule业务层接口
/// </summary>
public interface IBizModuleService : IAdminBaseService<BizModule>
{
}
}
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessAccountRepository;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessModuleRepository;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserModuleRepository;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserRepository;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessModuleRepository;
using Admin.Net.Repository.BusinessRepository.RedisRepository;
using Admin.Net.Service.BusinessService.BusinessModule.BusinessUserModuleService;
using AutoMapper;
using Junmp.Platform.Common.Tools;
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
......
//-----------------------------------------------------------------------
// <Copyright file="BizUserModuleService.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: BizUserModuleService.cs
// * History : Created by Admin 01/21/2022 13:40:04
// </Copyright>
//-----------------------------------------------------------------------
using AutoMapper;
using Microsoft.AspNetCore.Http;
using Junmp.Platform.Common.Class.Exceptions;
using Junmp.Platform.Common.Global;
using Junmp.Platform.Common.Utility;
using Junmp.Platform.Entity.BusinessDTO.BusinessModule;
using Junmp.Platform.Entity.BusinessDTO.SystemManagement;
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Entity.BusinessEntity.SystemManagement;
using Junmp.Platform.Entity.BusinessEnum;
using Junmp.Platform.Entity.CoreEntity;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessAccountRepository;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessModuleRepository;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserModuleRepository;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserRepository;
using Admin.Net.Repository.BusinessRepository.RedisRepository;
using Junmp.Platform.Service.Base;
using Admin.Net.Service.BusinessService.SystemManagement.LogService;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Junmp.Platform.Entity.CoreEnum;
namespace Admin.Net.Service.BusinessService.BusinessModule.BusinessUserModuleService
{
/// <summary>
/// BizUserModule业务层实现
/// </summary>
public class BizUserModuleService : AdminBaseService<BizUserModule>, IBizUserModuleService
{
#region 属性及构造函数
/// <summary>
/// 仓储实例
/// </summary>
private readonly IBizUserModuleRepository BizUserModuleRepository;
/// <summary>
/// HttpContext
/// </summary>
private readonly IHttpContextAccessor context;
/// <summary>
/// Redis仓储实例
/// </summary>
private readonly IRedisRepository redisRepository;
/// <summary>
/// 模块仓储
/// </summary>
private readonly IBizModuleRepository BizModuleRepository;
/// <summary>
/// 业务用户仓储
/// </summary>
private readonly IBizUserRepository BizUserRepository;
/// <summary>
/// 同步账号仓储
/// </summary>
private readonly IBizAccountRepository BizAccountRepository;
/// <summary>
/// AutoMapper实例
/// </summary>
private readonly IMapper mapper;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="BizUserModuleRepository"></param>
/// <param name="context"></param>
/// <param name="redisRepository"></param>
/// <param name="BizModuleRepository"></param>
/// <param name="BizUserRepository"></param>
/// <param name="BizAccountRepository"></param>
/// <param name="mapper"></param>
public BizUserModuleService(IBizUserModuleRepository BizUserModuleRepository,
IHttpContextAccessor context,
IRedisRepository redisRepository,
IBizModuleRepository BizModuleRepository,
IBizUserRepository BizUserRepository,
IBizAccountRepository BizAccountRepository,
IMapper mapper) : base(BizUserModuleRepository)
{
this.BizUserModuleRepository = BizUserModuleRepository;
this.context = context;
this.redisRepository = redisRepository;
this.BizModuleRepository = BizModuleRepository;
this.BizUserRepository = BizUserRepository;
this.BizAccountRepository = BizAccountRepository;
this.mapper = mapper;
}
#endregion
#region 获取用户模块
/// <summary>
/// 获取用户模块
/// </summary>
/// <param name="userId"></param>
/// <param name="moduleId"></param>
/// <returns>用户模块对象</returns>
public async Task<BizUserModule> GetBizUserModule(Guid userId, Guid moduleId)
{
var queryCondition = new QueryCondition();
queryCondition.QueryItems = new List<QueryItem>();
queryCondition.QueryItems.Add(new QueryItem()
{
Field = "USER_ID",
Value = userId,
QueryMethod = QueryMethod.Equal,
DataType = DataType.Guid
});
queryCondition.QueryItems.Add(new QueryItem()
{
Field = "MODULE_ID",
Value = moduleId,
QueryMethod = QueryMethod.Equal,
DataType = DataType.Guid
});
RefAsync<int> totalCount = 0;
var userModule = (await this.BizUserModuleRepository.SqlQueryAsync(queryCondition, "sqls:sql:query_biz_user_module", totalCount)).FirstOrDefault();
return userModule;
}
#endregion
}
}
//-----------------------------------------------------------------------
// <Copyright file="IBizUserModuleService.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: IBizUserModuleService.cs
// * History : Created by Admin 01/21/2022 13:40:04
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessDTO.SystemManagement;
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Entity.CoreEntity;
using Junmp.Platform.Service.Base;
using System;
using System.Threading.Tasks;
namespace Admin.Net.Service.BusinessService.BusinessModule.BusinessUserModuleService
{
/// <summary>
/// BizUserModule业务层接口
/// </summary>
public interface IBizUserModuleService : IAdminBaseService<BizUserModule>
{
}
}
//-----------------------------------------------------------------------
// <Copyright file="BizUserService.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: BizUserService.cs
// * History : Created by Admin 01/21/2022 13:40:04
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Entity.CoreEntity;
using Admin.Net.Repository.BusinessRepository.BusinessModule.BusinessUserRepository;
using Junmp.Platform.Service.Base;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Junmp.Platform.Entity.CoreEnum;
namespace Admin.Net.Service.BusinessService.BusinessModule.BusinessUserService
{
/// <summary>
/// BizUser业务层实现
/// </summary>
public class BizUserService : AdminBaseService<BizUser>, IBizUserService
{
#region 属性及其构造函数
/// <summary>
/// 仓储实例
/// </summary>
private readonly IBizUserRepository BizUserRepository;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="BizUserRepository"></param>
public BizUserService(IBizUserRepository BizUserRepository) : base(BizUserRepository)
{
this.BizUserRepository = BizUserRepository;
}
#endregion
#region 获取业务用户
/// <summary>
/// 获取业务用户
/// </summary>
/// <param name="moduleShortName">模块短名</param>
/// <param name="logonName">登陆账号</param>
/// <returns>业务用户</returns>
public async Task<BizUser> GetBizUser(String moduleShortName, String logonName)
{
var queryCondition = new QueryCondition();
queryCondition.QueryItems = new List<QueryItem>();
queryCondition.QueryItems.Add(new QueryItem()
{
Field = "USER_LOGON_NAME",
DataType = DataType.String,
Value = String.Join('_', moduleShortName, logonName),
QueryMethod = QueryMethod.Like
});
RefAsync<int> totalCount = 0;
var user = (await this.BizUserRepository.SqlQueryAsync(queryCondition, "sqls:sql:query_biz_user", totalCount)).FirstOrDefault();
return user;
}
#endregion
#region 获取业务用户
#endregion
}
}
//-----------------------------------------------------------------------
// <Copyright file="IBizUserService.cs" company="Admin">
// * Copyright (C) 2022 Admin All Rights Reserved
// * Version : 4.0.30319.42000
// * Author : auto generated by Admin T4 Template
// * FileName: IBizUserService.cs
// * History : Created by Admin 01/21/2022 13:40:04
// </Copyright>
//-----------------------------------------------------------------------
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
using Junmp.Platform.Service.Base;
using System;
using System.Threading.Tasks;
namespace Admin.Net.Service.BusinessService.BusinessModule.BusinessUserService
{
/// <summary>
/// BizUser业务层接口
/// </summary>
public interface IBizUserService : IAdminBaseService<BizUser>
{
/// <summary>
/// 获取业务用户
/// </summary>
/// <param name="moduleShortName">模块短名</param>
/// <param name="logonName">登陆账号</param>
/// <returns>业务用户</returns>
Task<BizUser> GetBizUser(String moduleShortName, String logonName);
}
}
......@@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace Admin.Net.Service.BusinessService.MQService
{
/// <summary>
/// ActiveMQ服务接口
/// RabbitMQ服务接口
/// </summary>
public interface IMQService
{
......
......@@ -13,7 +13,7 @@ using System.Web;
namespace Admin.Net.Service.BusinessService.MQService
{
/// <summary>
/// ActiveMQ服务
/// RabbitMQ服务
/// </summary>
public class MQService : IMQService
{
......
......@@ -125,7 +125,7 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.LogService
/// <returns>审计日志对象</returns>
public static SysLog GetSysLog(HttpContext httpContext)
{
var token = httpContext.GetToken();
//var token = httpContext.GetToken();
//获取用户
//var user = RedisContext.Get<SysUserDTO>(token);
......
......@@ -198,24 +198,9 @@
<param name="message">异常信息</param>
<param name="innerException">内部异常</param>
</member>
<member name="T:Junmp.Platform.Common.Global.ActiveMQConfig">
<member name="T:Junmp.Platform.Common.Class.RabbitMQ.MqConfigInfo">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.ConnectionString">
<summary>
ActiveMQ连接串
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.TopicName">
<summary>
主题名称
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.QueueName">
<summary>
队列名称
RabbitMQ 客户端定义。
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.AdminGlobalContext">
......@@ -243,11 +228,6 @@
Redis配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.ActiveMQConfig">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.JwtSettings">
<summary>
Jwt配置
......@@ -343,11 +323,6 @@
Cap分布式事务配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.SignalRConfig">
<summary>
SignalR配置
......@@ -744,31 +719,6 @@
token有效时间(分钟)
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.BootstrapServers">
<summary>
地址
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.GroupId">
<summary>
GroupId
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.StatisticsIntervalMs">
<summary>
间隔时间
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.SessionTimeoutMs">
<summary>
超时时间
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.LogConfig">
<summary>
审计日志设置
......@@ -1353,67 +1303,6 @@
结果信息 -- 结构体
</summary>
</member>
<member name="T:Junmp.Platform.Common.Utility.ActiveMQContext">
<summary>
ActiveMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopic(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopicAsync(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueue(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueueAsync(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessage(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessageAsync(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.Send(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.AesUtil">
<summary>
AES加解密工具
......@@ -1974,30 +1863,6 @@
<param name="section">节点名称</param>
<param name="path">文件路径</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.KafkaContext">
<summary>
Kafka工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.PublishAsync``1(System.String,``0)">
<summary>
发布消息
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topicName">主题</param>
<param name="message">消息</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.SubscribeAsync``1(System.Collections.Generic.IEnumerable{System.String},System.Action{``0},System.Threading.CancellationToken)">
<summary>
订阅kafka
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topics">主题</param>
<param name="messageFunc">回调函数</param>
<param name="cancellationToken">取消口令</param>
<returns></returns>
</member>
<member name="F:Junmp.Platform.Common.Utility.LoggerContext.logger">
<summary>
ILog实例
......@@ -2173,39 +2038,39 @@
<param name="imagePath"></param>
<returns></returns>
</member>
<member name="T:Junmp.Platform.Common.Utility.RabbitMQContext">
<member name="T:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext">
<summary>
RabbitMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.#ctor">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.#ctor">
<summary>
私有化构造函数
用于单例模式
</summary>
</member>
<member name="F:Junmp.Platform.Common.Utility.RabbitMQContext.LazyConnection">
<member name="F:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.LazyConnection">
<summary>
Lazy对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.ConnectionInstance">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.ConnectionInstance">
<summary>
单例对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.IsConnectionInstanceCreated">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.IsConnectionInstanceCreated">
<summary>
是否已创建
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessage(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessage(System.String)">
<summary>
发送消息
</summary>
<param name="message">消息体</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessageAsynce(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessageAsynce(System.String)">
<summary>
异步发送消息
</summary>
......
ca8d9b2b40ed921f64ebe03d0d44a6239190784c
630a5b0bfaa9212f4be4a5a5396d1fd39841be9d
......@@ -49,7 +49,7 @@ namespace Admin.Net.WebApi.AppCode.ActionFilters
return;
}
var token = context.HttpContext.GetToken();
//var token = context.HttpContext.GetToken();
//获取用户
//var user = RedisContext.Get<SysUserDTO>(token);
//if (user == null)
......
using Admin.Net.Common.Class.CaptchaPicture;
using Admin.Net.Service.BusinessService.BusinessModule.BusinessModuleService;
using Admin.Net.Service.BusinessService.BusinessModule.BusinessUserModuleService;
using Admin.Net.Service.BusinessService.BusinessModule.BusinessUserService;
using Admin.Net.Service.BusinessService.RedisService;
using Admin.Net.WebApi.AppCode.ActionFilters;
using Junmp.Platform.Entity.BusinessEntity.BusinessModule;
......@@ -24,6 +21,7 @@ using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Junmp.Platform.WebApi.AppCode.FrameworkBase;
using Admin.Net.Service.BusinessService.MQService;
namespace Junmp.Platform.WebApi.Controllers.BusinessModule
{
......@@ -39,11 +37,15 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule
/// 业务模块接口实例
/// </summary>
private readonly IBizTestService BizTestService;
/// <summary>
/// 消息队列接口实例
/// </summary>
private readonly IMQService MQService;
/// <summary>
/// HttpContext
/// </summary>
private readonly IHttpContextAccessor context;
/// <summary>
/// HttpContext
/// </summary>
private readonly IHttpContextAccessor context;
/// <summary>
......@@ -51,43 +53,56 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule
/// </summary>
/// <param name="context"></param>
public BizTestController(IBizTestService BizTestService,
IMQService MQService,
IHttpContextAccessor context
) : base(BizTestService)
{
this.context = context;
this.BizTestService = BizTestService;
this.MQService = MQService;
}
#endregion
#endregion
#region 查询
#region 测试用
/// <summary>
/// 查询离态用户列表
/// </summary>
/// <param name="queryCondition">查询条件</param>
/// <returns>ActionResult</returns>
[HttpPost]
/// <summary>
/// 测试用
/// </summary>
/// <param name="queryCondition">查询条件</param>
/// <returns>ActionResult</returns>
[HttpPost]
[Log(OperationType.QueryList)]
[Permission("user:nonmodule:list")]
public async Task<IActionResult> Post(JObject jdata)
public async Task<IActionResult> Post(JObject data)
{
var entity = JsonManager.GetJsonEntity(jdata);
var entity = JsonManager.GetJsonEntity(data);
var actionResult = await this.BizTestService.GetJunmpListAsync();
return Ok(actionResult);
//return JsonManager.ReturnSuccessResponse(dataList);
return Ok(actionResult);
}
#endregion
#region Mq消息队列使用
/// <summary>
/// Mq消息队列使用
/// </summary>
/// <returns>ActionResult</returns>
[HttpPost]
[Log(OperationType.QueryList)]
[Permission("user:nonmodule:list")]
public async Task<IActionResult> MQTest(String jdata)
{
MQService.SendQueue(jdata);
return Ok();
}
#endregion
#endregion
}
}
......@@ -693,12 +693,17 @@
业务模块接口实例
</summary>
</member>
<member name="F:Junmp.Platform.WebApi.Controllers.BusinessModule.BizTestController.MQService">
<summary>
消息队列接口实例
</summary>
</member>
<member name="F:Junmp.Platform.WebApi.Controllers.BusinessModule.BizTestController.context">
<summary>
HttpContext
</summary>
</member>
<member name="M:Junmp.Platform.WebApi.Controllers.BusinessModule.BizTestController.#ctor(Junmp.Platform.Service.BusinessService.BusinessModule.BusinessTestService.IBizTestService,Microsoft.AspNetCore.Http.IHttpContextAccessor)">
<member name="M:Junmp.Platform.WebApi.Controllers.BusinessModule.BizTestController.#ctor(Junmp.Platform.Service.BusinessService.BusinessModule.BusinessTestService.IBizTestService,Admin.Net.Service.BusinessService.MQService.IMQService,Microsoft.AspNetCore.Http.IHttpContextAccessor)">
<summary>
构造函数
</summary>
......@@ -706,10 +711,16 @@
</member>
<member name="M:Junmp.Platform.WebApi.Controllers.BusinessModule.BizTestController.Post(Newtonsoft.Json.Linq.JObject)">
<summary>
查询离态用户列表
测试用
</summary>
<param name="queryCondition">查询条件</param>
<returns>ActionResult</returns>
</member>
<member name="M:Junmp.Platform.WebApi.Controllers.BusinessModule.BizTestController.MQTest(System.String)">
<summary>
Mq消息队列使用
</summary>
<returns>ActionResult</returns>
</member>
</members>
</doc>
......@@ -34,6 +34,7 @@ using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Junmp.Platform.Common.Utility.RabbitMQ;
namespace Admin.Net.WebApi
{
......@@ -195,6 +196,10 @@ namespace Admin.Net.WebApi
services.AddHostedService<DistributedMessageSubscriber>();
#endregion
#region 注册RabbitMQ消费者
services.AddHostedService<RabbitMQCustomContext>();
#endregion
#region 注册MiniProfiler性能分析组件
......@@ -256,11 +261,7 @@ namespace Admin.Net.WebApi
rabbitMq.Password = AdminGlobalContext.RabbitMQConfig.Password;
});
}
else if (AdminGlobalContext.CapConfig.CapMqType == 1)
{
//使用Kafka
x.UseKafka(AdminGlobalContext.KafkaConfig.BootstrapServers);
}
else if (AdminGlobalContext.CapConfig.CapMqType == 2)
{
//使用Redis
......@@ -442,7 +443,6 @@ namespace Admin.Net.WebApi
AdminGlobalContext.SystemConfig = Configuration.GetSection("SystemConfig").Get<SystemConfig>();
AdminGlobalContext.Configuration = Configuration;
AdminGlobalContext.RedisConfig = Configuration.GetSection("RedisConfig").Get<RedisConfig>();
AdminGlobalContext.ActiveMQConfig = Configuration.GetSection("ActiveMQConfig").Get<ActiveMQConfig>();
AdminGlobalContext.LogConfig = Configuration.GetSection("LogConfig").Get<LogConfig>();
AdminGlobalContext.MailConfig = Configuration.GetSection("MailConfig").Get<MailConfig>();
......@@ -462,7 +462,6 @@ namespace Admin.Net.WebApi
AdminGlobalContext.RateLimitConfig = Configuration.GetSection("RateLimitConfig").Get<RateLimitConfig>();
AdminGlobalContext.MiniProfilerConfig = Configuration.GetSection("MiniProfilerConfig").Get<MiniProfilerConfig>();
AdminGlobalContext.CapConfig = Configuration.GetSection("CapConfig").Get<CapConfig>();
AdminGlobalContext.KafkaConfig = Configuration.GetSection("KafkaConfig").Get<KafkaConfig>();
AdminGlobalContext.SignalRConfig = Configuration.GetSection("SignalRConfig").Get<SignalRConfig>();
AdminGlobalContext.CodeGeneratorConfig = Configuration.GetSection("CodeGeneratorConfig").Get<CodeGeneratorConfig>();
AdminGlobalContext.MeilisearchConfig = Configuration.GetSection("MeilisearchConfig").Get<MeilisearchConfig>();
......
......@@ -72,24 +72,15 @@
//message-oriented middleware
//消息中间件配置
"MomConfig": {
//消息中间件类型,0:ActiveMQ,1:RabbitMQ
"MomType": 0
},
//ActiveMQ配置
"ActiveMQConfig": {
//连接串
"ConnectionString": "activemq:failover:(tcp://localhost:61616)?randomize=false&initialReconnectDelay=100",
//默认主题名称
"TopicName": "Admin.ActiveMQ.Topic.Message",
//默认队列名称
"QueueName": "Admin.ActiveMQ.Queue.Message"
//消息中间件类,1:RabbitMQ
"MomType": 1
},
//RabbitMQ配置
"RabbitMQConfig": {
//用户名
"UserName": "guest",
"UserName": "admin",
//密码
"Password": "guest",
"Password": "1111",
//ip地址,多个时以英文“,”分割
"HostName": "localhost",
//端口
......@@ -102,11 +93,11 @@
//审计日志配置
"LogConfig": {
//是否启用
"IsEnabled": false,
"IsEnabled": true,
//审计日志分表采集年份(近三年)
"SplitTableYearTake": 3,
//是否支持MongoDB
"SupportMongoDB": true,
"SupportMongoDB": false,
//是否支持Elasticsearch
"SupportElasticsearch": false,
//是否支持Meilisearch
......@@ -295,7 +286,7 @@
//表名前缀
"TableNamePrefix": "Admin.Cap",
//MQ类型:RabbitMQ=0,Kafka=1,Redis=2
"CapMqType": 2,
"CapMqType": 0,
//当前节点主机名称
"CurrentNodeHostName": "Admin.Cap.Discovery",
//节点编号
......@@ -303,17 +294,6 @@
//节点名称
"NodeName": "Admin.Cap.Discovery.001"
},
//Kafka配置
"KafkaConfig": {
//地址
"BootstrapServers": "localhost:9092",
//GroupId
"GroupId": "AdminKafkaConsumer",
//间隔时间
"StatisticsIntervalMs": 5010,
//超时时间
"SessionTimeoutMs": 6000
},
//SignalR配置
"SignalRConfig": {
//是否启用
......
......@@ -198,24 +198,9 @@
<param name="message">异常信息</param>
<param name="innerException">内部异常</param>
</member>
<member name="T:Junmp.Platform.Common.Global.ActiveMQConfig">
<member name="T:Junmp.Platform.Common.Class.RabbitMQ.MqConfigInfo">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.ConnectionString">
<summary>
ActiveMQ连接串
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.TopicName">
<summary>
主题名称
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.ActiveMQConfig.QueueName">
<summary>
队列名称
RabbitMQ 客户端定义。
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.AdminGlobalContext">
......@@ -243,11 +228,6 @@
Redis配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.ActiveMQConfig">
<summary>
ActiveMQ配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.JwtSettings">
<summary>
Jwt配置
......@@ -343,11 +323,6 @@
Cap分布式事务配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.AdminGlobalContext.SignalRConfig">
<summary>
SignalR配置
......@@ -744,31 +719,6 @@
token有效时间(分钟)
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.KafkaConfig">
<summary>
Kafka配置
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.BootstrapServers">
<summary>
地址
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.GroupId">
<summary>
GroupId
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.StatisticsIntervalMs">
<summary>
间隔时间
</summary>
</member>
<member name="P:Junmp.Platform.Common.Global.KafkaConfig.SessionTimeoutMs">
<summary>
超时时间
</summary>
</member>
<member name="T:Junmp.Platform.Common.Global.LogConfig">
<summary>
审计日志设置
......@@ -1353,67 +1303,6 @@
结果信息 -- 结构体
</summary>
</member>
<member name="T:Junmp.Platform.Common.Utility.ActiveMQContext">
<summary>
ActiveMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopic(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendTopicAsync(System.String,System.String)">
<summary>
发送Topic
</summary>
<param name="message">消息</param>
<param name="topicName">topic别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueue(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendQueueAsync(System.String,System.String)">
<summary>
发送Queue
</summary>
<param name="message">消息</param>
<param name="queueName">queue别名</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessage(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.SendMessageAsync(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.ActiveMQContext.Send(System.String,System.String,System.String)">
<summary>
发送消息
</summary>
<param name="type">消息类型</param>
<param name="message">消息</param>
<param name="tqName">别名</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.AesUtil">
<summary>
AES加解密工具
......@@ -1974,30 +1863,6 @@
<param name="section">节点名称</param>
<param name="path">文件路径</param>
</member>
<member name="T:Junmp.Platform.Common.Utility.KafkaContext">
<summary>
Kafka工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.PublishAsync``1(System.String,``0)">
<summary>
发布消息
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topicName">主题</param>
<param name="message">消息</param>
<returns></returns>
</member>
<member name="M:Junmp.Platform.Common.Utility.KafkaContext.SubscribeAsync``1(System.Collections.Generic.IEnumerable{System.String},System.Action{``0},System.Threading.CancellationToken)">
<summary>
订阅kafka
</summary>
<typeparam name="TMessage">消息类型</typeparam>
<param name="topics">主题</param>
<param name="messageFunc">回调函数</param>
<param name="cancellationToken">取消口令</param>
<returns></returns>
</member>
<member name="F:Junmp.Platform.Common.Utility.LoggerContext.logger">
<summary>
ILog实例
......@@ -2173,39 +2038,39 @@
<param name="imagePath"></param>
<returns></returns>
</member>
<member name="T:Junmp.Platform.Common.Utility.RabbitMQContext">
<member name="T:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext">
<summary>
RabbitMQ工具类
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.#ctor">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.#ctor">
<summary>
私有化构造函数
用于单例模式
</summary>
</member>
<member name="F:Junmp.Platform.Common.Utility.RabbitMQContext.LazyConnection">
<member name="F:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.LazyConnection">
<summary>
Lazy对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.ConnectionInstance">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.ConnectionInstance">
<summary>
单例对象
</summary>
</member>
<member name="P:Junmp.Platform.Common.Utility.RabbitMQContext.IsConnectionInstanceCreated">
<member name="P:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.IsConnectionInstanceCreated">
<summary>
是否已创建
</summary>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessage(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessage(System.String)">
<summary>
发送消息
</summary>
<param name="message">消息体</param>
</member>
<member name="M:Junmp.Platform.Common.Utility.RabbitMQContext.SendMessageAsynce(System.String)">
<member name="M:Junmp.Platform.Common.Utility.RabbitMQ.RabbitMQContext.SendMessageAsynce(System.String)">
<summary>
异步发送消息
</summary>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论