Commit f100ef9f by 赵剑炜

调整不用的组件和配置文件

parent 8a5a2a2d
...@@ -45,10 +45,6 @@ namespace Junmp.Platform.Common.Global ...@@ -45,10 +45,6 @@ namespace Junmp.Platform.Common.Global
/// </summary> /// </summary>
public static LogConfig LogConfig { get; set; } public static LogConfig LogConfig { get; set; }
/// <summary>
/// Smtp邮件配置
/// </summary>
public static MailConfig MailConfig { get; set; }
/// <summary> /// <summary>
/// 系统目录配置 /// 系统目录配置
...@@ -70,10 +66,6 @@ namespace Junmp.Platform.Common.Global ...@@ -70,10 +66,6 @@ namespace Junmp.Platform.Common.Global
/// </summary> /// </summary>
public static PollyConfig PollyConfig { get; set; } public static PollyConfig PollyConfig { get; set; }
/// <summary>
/// Consul配置
/// </summary>
public static ConsulConfig ConsulConfig { get; set; }
/// <summary> /// <summary>
/// 系统并发配置 /// 系统并发配置
...@@ -100,15 +92,6 @@ namespace Junmp.Platform.Common.Global ...@@ -100,15 +92,6 @@ namespace Junmp.Platform.Common.Global
/// </summary> /// </summary>
public static RabbitMQConfig RabbitMQConfig { get; set; } public static RabbitMQConfig RabbitMQConfig { get; set; }
/// <summary>
/// MongoDB配置
/// </summary>
public static MongoDBConfig MongoDBConfig { get; set; }
/// <summary>
/// Elasticsearch配置
/// </summary>
public static ElasticsearchConfig ElasticsearchConfig { get; set; }
/// <summary> /// <summary>
...@@ -143,16 +126,6 @@ namespace Junmp.Platform.Common.Global ...@@ -143,16 +126,6 @@ namespace Junmp.Platform.Common.Global
/// </summary> /// </summary>
public static MeilisearchConfig MeilisearchConfig { get; set; } public static MeilisearchConfig MeilisearchConfig { get; set; }
/// <summary>
/// Ftp配置
/// </summary>
public static FtpConfig FtpConfig { get; set; }
/// <summary>
/// SshNet配置
/// </summary>
public static SshNetConfig SshNetConfig { get; set; }
/// <summary> /// <summary>
/// 多租户配置 /// 多租户配置
......
//-----------------------------------------------------------------------
// <Copyright>
// * Copyright (C) 2022 Admin All Rights Reserved
// </Copyright>
//-----------------------------------------------------------------------
using System;
namespace Junmp.Platform.Common.Global
{
/// <summary>
/// Consul配置
/// </summary>
public class ConsulConfig
{
/// <summary>
/// 是否启用
/// </summary>
public bool IsEnabled { get; set; }
/// <summary>
/// 服务名称
/// </summary>
public String ServiceName { get; set; }
/// <summary>
/// 服务端口
/// </summary>
public int ServicePort { get; set; }
/// <summary>
/// ConsulIP
/// </summary>
public String ConsulHostIP { get; set; }
/// <summary>
/// ConsulPort
/// </summary>
public int ConsulHostPort { get; set; }
/// <summary>
/// 服务启动至注册时间间隔
/// </summary>
public int DeregisterCriticalServiceAfter { get; set; }
/// <summary>
/// 心跳间隔
/// </summary>
public int Interval { get; set; }
/// <summary>
/// 超时时间
/// </summary>
public int Timeout { get; set; }
}
}
//-----------------------------------------------------------------------
// <Copyright>
// * Copyright (C) 2022 Admin All Rights Reserved
// </Copyright>
//-----------------------------------------------------------------------
using System;
namespace Junmp.Platform.Common.Global
{
/// <summary>
/// Elasticsearch配置
/// </summary>
public class ElasticsearchConfig
{
/// <summary>
/// Elasticsearch URL
/// </summary>
public String Uri { get; set; }
/// <summary>
/// 默认索引
/// </summary>
public String DefaultIndex { get; set; }
/// <summary>
/// 用户名
/// </summary>
public String UserName { get; set; }
/// <summary>
/// 密码
/// </summary>
public String Password { get; set; }
}
}
using Admin.Net.Common.Class.Configs;
namespace Junmp.Platform.Common.Global
{
/// <summary>
/// Ftp配置
/// </summary>
public class FtpConfig : HostBasicConfig
{
}
}
...@@ -27,11 +27,6 @@ namespace Junmp.Platform.Common.Global ...@@ -27,11 +27,6 @@ namespace Junmp.Platform.Common.Global
public bool SupportMongoDB { get; set; } public bool SupportMongoDB { get; set; }
/// <summary> /// <summary>
/// 是否支持Elasticsearch
/// </summary>
public bool SupportElasticsearch { get; set; }
/// <summary>
/// 是否支持Meilisearch /// 是否支持Meilisearch
/// </summary> /// </summary>
public bool SupportMeilisearch { get; set; } public bool SupportMeilisearch { get; set; }
......
//-----------------------------------------------------------------------
// <Copyright>
// * Copyright (C) 2022 Admin All Rights Reserved
// </Copyright>
//-----------------------------------------------------------------------
using System;
namespace Junmp.Platform.Common.Global
{
/// <summary>
/// 邮件配置
/// </summary>
public class MailConfig
{
/// <summary>
/// 主机地址
/// </summary>
public String Host { get; set; }
/// <summary>
/// 端口
/// </summary>
public int? Port { get; set; }
/// <summary>
/// 用户名
/// </summary>
public String UserName { get; set; }
/// <summary>
/// 密码
/// </summary>
public String Password { get; set; }
/// <summary>
/// 发件人地址
/// </summary>
public String SenderAddress { get; set; }
}
}
//-----------------------------------------------------------------------
// <Copyright>
// * Copyright (C) 2022 Admin All Rights Reserved
// </Copyright>
//-----------------------------------------------------------------------
using System;
namespace Junmp.Platform.Common.Global
{
/// <summary>
/// MongoDB配置
/// </summary>
public class MongoDBConfig
{
/// <summary>
/// MongoDB数据库地址
/// </summary>
public String MongoUrl { get; set; }
/// <summary>
/// 默认数据库
/// </summary>
public String MongoDefaultDB { get; set; }
}
}
using Admin.Net.Common.Class.Configs;
namespace Junmp.Platform.Common.Global
{
/// <summary>
/// SshNet配置
/// </summary>
public class SshNetConfig
{
/// <summary>
/// Sftp配置
/// </summary>
public HostBasicConfig SftpConfig { get; set; }
/// <summary>
/// Sftp配置
/// </summary>
public HostBasicConfig SshConfig { get; set; }
/// <summary>
/// Scp配置
/// </summary>
public HostBasicConfig ScpConfig { get; set; }
}
}
using FluentFTP;
using Junmp.Platform.Common.Global;
using System;
namespace Junmp.Platform.Common.Utility
{
/// <summary>
/// Ftp工具类
/// </summary>
public class FtpContext
{
/// <summary>
/// Lazy对象
/// </summary>
private static readonly Lazy<FtpClient> LazyInstance = new Lazy<FtpClient>(() =>
{
var client = new FtpClient(AdminGlobalContext.FtpConfig.Host);
if (!String.IsNullOrEmpty(AdminGlobalContext.FtpConfig.UserName) && !String.IsNullOrEmpty(AdminGlobalContext.FtpConfig.Password))
{
client = new FtpClient(AdminGlobalContext.FtpConfig.Host,
AdminGlobalContext.FtpConfig.UserName,
AdminGlobalContext.FtpConfig.Password
);
}
return client;
});
/// <summary>
/// 单例对象
/// </summary>
public static FtpClient Instance { get { return LazyInstance.Value; } }
/// <summary>
/// 是否已创建
/// </summary>
public static bool IsInstanceCreated { get { return LazyInstance.IsValueCreated; } }
}
}
//-----------------------------------------------------------------------
// <Copyright>
// * Copyright (C) 2022 Admin All Rights Reserved
// </Copyright>
//-----------------------------------------------------------------------
using MongoDB.Driver;
using Junmp.Platform.Common.Global;
using System;
namespace Junmp.Platform.Common.Utility
{
/// <summary>
/// MongoDB工具类
/// </summary>
public static class MongoDBContext
{
/// <summary>
/// Lazy对象
/// </summary>
private static readonly Lazy<MongoClient> LazyInstance = new Lazy<MongoClient>(() =>
{
var client = new MongoClient(AdminGlobalContext.MongoDBConfig.MongoUrl);
return client;
});
/// <summary>
/// 单例对象
/// </summary>
public static MongoClient Instance { get { return LazyInstance.Value; } }
/// <summary>
/// 是否已创建
/// </summary>
public static bool IsInstanceCreated { get { return LazyInstance.IsValueCreated; } }
/// <summary>
/// 获取业务集合
/// </summary>
/// <typeparam name="TDocument">TDocument</typeparam>
/// <param name="mongoClient">mongoClient</param>
/// <param name="collectionName">collectionName</param>
/// <returns>IMongoCollection</returns>
public static IMongoCollection<TDocument> GetBusinessCollection<TDocument>(this MongoClient mongoClient, String collectionName)
{
IMongoDatabase db = mongoClient.GetDatabase(AdminGlobalContext.MongoDBConfig.MongoDefaultDB);
IMongoCollection<TDocument> mongoCollection = db.GetCollection<TDocument>(collectionName);
return mongoCollection;
}
}
}
using Elasticsearch.Net;
using Nest;
using Junmp.Platform.Common.Global;
using System;
using System.Collections.Generic;
namespace Junmp.Platform.Common.Utility
{
/// <summary>
/// ES NEST工具类
/// </summary>
public static class NestContext
{
/// <summary>
/// Lazy对象
/// </summary>
private static readonly Lazy<ElasticClient> LazyInstance = new Lazy<ElasticClient>(() =>
{
if (AdminGlobalContext.ElasticsearchConfig.Uri.Contains(','))
{
var urls = new List<Uri>();
foreach (var item in AdminGlobalContext.ElasticsearchConfig.Uri.Split(','))
{
urls.Add(new Uri(item));
}
//创建连接池
var connectionPool = new SniffingConnectionPool(urls);
//创建连接设置
var settings = new ConnectionSettings(connectionPool);
settings.DefaultIndex(AdminGlobalContext.ElasticsearchConfig.DefaultIndex);
if (!String.IsNullOrEmpty(AdminGlobalContext.ElasticsearchConfig.UserName)
&&
!String.IsNullOrEmpty(AdminGlobalContext.ElasticsearchConfig.Password))
{
settings.BasicAuthentication(AdminGlobalContext.ElasticsearchConfig.UserName,
AdminGlobalContext.ElasticsearchConfig.Password);
}
var elasticClient = new ElasticClient(settings);
return elasticClient;
}
else
{
//创建连接设置
var settings = new ConnectionSettings(new Uri(AdminGlobalContext.ElasticsearchConfig.Uri));
settings.DefaultIndex(AdminGlobalContext.ElasticsearchConfig.DefaultIndex);
if (!String.IsNullOrEmpty(AdminGlobalContext.ElasticsearchConfig.UserName)
&&
!String.IsNullOrEmpty(AdminGlobalContext.ElasticsearchConfig.Password))
{
settings.BasicAuthentication(AdminGlobalContext.ElasticsearchConfig.UserName,
AdminGlobalContext.ElasticsearchConfig.Password);
}
var elasticClient = new ElasticClient(settings);
return elasticClient;
}
});
/// <summary>
/// 单例对象
/// </summary>
public static ElasticClient Instance { get { return LazyInstance.Value; } }
/// <summary>
/// 是否已创建
/// </summary>
public static bool IsInstanceCreated { get { return LazyInstance.IsValueCreated; } }
}
}
...@@ -48,7 +48,7 @@ namespace Junmp.Platform.Common.Utility.RabbitMQ ...@@ -48,7 +48,7 @@ namespace Junmp.Platform.Common.Utility.RabbitMQ
var body = ea.Body.ToArray(); var body = ea.Body.ToArray();
string str = Encoding.UTF8.GetString(body); string str = Encoding.UTF8.GetString(body);
Console.WriteLine("接受到的mq消息:" + str); Console.WriteLine("接受到的mq消息:" + str);
channel.BasicAck(ea.DeliveryTag, false); //channel.BasicAck(ea.DeliveryTag, false);
//Thread.Sleep(1000); //Thread.Sleep(1000);
}; };
......
using Renci.SshNet;
using Junmp.Platform.Common.Global;
using System;
namespace Junmp.Platform.Common.Utility
{
/// <summary>
/// SshNet工具类
/// </summary>
public class SshNetContext
{
/// <summary>
/// SftpClient Lazy对象
/// </summary>
private static readonly Lazy<SftpClient> LazySftpInstance = new Lazy<SftpClient>(() =>
{
var sftpClient = new SftpClient(AdminGlobalContext.SshNetConfig.SftpConfig.Host,
AdminGlobalContext.SshNetConfig.SftpConfig.UserName,
AdminGlobalContext.SshNetConfig.SftpConfig.Password
);
return sftpClient;
});
/// <summary>
/// SftpClient单例对象
/// </summary>
public static SftpClient SftpInstance { get { return LazySftpInstance.Value; } }
/// <summary>
/// SftpClient是否已创建
/// </summary>
public static bool IsSftpInstanceCreated { get { return LazySftpInstance.IsValueCreated; } }
/// <summary>
/// SshClient Lazy对象
/// </summary>
private static readonly Lazy<SshClient> LazySshInstance = new Lazy<SshClient>(() =>
{
var sshClient = new SshClient(AdminGlobalContext.SshNetConfig.SshConfig.Host,
AdminGlobalContext.SshNetConfig.SshConfig.UserName,
AdminGlobalContext.SshNetConfig.SshConfig.Password
);
return sshClient;
});
/// <summary>
/// SshClient单例对象
/// </summary>
public static SshClient SshInstance { get { return LazySshInstance.Value; } }
/// <summary>
/// SshClient是否已创建
/// </summary>
public static bool IsSshInstanceCreated { get { return LazySshInstance.IsValueCreated; } }
/// <summary>
/// ScpClient Lazy对象
/// </summary>
private static readonly Lazy<ScpClient> LazyScpInstance = new Lazy<ScpClient>(() =>
{
var scpClient = new ScpClient(AdminGlobalContext.SshNetConfig.ScpConfig.Host,
AdminGlobalContext.SshNetConfig.ScpConfig.UserName,
AdminGlobalContext.SshNetConfig.ScpConfig.Password
);
return scpClient;
});
/// <summary>
/// ScpClient 单例对象
/// </summary>
public static ScpClient ScpInstance { get { return LazyScpInstance.Value; } }
/// <summary>
/// ScpClient 是否已创建
/// </summary>
public static bool IsScpInstanceCreated { get { return LazyScpInstance.IsValueCreated; } }
}
}
85e9d44ad0200e212aa04866a6fc64a1712f08b0 bf4e9456d281f4e30e4a7c887c0fa59c35fb8191
using MongoDB.Driver;
using System;
namespace Admin.Net.Repository.BusinessRepository.MongoDBRepository
{
/// <summary>
/// MongoDB仓储层接口
/// </summary>
public interface IMongoDBRepository
{
/// <summary>
/// 获取业务集合
/// </summary>
/// <typeparam name="TDocument">TDocument</typeparam>
/// <param name="collectionName">集合名称</param>
/// <returns>业务集合</returns>
IMongoCollection<TDocument> GetBusinessCollection<TDocument>(String collectionName);
/// <summary>
/// 获取MongoClient
/// </summary>
/// <returns>MongoClient</returns>
MongoClient GetMongoDBClient();
}
}
using MongoDB.Driver;
using Junmp.Platform.Common.Utility;
using System;
namespace Admin.Net.Repository.BusinessRepository.MongoDBRepository
{
/// <summary>
/// MongoDB仓储层实现
/// </summary>
public class MongoDBRepository : IMongoDBRepository
{
/// <summary>
/// 获取业务集合
/// </summary>
/// <typeparam name="TDocument">TDocument</typeparam>
/// <param name="collectionName">集合名称</param>
/// <returns>业务集合</returns>
public IMongoCollection<TDocument> GetBusinessCollection<TDocument>(String collectionName)
{
return MongoDBContext.Instance.GetBusinessCollection<TDocument>(collectionName);
}
/// <summary>
/// 获取MongoClient
/// </summary>
/// <returns>MongoClient</returns>
public MongoClient GetMongoDBClient()
{
return MongoDBContext.Instance;
}
}
}
using Nest;
namespace Admin.Net.Repository.BusinessRepository.NestRepository
{
/// <summary>
///
/// </summary>
public interface INestRepository
{
/// <summary>
/// 获取ElasticClient实例
/// </summary>
/// <returns>ElasticClient</returns>
ElasticClient GetElasticClient();
}
}
using Nest;
using Junmp.Platform.Common.Utility;
namespace Admin.Net.Repository.BusinessRepository.NestRepository
{
/// <summary>
///
/// </summary>
public class NestRepository : INestRepository
{
/// <summary>
/// 获取ElasticClient实例
/// </summary>
/// <returns>ElasticClient</returns>
public ElasticClient GetElasticClient()
{
return NestContext.Instance;
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Junmp.Process.Repository</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Junmp.Process.Common\Junmp.Process.Common.csproj" />
<ProjectReference Include="..\Junmp.Process.Entity\Junmp.Process.Entity.csproj" />
</ItemGroup>
</Project>
cff537b1491377c43bf7826d707de1cdddafaa2d 8a3ee68376ec8d88e428b9d7a6ccddfdcc8005bc
using MongoDB.Driver;
using System;
namespace Admin.Net.Service.BusinessService.MongoDBService
{
/// <summary>
/// MongoDB服务层接口
/// </summary>
public interface IMongoDBService
{
/// <summary>
/// 获取业务集合
/// </summary>
/// <typeparam name="TDocument">TDocument</typeparam>
/// <param name="collectionName">集合名称</param>
/// <returns>业务集合</returns>
IMongoCollection<TDocument> GetBusinessCollection<TDocument>(String collectionName);
/// <summary>
/// 获取MongoClient
/// </summary>
/// <returns>MongoClient</returns>
MongoClient GetMongoDBClient();
}
}
using MongoDB.Driver;
using Admin.Net.Repository.BusinessRepository.MongoDBRepository;
using System;
namespace Admin.Net.Service.BusinessService.MongoDBService
{
/// <summary>
/// MongoDB服务层实现
/// </summary>
public class MongoDBService : IMongoDBService
{
/// <summary>
/// MongoDB仓储层实例
/// </summary>
private readonly IMongoDBRepository MongoDBRepository;
public MongoDBService(IMongoDBRepository MongoDBRepository)
{
this.MongoDBRepository = MongoDBRepository;
}
/// <summary>
/// 获取业务集合
/// </summary>
/// <typeparam name="TDocument">TDocument</typeparam>
/// <param name="collectionName">集合名称</param>
/// <returns>业务集合</returns>
public IMongoCollection<TDocument> GetBusinessCollection<TDocument>(String collectionName)
{
return this.MongoDBRepository.GetBusinessCollection<TDocument>(collectionName);
}
/// <summary>
/// 获取MongoClient
/// </summary>
/// <returns>MongoClient</returns>
public MongoClient GetMongoDBClient()
{
return this.MongoDBRepository.GetMongoDBClient();
}
}
}
using Nest;
namespace Admin.Net.Service.BusinessService.NestService
{
/// <summary>
/// Nest服务层接口
/// </summary>
public interface INestService
{
/// <summary>
/// 获取ElasticClient实例
/// </summary>
/// <returns>ElasticClient</returns>
ElasticClient GetElasticClient();
}
}
using Nest;
using Admin.Net.Repository.BusinessRepository.NestRepository;
namespace Admin.Net.Service.BusinessService.NestService
{
/// <summary>
/// Nest服务层实现
/// </summary>
public class NestService : INestService
{
/// <summary>
/// Nest仓储层实例
/// </summary>
private readonly INestRepository NestRepository;
public NestService(INestRepository NestRepository)
{
this.NestRepository = NestRepository;
}
/// <summary>
/// 获取ElasticClient实例
/// </summary>
/// <returns>ElasticClient</returns>
public ElasticClient GetElasticClient()
{
return this.NestRepository.GetElasticClient();
}
}
}
...@@ -80,7 +80,7 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.CodeGeneratorServic ...@@ -80,7 +80,7 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.CodeGeneratorServic
var zipId = Guid.NewGuid(); var zipId = Guid.NewGuid();
var tempPath = AdminGlobalContext.DirectoryConfig.GetTempPath() + "/" + zipId; var tempPath = AdminGlobalContext.DirectoryConfig.GetTempPath() + "/" + zipId;
var entityList = new List<DbSchemaEntity>(); var entityList = new List<DbSchemaEntity>();
var tables= codeGenerator.Tables.Split("/"); var tables = codeGenerator.Tables.Split("/");
foreach (var tableItem in tables) foreach (var tableItem in tables)
{ {
#region 获取元数据信息 #region 获取元数据信息
...@@ -118,7 +118,11 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.CodeGeneratorServic ...@@ -118,7 +118,11 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.CodeGeneratorServic
#endregion #endregion
//补充全路径
//补充全路径
codeGenerator.AutoFillFullName(); codeGenerator.AutoFillFullName();
#region 生成业务文件夹 #region 生成业务文件夹
...@@ -739,9 +743,9 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.CodeGeneratorServic ...@@ -739,9 +743,9 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.CodeGeneratorServic
} }
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
/// <returns>列表</returns> /// <returns>列表</returns>
public async Task<ActionResult> ReturnOK() public async Task<ActionResult> ReturnOK()
{ {
var actionResult = new ActionResult(); var actionResult = new ActionResult();
......
...@@ -41,22 +41,7 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.LogService ...@@ -41,22 +41,7 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.LogService
return; return;
} }
if (AdminGlobalContext.LogConfig.SupportMongoDB) if (AdminGlobalContext.LogConfig.SupportMeilisearch)
{
//审计日志存入MongoDB
IMongoCollection<SysLog> mongoCollection = MongoDBContext.Instance.GetBusinessCollection<SysLog>("SysLog");
await mongoCollection.InsertOneAsync(log);
}
else if (AdminGlobalContext.LogConfig.SupportElasticsearch)
{
//审计日志存入Elasticsearch
var response = await NestContext.Instance.IndexDocumentAsync<SysLog>(log);
if (!response.IsValid)
{
throw new CustomException(response.OriginalException.Message);
}
}
else if (AdminGlobalContext.LogConfig.SupportMeilisearch)
{ {
//审计日志存入Meilisearch //审计日志存入Meilisearch
var index = MeilisearchContext.Instance.GetIndex(); var index = MeilisearchContext.Instance.GetIndex();
...@@ -86,22 +71,7 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.LogService ...@@ -86,22 +71,7 @@ namespace Admin.Net.Service.BusinessService.SystemManagement.LogService
return; return;
} }
if (AdminGlobalContext.LogConfig.SupportMongoDB) if (AdminGlobalContext.LogConfig.SupportMeilisearch)
{
//审计日志存入MongoDB
IMongoCollection<SysLog> mongoCollection = MongoDBContext.Instance.GetBusinessCollection<SysLog>("SysLog");
mongoCollection.InsertOne(log);
}
else if (AdminGlobalContext.LogConfig.SupportElasticsearch)
{
//审计日志存入Elasticsearch
var response = NestContext.Instance.IndexDocument<SysLog>(log);
if (!response.IsValid)
{
throw new CustomException(response.OriginalException.Message);
}
}
else if (AdminGlobalContext.LogConfig.SupportMeilisearch)
{ {
//审计日志存入Meilisearch //审计日志存入Meilisearch
var index = MeilisearchContext.Instance.GetIndex(); var index = MeilisearchContext.Instance.GetIndex();
......
630a5b0bfaa9212f4be4a5a5396d1fd39841be9d 706709274b65c4706daae7ab09d0c7b678e4584f
...@@ -40,7 +40,7 @@ namespace Junmp.Platform.WebApi.AppCode.FrameworkExtensions ...@@ -40,7 +40,7 @@ namespace Junmp.Platform.WebApi.AppCode.FrameworkExtensions
FirstOrDefault(address => address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)?.ToString(); FirstOrDefault(address => address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)?.ToString();
//基址 //基址
c.BaseAddress = new System.Uri($"http://{IP}:{AdminGlobalContext.ConsulConfig.ServicePort}"); //c.BaseAddress = new System.Uri($"http://{IP}:{AdminGlobalContext.ConsulConfig.ServicePort}");
}) })
//降级策略 //降级策略
.AddPolicyHandler(Policy<HttpResponseMessage>.HandleInner<Exception>().FallbackAsync(fallbackResponseMessage, async b => .AddPolicyHandler(Policy<HttpResponseMessage>.HandleInner<Exception>().FallbackAsync(fallbackResponseMessage, async b =>
......
//-----------------------------------------------------------------------
// <Copyright>
// * Copyright (C) 2022 Admin All Rights Reserved
// </Copyright>
//-----------------------------------------------------------------------
using Consul;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using Junmp.Platform.Common.Global;
using System;
using System.Linq;
namespace Junmp.Platform.WebApi.AppCode.FrameworkExtensions
{
public static class RegisterConsulExtensions
{
public static IApplicationBuilder RegisterConsul(this IApplicationBuilder app, IHostApplicationLifetime lifetime)
{
var IP = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).
AddressList.
FirstOrDefault(address => address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)?.
ToString();
//请求注册的 Consul 地址
var consulClient = new ConsulClient(x => x.Address = new Uri($"http://{AdminGlobalContext.ConsulConfig.ConsulHostIP}:{AdminGlobalContext.ConsulConfig.ConsulHostPort}"));
var httpCheck = new AgentServiceCheck()
{
//服务启动多久后注册
DeregisterCriticalServiceAfter = TimeSpan.FromSeconds(AdminGlobalContext.ConsulConfig.DeregisterCriticalServiceAfter),
//健康检查时间间隔,或者称为心跳间隔
Interval = TimeSpan.FromSeconds(AdminGlobalContext.ConsulConfig.Interval),
//健康检查地址
HTTP = $"http://{IP}:{AdminGlobalContext.ConsulConfig.ServicePort}/API/AdminHealth/Get",
Timeout = TimeSpan.FromSeconds(AdminGlobalContext.ConsulConfig.Timeout)
};
var ID = Guid.NewGuid().ToString();
// Register service with consul
var registration = new AgentServiceRegistration()
{
Checks = new[] { httpCheck },
ID = ID,
Name = AdminGlobalContext.ConsulConfig.ServiceName + $"({ID})",
Address = IP,
Port = AdminGlobalContext.ConsulConfig.ServicePort,
//添加 urlprefix-/servicename 格式的 tag 标签,以便 Fabio 识别
Tags = new[] { $"urlprefix-/{AdminGlobalContext.ConsulConfig.ServiceName}" }
};
//服务启动时注册,内部实现其实就是使用 Consul API 进行注册(HttpClient发起)
consulClient.Agent.ServiceRegister(registration).Wait();
lifetime.ApplicationStopping.Register(() =>
{
//服务停止时取消注册
consulClient.Agent.ServiceDeregister(registration.ID).Wait();
});
return app;
}
}
}
...@@ -26,17 +26,17 @@ using Admin.Net.Service.BusinessService.MQService; ...@@ -26,17 +26,17 @@ using Admin.Net.Service.BusinessService.MQService;
namespace Junmp.Platform.WebApi.Controllers.BusinessModule namespace Junmp.Platform.WebApi.Controllers.BusinessModule
{ {
/// <summary>
/// BizUser控制器
/// </summary>
public class BizTestController : AdminBaseController<BizTest>
{
#region 属性及构造函数
/// <summary> /// <summary>
/// BizUser控制器 /// 业务模块接口实例
/// </summary> /// </summary>
public class BizTestController : AdminBaseController<BizTest> private readonly IBizTestService BizTestService;
{
#region 属性及构造函数
/// <summary>
/// 业务模块接口实例
/// </summary>
private readonly IBizTestService BizTestService;
/// <summary> /// <summary>
/// 消息队列接口实例 /// 消息队列接口实例
/// </summary> /// </summary>
...@@ -48,20 +48,20 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule ...@@ -48,20 +48,20 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule
private readonly IHttpContextAccessor context; private readonly IHttpContextAccessor context;
/// <summary> /// <summary>
/// 构造函数 /// 构造函数
/// </summary> /// </summary>
/// <param name="context"></param> /// <param name="context"></param>
public BizTestController(IBizTestService BizTestService, public BizTestController(IBizTestService BizTestService,
IMQService MQService, IMQService MQService,
IHttpContextAccessor context IHttpContextAccessor context
) : base(BizTestService) ) : base(BizTestService)
{ {
this.context = context; this.context = context;
this.BizTestService = BizTestService; this.BizTestService = BizTestService;
this.MQService = MQService; this.MQService = MQService;
} }
#endregion #endregion
...@@ -73,10 +73,10 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule ...@@ -73,10 +73,10 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule
/// <param name="queryCondition">查询条件</param> /// <param name="queryCondition">查询条件</param>
/// <returns>ActionResult</returns> /// <returns>ActionResult</returns>
[HttpPost] [HttpPost]
[Log(OperationType.QueryList)] [Log(OperationType.QueryList)]
[Permission("user:nonmodule:list")] [Permission("user:nonmodule:list")]
public async Task<IActionResult> Post(JObject data) public async Task<IActionResult> Post(JObject data)
{ {
var entity = JsonManager.GetJsonEntity(data); var entity = JsonManager.GetJsonEntity(data);
var actionResult = await this.BizTestService.GetJunmpListAsync(); var actionResult = await this.BizTestService.GetJunmpListAsync();
...@@ -100,14 +100,15 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule ...@@ -100,14 +100,15 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule
MQService.SendQueue(jdata); MQService.SendQueue(jdata);
var actionResult = new Entity.CoreEntity.ActionResult() var actionResult = new Entity.CoreEntity.ActionResult()
{ {
code = ResultCode.OPERATE_FAILED.Code, code = ResultCode.OPERATE_SUCCESS.Code,
msg = ResultCode.OPERATE_FAILED.Msg, msg = ResultCode.OPERATE_SUCCESS.Msg,
data = new String("OK") data = new String("OK")
}; };
return Ok(actionResult); return Ok(actionResult);
} }
#endregion #endregion
#region 直接操作返回成功结果 #region 直接操作返回成功结果
/// <summary> /// <summary>
...@@ -119,18 +120,24 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule ...@@ -119,18 +120,24 @@ namespace Junmp.Platform.WebApi.Controllers.BusinessModule
public async Task<IActionResult> TrueRes(String jdata) public async Task<IActionResult> TrueRes(String jdata)
{ {
var actionResult = new Entity.CoreEntity.ActionResult() return Ok(new Entity.CoreEntity.ActionResult()
{ {
code = ResultCode.OPERATE_SUCCESS.Code, code = ResultCode.OPERATE_SUCCESS.Code,
msg = ResultCode.OPERATE_SUCCESS.Msg, msg = ResultCode.OPERATE_SUCCESS.Msg,
data = new String("OK") data = new String("OK")
}; });
return Ok(actionResult);
} }
#endregion #endregion
} }
} }
...@@ -13,8 +13,6 @@ using Junmp.Platform.Common.Utility; ...@@ -13,8 +13,6 @@ using Junmp.Platform.Common.Utility;
using Junmp.Platform.Entity.BusinessEntity.SystemManagement; using Junmp.Platform.Entity.BusinessEntity.SystemManagement;
using Junmp.Platform.Entity.BusinessEnum; using Junmp.Platform.Entity.BusinessEnum;
using Junmp.Platform.Entity.CoreEntity; using Junmp.Platform.Entity.CoreEntity;
using Admin.Net.Service.BusinessService.MongoDBService;
using Admin.Net.Service.BusinessService.NestService;
using Admin.Net.Service.BusinessService.SystemManagement.LogService; using Admin.Net.Service.BusinessService.SystemManagement.LogService;
using Junmp.Platform.WebApi.AppCode.ActionFilters; using Junmp.Platform.WebApi.AppCode.ActionFilters;
using SqlSugar; using SqlSugar;
...@@ -40,15 +38,7 @@ namespace Junmp.Platform.WebApi.Controllers.SystemManagement ...@@ -40,15 +38,7 @@ namespace Junmp.Platform.WebApi.Controllers.SystemManagement
/// </summary> /// </summary>
private readonly ILogService logService; private readonly ILogService logService;
/// <summary>
/// MongoDB接口实例
/// </summary>
private readonly IMongoDBService MongoDBService;
/// <summary>
/// Nest接口实例
/// </summary>
private readonly INestService NestService;
/// <summary> /// <summary>
/// 构造函数 /// 构造函数
...@@ -56,12 +46,10 @@ namespace Junmp.Platform.WebApi.Controllers.SystemManagement ...@@ -56,12 +46,10 @@ namespace Junmp.Platform.WebApi.Controllers.SystemManagement
/// <param name="logService"></param> /// <param name="logService"></param>
/// <param name="MongoDBService"></param> /// <param name="MongoDBService"></param>
/// <param name="NestService"></param> /// <param name="NestService"></param>
public LogManagementController(ILogService logService, IMongoDBService MongoDBService, public LogManagementController(ILogService logService
INestService NestService) : base(logService) ) : base(logService)
{ {
this.logService = logService; this.logService = logService;
this.MongoDBService = MongoDBService;
this.NestService = NestService;
} }
#endregion #endregion
...@@ -78,80 +66,7 @@ namespace Junmp.Platform.WebApi.Controllers.SystemManagement ...@@ -78,80 +66,7 @@ namespace Junmp.Platform.WebApi.Controllers.SystemManagement
[Permission("log:query:list")] [Permission("log:query:list")]
public async Task<IActionResult> Post([FromBody] QueryCondition queryCondition) public async Task<IActionResult> Post([FromBody] QueryCondition queryCondition)
{ {
if (AdminGlobalContext.LogConfig.SupportElasticsearch)
{
#region Elasticsearch获取审计日志
//**********如果使用keyword从Elasticsearch查询审计日志,请使用以下代码*********************************//
////前端只传递keyword
//var keyword = queryCondition.QueryItems.FirstOrDefault().Value.ToString();
////模糊查询
//var task1 = await EsNestContext.Instance.SearchAsync<SysLog>(s =>
//s.Query(q => q.Match(m => m.Field(f => f.UserName).Query(keyword)) ||
// q.Match(m => m.Field(f => f.OrgName).Query(keyword))||
// q.Match(m => m.Field(f => f.IP).Query(keyword))||
// q.Match(m => m.Field(f => f.OperationType).Query(keyword))||
// q.Match(m => m.Field(f => f.RequestMethod).Query(keyword))||
// q.Match(m => m.Field(f => f.RequestUrl).Query(keyword))||
// q.Match(m => m.Field(f => f.Params).Query(keyword))||
// q.Match(m => m.Field(f => f.NewValue).Query(keyword))||
// q.Match(m => m.Field(f => f.OldValue).Query(keyword)) ||
// q.Match(m => m.Field(f => f.Result).Query(keyword)) ||
// q.Match(m => m.Field(f => f.Remark).Query(keyword))
// )
// );
//var logs1 = task1.Documents.ToList();
//if (!String.IsNullOrEmpty(queryCondition.Sort))
//{
// logs1 = logs1.Sort<SysLog>(queryCondition.Sort);
//}
//logs1 = logs1.Skip(queryCondition.PageIndex * queryCondition.PageSize).Take(queryCondition.PageSize).ToList();
//var actionResult1 = QueryResult<SysLog>.Success((int)task1.Total, logs1);
//return Ok(actionResult1);
//**********如果使用keyword从Elasticsearch查询审计日志,请使用以上代码查询*********************************//
//转化查询条件
var query = queryCondition.ConvertToSearchDescriptor<SysLog>();
//查询Elasticsearch
var searchResponse = await this.NestService.GetElasticClient().SearchAsync<SysLog>(query);
var logs = searchResponse.Documents.ToList();
var actionResult = QueryResult<SysLog>.Success((int)searchResponse.Total, logs);
return Ok(actionResult);
#endregion
}
else if (AdminGlobalContext.LogConfig.SupportMeilisearch)
{
#region Meilisearch获取审计日志
//前端只传递keyword
var keyword = queryCondition.QueryItems.FirstOrDefault().Value.ToString();
var index = MeilisearchContext.Instance.GetIndex();
ISearchable<SysLog> searchResult = await index.SearchAsync<SysLog>(keyword);
var hits = searchResult.Hits.ToList();
if (!String.IsNullOrEmpty(queryCondition.Sort))
{
hits = hits.Sort<SysLog>(queryCondition.Sort);
}
var logs = hits.Skip(queryCondition.PageIndex * queryCondition.PageSize).Take(queryCondition.PageSize).ToList();
var actionResult = QueryResult<SysLog>.Success(hits.Count, logs);
return Ok(actionResult);
#endregion
}
else
{
#region 从关系库获取审计日志 #region 从关系库获取审计日志
var key = "sqls:sql:query_syslog_ms"; var key = "sqls:sql:query_syslog_ms";
...@@ -165,8 +80,8 @@ namespace Junmp.Platform.WebApi.Controllers.SystemManagement ...@@ -165,8 +80,8 @@ namespace Junmp.Platform.WebApi.Controllers.SystemManagement
return Ok(actionResult); return Ok(actionResult);
#endregion #endregion
}
} }
#endregion #endregion
......
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
...@@ -106,6 +106,11 @@ ...@@ -106,6 +106,11 @@
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" /> <PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
<PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.2.22" /> <PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.2.22" />
<PackageReference Include="nacos-sdk-csharp" Version="1.3.4" />
<PackageReference Include="nacos-sdk-csharp.AspNetCore" Version="1.3.4" />
<PackageReference Include="nacos-sdk-csharp.Extensions.Configuration" Version="1.3.4" />
<PackageReference Include="nacos-sdk-csharp.IniParser" Version="1.3.4" />
<PackageReference Include="nacos-sdk-csharp.YamlParser" Version="1.3.4" />
<PackageReference Include="Polly" Version="7.2.3" /> <PackageReference Include="Polly" Version="7.2.3" />
<PackageReference Include="Quartz" Version="3.5.0" /> <PackageReference Include="Quartz" Version="3.5.0" />
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.5.0" /> <PackageReference Include="Quartz.Extensions.Hosting" Version="3.5.0" />
......
...@@ -523,17 +523,7 @@ ...@@ -523,17 +523,7 @@
审计日志接口实例 审计日志接口实例
</summary> </summary>
</member> </member>
<member name="F:Junmp.Platform.WebApi.Controllers.SystemManagement.LogManagementController.MongoDBService"> <member name="M:Junmp.Platform.WebApi.Controllers.SystemManagement.LogManagementController.#ctor(Admin.Net.Service.BusinessService.SystemManagement.LogService.ILogService)">
<summary>
MongoDB接口实例
</summary>
</member>
<member name="F:Junmp.Platform.WebApi.Controllers.SystemManagement.LogManagementController.NestService">
<summary>
Nest接口实例
</summary>
</member>
<member name="M:Junmp.Platform.WebApi.Controllers.SystemManagement.LogManagementController.#ctor(Admin.Net.Service.BusinessService.SystemManagement.LogService.ILogService,Admin.Net.Service.BusinessService.MongoDBService.IMongoDBService,Admin.Net.Service.BusinessService.NestService.INestService)">
<summary> <summary>
构造函数 构造函数
</summary> </summary>
......
...@@ -38,6 +38,7 @@ namespace Junmp.Platform.WebApi ...@@ -38,6 +38,7 @@ namespace Junmp.Platform.WebApi
public static IHostBuilder CreateHostBuilder(string[] args) => public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.UseNacosConfig(section: "Nacos", parser: null, logAction: null)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
#region 配置文件热加载、热更新 #region 配置文件热加载、热更新
......
...@@ -35,6 +35,7 @@ using System.IO; ...@@ -35,6 +35,7 @@ using System.IO;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Junmp.Platform.Common.Utility.RabbitMQ; using Junmp.Platform.Common.Utility.RabbitMQ;
using Nacos.AspNetCore.V2;
namespace Junmp.Platform.WebApi namespace Junmp.Platform.WebApi
{ {
...@@ -59,6 +60,9 @@ namespace Junmp.Platform.WebApi ...@@ -59,6 +60,9 @@ namespace Junmp.Platform.WebApi
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
#region Nacos
services.AddNacosAspNet(Configuration, "nacos");
#endregion
#region 注册AspNetCoreRateLimit组件 #region 注册AspNetCoreRateLimit组件
services.AddDistributedRedisCache(options => services.AddDistributedRedisCache(options =>
...@@ -143,8 +147,6 @@ namespace Junmp.Platform.WebApi ...@@ -143,8 +147,6 @@ namespace Junmp.Platform.WebApi
#endregion #endregion
#region 注册系统全局并发策略 #region 注册系统全局并发策略
services.AddQueuePolicy(options => services.AddQueuePolicy(options =>
...@@ -157,7 +159,6 @@ namespace Junmp.Platform.WebApi ...@@ -157,7 +159,6 @@ namespace Junmp.Platform.WebApi
#endregion #endregion
#region 注册系统全局过滤器 #region 注册系统全局过滤器
services.AddMvc(options => services.AddMvc(options =>
...@@ -169,7 +170,6 @@ namespace Junmp.Platform.WebApi ...@@ -169,7 +170,6 @@ namespace Junmp.Platform.WebApi
services.AddSingleton<PermissionAttribute>(); // 添加权限验证过滤器 services.AddSingleton<PermissionAttribute>(); // 添加权限验证过滤器
#endregion #endregion
#region 注册系统AutoMapper组件 #region 注册系统AutoMapper组件
...@@ -271,26 +271,7 @@ namespace Junmp.Platform.WebApi ...@@ -271,26 +271,7 @@ namespace Junmp.Platform.WebApi
#endregion #endregion
#region 注册服务发现
if (AdminGlobalContext.ConsulConfig.IsEnabled)
{
// 注册 Dashboard
x.UseDashboard();
// 注册节点到 Consul
x.UseDiscovery(d =>
{
d.DiscoveryServerHostName = AdminGlobalContext.ConsulConfig.ConsulHostIP;
d.DiscoveryServerPort = AdminGlobalContext.ConsulConfig.ConsulHostPort;
d.CurrentNodeHostName = AdminGlobalContext.CapConfig.CurrentNodeHostName;
d.CurrentNodePort = AdminGlobalContext.ConsulConfig.ServicePort;
d.NodeId = AdminGlobalContext.CapConfig.NodeId;
d.NodeName = AdminGlobalContext.CapConfig.NodeName;
});
}
#endregion
}); });
} }
...@@ -411,12 +392,6 @@ namespace Junmp.Platform.WebApi ...@@ -411,12 +392,6 @@ namespace Junmp.Platform.WebApi
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
}); });
//启用系统全局服务治理
if (AdminGlobalContext.ConsulConfig.IsEnabled)
{
app.RegisterConsul(aft);
}
//MiniProfiler性能分析组件 //MiniProfiler性能分析组件
app.UseMiniProfiler(); app.UseMiniProfiler();
...@@ -445,27 +420,21 @@ namespace Junmp.Platform.WebApi ...@@ -445,27 +420,21 @@ namespace Junmp.Platform.WebApi
AdminGlobalContext.Configuration = Configuration; AdminGlobalContext.Configuration = Configuration;
AdminGlobalContext.RedisConfig = Configuration.GetSection("RedisConfig").Get<RedisConfig>(); AdminGlobalContext.RedisConfig = Configuration.GetSection("RedisConfig").Get<RedisConfig>();
AdminGlobalContext.LogConfig = Configuration.GetSection("LogConfig").Get<LogConfig>(); AdminGlobalContext.LogConfig = Configuration.GetSection("LogConfig").Get<LogConfig>();
AdminGlobalContext.MailConfig = Configuration.GetSection("MailConfig").Get<MailConfig>();
AdminGlobalContext.DirectoryConfig = Configuration.GetSection("DirectoryConfig").Get<DirectoryConfig>(); AdminGlobalContext.DirectoryConfig = Configuration.GetSection("DirectoryConfig").Get<DirectoryConfig>();
AdminGlobalContext.QuartzConfig = Configuration.GetSection("QuartzConfig").Get<QuartzConfig>(); AdminGlobalContext.QuartzConfig = Configuration.GetSection("QuartzConfig").Get<QuartzConfig>();
AdminGlobalContext.RestSharpConfig = Configuration.GetSection("RestSharpConfig").Get<RestSharpConfig>(); AdminGlobalContext.RestSharpConfig = Configuration.GetSection("RestSharpConfig").Get<RestSharpConfig>();
AdminGlobalContext.PollyConfig = Configuration.GetSection("PollyConfig").Get<PollyConfig>(); AdminGlobalContext.PollyConfig = Configuration.GetSection("PollyConfig").Get<PollyConfig>();
AdminGlobalContext.ConsulConfig = Configuration.GetSection("ConsulConfig").Get<ConsulConfig>();
AdminGlobalContext.ConcurrencyLimiterConfig = Configuration.GetSection("ConcurrencyLimiterConfig").Get<ConcurrencyLimiterConfig>(); AdminGlobalContext.ConcurrencyLimiterConfig = Configuration.GetSection("ConcurrencyLimiterConfig").Get<ConcurrencyLimiterConfig>();
AdminGlobalContext.SmartThreadPoolConfig = Configuration.GetSection("SmartThreadPoolConfig").Get<SmartThreadPoolConfig>(); AdminGlobalContext.SmartThreadPoolConfig = Configuration.GetSection("SmartThreadPoolConfig").Get<SmartThreadPoolConfig>();
AdminGlobalContext.SystemCacheConfig = Configuration.GetSection("SystemCacheConfig").Get<SystemCacheConfig>(); AdminGlobalContext.SystemCacheConfig = Configuration.GetSection("SystemCacheConfig").Get<SystemCacheConfig>();
AdminGlobalContext.MomConfig = Configuration.GetSection("MOMConfig").Get<MomConfig>(); AdminGlobalContext.MomConfig = Configuration.GetSection("MOMConfig").Get<MomConfig>();
AdminGlobalContext.RabbitMQConfig = Configuration.GetSection("RabbitMQConfig").Get<RabbitMQConfig>(); AdminGlobalContext.RabbitMQConfig = Configuration.GetSection("RabbitMQConfig").Get<RabbitMQConfig>();
AdminGlobalContext.MongoDBConfig = Configuration.GetSection("MongoDBConfig").Get<MongoDBConfig>();
AdminGlobalContext.ElasticsearchConfig = Configuration.GetSection("ElasticsearchConfig").Get<ElasticsearchConfig>();
AdminGlobalContext.RateLimitConfig = Configuration.GetSection("RateLimitConfig").Get<RateLimitConfig>(); AdminGlobalContext.RateLimitConfig = Configuration.GetSection("RateLimitConfig").Get<RateLimitConfig>();
AdminGlobalContext.MiniProfilerConfig = Configuration.GetSection("MiniProfilerConfig").Get<MiniProfilerConfig>(); AdminGlobalContext.MiniProfilerConfig = Configuration.GetSection("MiniProfilerConfig").Get<MiniProfilerConfig>();
AdminGlobalContext.CapConfig = Configuration.GetSection("CapConfig").Get<CapConfig>(); AdminGlobalContext.CapConfig = Configuration.GetSection("CapConfig").Get<CapConfig>();
AdminGlobalContext.SignalRConfig = Configuration.GetSection("SignalRConfig").Get<SignalRConfig>(); AdminGlobalContext.SignalRConfig = Configuration.GetSection("SignalRConfig").Get<SignalRConfig>();
AdminGlobalContext.CodeGeneratorConfig = Configuration.GetSection("CodeGeneratorConfig").Get<CodeGeneratorConfig>(); AdminGlobalContext.CodeGeneratorConfig = Configuration.GetSection("CodeGeneratorConfig").Get<CodeGeneratorConfig>();
AdminGlobalContext.MeilisearchConfig = Configuration.GetSection("MeilisearchConfig").Get<MeilisearchConfig>(); AdminGlobalContext.MeilisearchConfig = Configuration.GetSection("MeilisearchConfig").Get<MeilisearchConfig>();
AdminGlobalContext.FtpConfig = Configuration.GetSection("FtpConfig").Get<FtpConfig>();
AdminGlobalContext.SshNetConfig = Configuration.GetSection("SshNetConfig").Get<SshNetConfig>();
//AdminGlobalContext.TenantsConfig = Configuration.GetSection("TenantsConfig").Get<TenantsConfig>(); //AdminGlobalContext.TenantsConfig = Configuration.GetSection("TenantsConfig").Get<TenantsConfig>();
} }
......
ed848501be08f9df2e1325f44745b5fdbaa6d78b 1c04628ff0041f634be787576776d7c3ff0fde78
...@@ -241,3 +241,17 @@ C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\obj\Debug\ ...@@ -241,3 +241,17 @@ C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\obj\Debug\
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\obj\Debug\net7.0\Junmp.Platform.WebApi.pdb C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\obj\Debug\net7.0\Junmp.Platform.WebApi.pdb
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\obj\Debug\net7.0\Junmp.Platform.WebApi.genruntimeconfig.cache C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\obj\Debug\net7.0\Junmp.Platform.WebApi.genruntimeconfig.cache
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\obj\Debug\net7.0\ref\Junmp.Platform.WebApi.dll C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\obj\Debug\net7.0\ref\Junmp.Platform.WebApi.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\Google.Protobuf.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\Grpc.Core.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\Grpc.Core.Api.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\Nacos.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\Nacos.AspNetCore.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\Nacos.Microsoft.Extensions.Configuration.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\Nacos.IniParser.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\Nacos.YamlParser.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\YamlDotNet.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\runtimes\linux-arm64\native\libgrpc_csharp_ext.arm64.so
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\runtimes\linux-x64\native\libgrpc_csharp_ext.x64.so
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\runtimes\osx-x64\native\libgrpc_csharp_ext.x64.dylib
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\runtimes\win-x64\native\grpc_csharp_ext.x64.dll
C:\项目\JYZB-Git\JYZB3.0\审核\Junmp.Process\Junmp.Platform.WebApi\bin\Debug\net7.0\runtimes\win-x86\native\grpc_csharp_ext.x86.dll
...@@ -556,6 +556,26 @@ ...@@ -556,6 +556,26 @@
"System.Net.Http": { "System.Net.Http": {
"target": "Package", "target": "Package",
"version": "[4.3.4, )" "version": "[4.3.4, )"
},
"nacos-sdk-csharp": {
"target": "Package",
"version": "[1.3.4, )"
},
"nacos-sdk-csharp.AspNetCore": {
"target": "Package",
"version": "[1.3.4, )"
},
"nacos-sdk-csharp.Extensions.Configuration": {
"target": "Package",
"version": "[1.3.4, )"
},
"nacos-sdk-csharp.IniParser": {
"target": "Package",
"version": "[1.3.4, )"
},
"nacos-sdk-csharp.YamlParser": {
"target": "Package",
"version": "[1.3.4, )"
} }
}, },
"imports": [ "imports": [
......
{ {
"version": 2, "version": 2,
"dgSpecHash": "dBtWvKue3497EN8WZ2pfwHbsUDZK/DqV7IxsngrZjsFkf5Fon92aiibtbOGQxrSsWYe3YdtWWqzFpVTHml5X6g==", "dgSpecHash": "3zyjW6QQF2vPLif66XQBzWImWuaFXRjzzNgyXbPGeqbgPusHMxA+/N/HklJmzyWVRMlo5aMudE/zXddoWjRpdQ==",
"success": true, "success": true,
"projectFilePath": "C:\\项目\\JYZB-Git\\JYZB3.0\\审核\\Junmp.Process\\Junmp.Platform.WebApi\\Junmp.Platform.WebApi.csproj", "projectFilePath": "C:\\项目\\JYZB-Git\\JYZB3.0\\审核\\Junmp.Process\\Junmp.Platform.WebApi\\Junmp.Platform.WebApi.csproj",
"expectedPackageFiles": [ "expectedPackageFiles": [
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
"C:\\Users\\DELL\\.nuget\\packages\\enums.net\\4.0.0\\enums.net.4.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\enums.net\\4.0.0\\enums.net.4.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\fastexpressioncompiler\\3.3.3\\fastexpressioncompiler.3.3.3.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\fastexpressioncompiler\\3.3.3\\fastexpressioncompiler.3.3.3.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\fluentftp\\42.1.0\\fluentftp.42.1.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\fluentftp\\42.1.0\\fluentftp.42.1.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\google.protobuf\\3.21.2\\google.protobuf.3.21.2.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\grpc.core\\2.46.3\\grpc.core.2.46.3.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\grpc.core.api\\2.46.3\\grpc.core.api.2.46.3.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\htmlsanitizer\\8.0.601\\htmlsanitizer.8.0.601.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\htmlsanitizer\\8.0.601\\htmlsanitizer.8.0.601.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\kysharp.sm.core\\1.0.1\\kysharp.sm.core.1.0.1.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\kysharp.sm.core\\1.0.1\\kysharp.sm.core.1.0.1.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\lazy.captcha.core\\1.1.6\\lazy.captcha.core.1.1.6.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\lazy.captcha.core\\1.1.6\\lazy.captcha.core.1.1.6.nupkg.sha512",
...@@ -119,7 +122,7 @@ ...@@ -119,7 +122,7 @@
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.configuration.json\\7.0.0\\microsoft.extensions.configuration.json.7.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.configuration.json\\7.0.0\\microsoft.extensions.configuration.json.7.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.dependencyinjection\\7.0.0\\microsoft.extensions.dependencyinjection.7.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.dependencyinjection\\7.0.0\\microsoft.extensions.dependencyinjection.7.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\7.0.0\\microsoft.extensions.dependencyinjection.abstractions.7.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\7.0.0\\microsoft.extensions.dependencyinjection.abstractions.7.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.dependencymodel\\3.1.6\\microsoft.extensions.dependencymodel.3.1.6.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.dependencymodel\\6.0.0\\microsoft.extensions.dependencymodel.6.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.fileproviders.abstractions\\7.0.0\\microsoft.extensions.fileproviders.abstractions.7.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.fileproviders.abstractions\\7.0.0\\microsoft.extensions.fileproviders.abstractions.7.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.fileproviders.composite\\2.2.0\\microsoft.extensions.fileproviders.composite.2.2.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.fileproviders.composite\\2.2.0\\microsoft.extensions.fileproviders.composite.2.2.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.fileproviders.physical\\7.0.0\\microsoft.extensions.fileproviders.physical.7.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.fileproviders.physical\\7.0.0\\microsoft.extensions.fileproviders.physical.7.0.0.nupkg.sha512",
...@@ -131,6 +134,8 @@ ...@@ -131,6 +134,8 @@
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.localization.abstractions\\2.2.0\\microsoft.extensions.localization.abstractions.2.2.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.localization.abstractions\\2.2.0\\microsoft.extensions.localization.abstractions.2.2.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.logging\\7.0.0\\microsoft.extensions.logging.7.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.logging\\7.0.0\\microsoft.extensions.logging.7.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\7.0.0\\microsoft.extensions.logging.abstractions.7.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\7.0.0\\microsoft.extensions.logging.abstractions.7.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.logging.configuration\\6.0.0\\microsoft.extensions.logging.configuration.6.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.logging.console\\6.0.0\\microsoft.extensions.logging.console.6.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.objectpool\\2.2.0\\microsoft.extensions.objectpool.2.2.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.objectpool\\2.2.0\\microsoft.extensions.objectpool.2.2.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.options\\7.0.0\\microsoft.extensions.options.7.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.options\\7.0.0\\microsoft.extensions.options.7.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.options.configurationextensions\\6.0.0\\microsoft.extensions.options.configurationextensions.6.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\microsoft.extensions.options.configurationextensions\\6.0.0\\microsoft.extensions.options.configurationextensions.6.0.0.nupkg.sha512",
...@@ -164,6 +169,11 @@ ...@@ -164,6 +169,11 @@
"C:\\Users\\DELL\\.nuget\\packages\\mongodb.driver.core\\2.18.0\\mongodb.driver.core.2.18.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\mongodb.driver.core\\2.18.0\\mongodb.driver.core.2.18.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\mongodb.libmongocrypt\\1.6.0\\mongodb.libmongocrypt.1.6.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\mongodb.libmongocrypt\\1.6.0\\mongodb.libmongocrypt.1.6.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\mysqlconnector\\2.2.2\\mysqlconnector.2.2.2.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\mysqlconnector\\2.2.2\\mysqlconnector.2.2.2.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\nacos-sdk-csharp\\1.3.4\\nacos-sdk-csharp.1.3.4.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\nacos-sdk-csharp.aspnetcore\\1.3.4\\nacos-sdk-csharp.aspnetcore.1.3.4.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\nacos-sdk-csharp.extensions.configuration\\1.3.4\\nacos-sdk-csharp.extensions.configuration.1.3.4.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\nacos-sdk-csharp.iniparser\\1.3.4\\nacos-sdk-csharp.iniparser.1.3.4.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\nacos-sdk-csharp.yamlparser\\1.3.4\\nacos-sdk-csharp.yamlparser.1.3.4.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\nest\\7.17.5\\nest.7.17.5.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\nest\\7.17.5\\nest.7.17.5.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\netstandard.library\\2.0.0\\netstandard.library.2.0.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\netstandard.library\\2.0.0\\netstandard.library.2.0.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\newtonsoft.json\\13.0.2\\newtonsoft.json.13.0.2.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\newtonsoft.json\\13.0.2\\newtonsoft.json.13.0.2.nupkg.sha512",
...@@ -330,6 +340,7 @@ ...@@ -330,6 +340,7 @@
"C:\\Users\\DELL\\.nuget\\packages\\system.xml.xpath\\4.3.0\\system.xml.xpath.4.3.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\system.xml.xpath\\4.3.0\\system.xml.xpath.4.3.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\system.xml.xpath.xdocument\\4.3.0\\system.xml.xpath.xdocument.4.3.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\system.xml.xpath.xdocument\\4.3.0\\system.xml.xpath.xdocument.4.3.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\tesseract\\5.2.0\\tesseract.5.2.0.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\tesseract\\5.2.0\\tesseract.5.2.0.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\yamldotnet\\11.2.1\\yamldotnet.11.2.1.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\zkweb.system.drawing\\4.0.1\\zkweb.system.drawing.4.0.1.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\zkweb.system.drawing\\4.0.1\\zkweb.system.drawing.4.0.1.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\zstdsharp.port\\0.6.2\\zstdsharp.port.0.6.2.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\zstdsharp.port\\0.6.2\\zstdsharp.port.0.6.2.nupkg.sha512",
"C:\\Users\\DELL\\.nuget\\packages\\zxing.net\\0.16.7\\zxing.net.0.16.7.nupkg.sha512", "C:\\Users\\DELL\\.nuget\\packages\\zxing.net\\0.16.7\\zxing.net.0.16.7.nupkg.sha512",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论