mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 16:23:26 +08:00
【新增】后端分发优惠券增加按用户组分发的队列功能。
This commit is contained in:
@@ -12,7 +12,12 @@ namespace CoreCms.Net.Core.Config
|
||||
/// </summary>
|
||||
public static class RedisMessageQueueSetup
|
||||
{
|
||||
public static void AddRedisMessageQueueSetup(this IServiceCollection services)
|
||||
/// <summary>
|
||||
/// 接口端消息队列
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public static void AddRedisMessageQueueSetupForApi(this IServiceCollection services)
|
||||
{
|
||||
if (services == null) throw new ArgumentNullException(nameof(services));
|
||||
|
||||
@@ -46,5 +51,34 @@ namespace CoreCms.Net.Core.Config
|
||||
m.ShowLog = false;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 管理端消息队列
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public static void AddRedisMessageQueueSetupForAdmin(this IServiceCollection services)
|
||||
{
|
||||
if (services == null) throw new ArgumentNullException(nameof(services));
|
||||
|
||||
services.AddInitQ(m =>
|
||||
{
|
||||
//没消息时挂起时长(毫秒)
|
||||
m.SuspendTime = 1000;
|
||||
|
||||
//每次消费消息间隔时间(毫秒)
|
||||
m.IntervalTime = 1000;
|
||||
|
||||
//redis服务器地址
|
||||
m.ConnectionString = AppSettingsConstVars.RedisConfigConnectionString;
|
||||
//对应的订阅者类,需要new一个实例对象,当然你也可以传参,比如日志对象
|
||||
m.ListSubscribe = new List<Type>() {
|
||||
typeof(CouponDistributionSubscribe),
|
||||
};
|
||||
//显示日志
|
||||
m.ShowLog = false;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user