add Synapse System

This commit is contained in:
2023-10-20 12:33:18 +08:00
parent 56b5421290
commit ef721b227b
11 changed files with 576 additions and 10 deletions
+17
View File
@@ -52,6 +52,12 @@ namespace SimApi.Configs
/// </summary>
public bool EnableLogger { get; set; } = false;
/// <summary>
/// 是否启用Synapse
/// </summary>
public bool EnableSynapse { get; set; } = false;
/// <summary>
/// Swagger文档相关配置,需要启用 EnableSimApiDoc
/// </summary>
@@ -62,6 +68,17 @@ namespace SimApi.Configs
/// </summary>
public SimApiStorageOptions SimApiStorageOptions { get; set; } = new SimApiStorageOptions();
public SimApiSynapseOptions SimApiSynapseOptions { get; set; } = new SimApiSynapseOptions();
public void ConfigureSimApiSynapse(Action<SimApiSynapseOptions> options = null)
{
options?.Invoke(SimApiSynapseOptions);
}
public void ConfigureSimApiSynapse(SimApiSynapseOptions options)
{
SimApiSynapseOptions = options;
}
public void ConfigureSimApiDoc(Action<SimApiDocOptions> options = null)
{
+30
View File
@@ -0,0 +1,30 @@
namespace SimApi.Configs;
public class SimApiSynapseOptions
{
public string MqHost { get; set; }
public int MqPort { get; set; }
public string MqUser { get; set; }
public string MqPass { get; set; }
public string MqVHost { get; set; } = "/";
public string SysName { get; set; }
public string AppName { get; set; }
public string AppId { get; set; }
public int RpcTimeout { get; set; } = 3;
public ushort EventProcessorNum { get; set; } = 20;
public ushort RpcProcessorNum { get; set; } = 20;
public bool DisableEventClient { get; set; } = false;
public bool DisableRpcClient { get; set; } = false;
}