提交.Net6版本
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 使用Consul时需要配置
|
||||
/// </summary>
|
||||
public class ConsulClientOption
|
||||
{
|
||||
public string IP { get; set; }
|
||||
public int Port { get; set; }
|
||||
public string Datacenter { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
public class ConsulRegisterOption
|
||||
{
|
||||
/// <summary>
|
||||
/// 服务自身IP
|
||||
/// </summary>
|
||||
public string IP { get; set; }
|
||||
/// <summary>
|
||||
/// 服务自身Port
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
/// <summary>
|
||||
/// 组名称
|
||||
/// </summary>
|
||||
public string GroupName { get; set; }
|
||||
/// <summary>
|
||||
/// 心跳检查地址
|
||||
/// </summary>
|
||||
public string HealthCheckUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 心跳频率
|
||||
/// </summary>
|
||||
public int Interval { get; set; }
|
||||
/// <summary>
|
||||
/// 心跳超时
|
||||
/// </summary>
|
||||
public int Timeout { get; set; }
|
||||
/// <summary>
|
||||
/// 移除延迟时间
|
||||
/// </summary>
|
||||
public int DeregisterCriticalServiceAfter { get; set; }
|
||||
/// <summary>
|
||||
/// 标签,额外信息,用于权重
|
||||
/// </summary>
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
public class ElasticSearchOptions
|
||||
{
|
||||
public string Url { get; set; }
|
||||
public string IndexName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
public class JWTTokenOptions
|
||||
{
|
||||
public string Audience
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public string SecurityKey
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
//public SigningCredentials Credentials
|
||||
//{
|
||||
// get;
|
||||
// set;
|
||||
//}
|
||||
public string Issuer
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
public class KafkaOptions
|
||||
{
|
||||
public string BrokerList { get; set; }
|
||||
public string TopicName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
public class DbConnOptions
|
||||
{
|
||||
public string WriteUrl { get; set; }
|
||||
public List<string> ReadUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
public class RabbitMQOptions
|
||||
{
|
||||
///// <summary>
|
||||
///// exchange---queue
|
||||
///// </summary>
|
||||
//private static Dictionary<string, string> RabbitMQ_Mapping = new Dictionary<string, string>();
|
||||
//private static readonly object RabbitMQOptions_Lock = new object();
|
||||
//public void Init(string exchangeName, string queueName)
|
||||
//{
|
||||
// lock (RabbitMQOptions_Lock)
|
||||
// {
|
||||
// RabbitMQ_Mapping[exchangeName] = queueName;
|
||||
// }
|
||||
//}
|
||||
|
||||
public string HostName { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
||||
public int Port { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class RabbitMQConsumerModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产者指定,交换机
|
||||
/// </summary>
|
||||
public string ExchangeName { get; set; }
|
||||
/// <summary>
|
||||
/// 自己起的名字
|
||||
/// </summary>
|
||||
public string QueueName { get; set; }
|
||||
}
|
||||
|
||||
public class RabbitMQExchangeQueueName
|
||||
{
|
||||
public static readonly string SKUCQRS_Exchange = "Zhaoxi.MSACormmerce.SKUCQRS.Exchange";
|
||||
public static readonly string SKUCQRS_Queue_StaticPage = "Zhaoxi.MSACormmerce.SKUCQRS.Queue.StaticPage";
|
||||
public static readonly string SKUCQRS_Queue_ESIndex = "Zhaoxi.MSACormmerce.SKUCQRS.Queue.ESIndex";
|
||||
|
||||
|
||||
public static readonly string SKUWarmup_Exchange = "Zhaoxi.MSACormmerce.Warmup.Exchange";
|
||||
public static readonly string SKUWarmup_Queue_StaticPage = "Zhaoxi.MSACormmerce.Warmup.Queue.StaticPage";
|
||||
public static readonly string SKUWarmup_Queue_ESIndex = "Zhaoxi.MSACormmerce.Warmup.Queue.ESIndex";
|
||||
|
||||
/// <summary>
|
||||
/// 订单创建后的交换机
|
||||
/// </summary>
|
||||
public static readonly string OrderCreate_Exchange = "Zhaoxi.MSACormmerce.OrderCreate.Exchange";
|
||||
public static readonly string OrderCreate_Queue_CleanCart = "Zhaoxi.MSACormmerce.OrderCreate.Queue.CleanCart";
|
||||
|
||||
/// <summary>
|
||||
/// 订单创建后的交换机,支付状态的
|
||||
/// </summary>
|
||||
public static readonly string OrderPay_Exchange = "Zhaoxi.MSACormmerce.OrderPay.Exchange";
|
||||
public static readonly string OrderPay_Queue_RefreshPay = "Zhaoxi.MSACormmerce.OrderPay.Queue.RefreshPay";
|
||||
|
||||
/// <summary>
|
||||
/// 创建订单后的延时队列配置
|
||||
/// </summary>
|
||||
public static readonly string OrderCreate_Delay_Exchange = "Zhaoxi.MSACormmerce.OrderCreate.DelayExchange";
|
||||
public static readonly string OrderCreate_Delay_Queue_CancelOrder = "Zhaoxi.MSACormmerce.OrderCreate.DelayQueue.CancelOrder";
|
||||
|
||||
/// <summary>
|
||||
/// 秒杀异步的
|
||||
/// </summary>
|
||||
public static readonly string Seckill_Exchange = "Zhaoxi.MSACormmerce.Seckill.Exchange";
|
||||
public static readonly string Seckill_Order_Queue = "Zhaoxi.MSACormmerce.Seckill.Order.Queue";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CAP队列名称
|
||||
/// </summary>
|
||||
public const string Order_Stock_Decrease = "RabbitMQ.MySQL.Order-Stock.Decrease";
|
||||
public const string Order_Stock_Resume = "RabbitMQ.MySQL.Order-Stock.Resume";
|
||||
public const string Stock_Logistics = "RabbitMQ.MySQL.Stock-Logistics";
|
||||
|
||||
public const string Pay_Order_UpdateStatus = "RabbitMQ.MySQL.Pay_Order.UpdateStatus";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
public class RedisConnOptions
|
||||
{
|
||||
public string Host { get; set; }
|
||||
public int DB { get; set; } = 0;
|
||||
public int Prot { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
public class SMSOptions
|
||||
{
|
||||
|
||||
public string ID { get; set; }
|
||||
public string Secret { get; set; }
|
||||
public string Sign { get; set; }
|
||||
public string Template { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.IOCOptions
|
||||
{
|
||||
public class SqliteOptions
|
||||
{
|
||||
public string WriteUrl { get; set; }
|
||||
public List<string> ReadUrl { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user