第3章 配置与服务

news2024/9/29 15:30:09

1 CoreCms.Net.Configuration.AppSettingsHelper

using Microsoft.Extensions.Configuration;

using Microsoft.Extensions.Configuration.Json;

namespace CoreCms.Net.Configuration

{

    /// <summary>

    /// 【应用设置助手--类】

    /// <remarks>

    /// 摘要:

    ///     该类中的方法成员,通过1个指定的根节点中1指定的子节点,获取该子节点所对应的值。

    /// </remarks>

    /// </summary>

    public class AppSettingsHelper

    {

        #region 拷贝构造方法与变量

        /// <summary>

        /// 【配置】

        /// <remarks>

        /// 摘要:

        ///    .NetCore框架内置配置接口实例(存储着当前程序中所有*.json文件中的数据)。

        /// </remarks>

        /// </summary>

        static IConfiguration Configuration { get; set; }

        /// <summary>

        /// 【拷贝构造方法】

        /// <remarks>

        /// 摘要:

        ///     通过拷贝构造方法,对.NetCore框架内置配置接口实例(存储着当前程序中所有*.json文件中的数据)。

        /// </remarks>

        /// </summary>

        public AppSettingsHelper(string contentPath)

        {

            string Path = "appsettings.json";

            Configuration = new ConfigurationBuilder().SetBasePath(contentPath).Add(new JsonConfigurationSource { Path = Path, Optional = false, ReloadOnChange = true }).Build();

        }

        #endregion

        /// <param name="sections">数组实例,该实例存储着1个指定的根节点及其1指定的子节点。</param>

        /// <summary>

        /// 【获取内容】

        ///  <remarks>

        /// 摘要:

        ///     通过1个指定的根节点中1指定的子节点,获取该子节点所对应的值。

        /// </remarks>

        /// <returns>

        /// 返回:

        ///     1指定的子节点所对应的值。

        /// </returns>

        /// </summary>

        public static string GetContent(params string[] sections)

        {

            try

            {

                if (sections.Any())

                {

                    return Configuration[string.Join(":", sections)];

                }

            }

            catch (Exception) { }

            return "";

        }

    }

}

2 CoreCms.Net.Configuration.AppSettingsConstVars

using SqlSugar.Extensions;

namespace CoreCms.Net.Configuration

{

    /// <summary>

    /// 【应用设置格式化--类】

    /// <remarks>

    /// 摘要:

    ///     获取1个指定的根节点中1指定的子节点,获取该子节点所对应的值,最后把该值赋值给该类中的属性成员。

    /// </remarks>

    /// </summary>

    public class AppSettingsConstVars

    {

        #region 全局地址================================================================================

        /// <summary>

        /// 【后端管理地址】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取后端管理地址子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string AppConfigAppUrl = AppSettingsHelper.GetContent("AppConfig", "AppUrl");

        /// <summary>

        /// 【系统接口地址】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取系统接口地址子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string AppConfigAppInterFaceUrl = AppSettingsHelper.GetContent("AppConfig", "AppInterFaceUrl");

        #endregion

        #region 数据库================================================================================

        /// <summary>

        /// 【数据库连接字符串】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取数据库连接字符串子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string DbSqlConnection = AppSettingsHelper.GetContent("ConnectionStrings", "SqlConnection");

        /// <summary>

        /// 【数据库类型】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取数据库类型子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string DbDbType = AppSettingsHelper.GetContent("ConnectionStrings", "DbType");

        #endregion

        #region redis================================================================================

        /// <summary>

        /// redis分布式数据库连接字符串】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取redis分布式数据库连接字符串子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string RedisConfigConnectionString = AppSettingsHelper.GetContent("RedisConfig", "ConnectionString");

        /// <summary>

        /// 【启用redis分布式数据库缓存?】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取启用redis分布式数据库缓存子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly bool RedisUseCache = AppSettingsHelper.GetContent("RedisConfig", "UseCache").ObjToBool();

        /// <summary>

        /// 【启用redis分布式数据库执行定时任务?】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取启用redis分布式数据库执行定时任务子节点所对应的值。

        /// 说明:

        ///     redis分布式数据库一般也能用于自动触发执行当前程序中自定义的计划任务。

        /// </remarks>

        public static readonly bool RedisUseTimedTask = AppSettingsHelper.GetContent("RedisConfig", "UseTimedTask").ObjToBool();

        #endregion

        #region AOP================================================================================

        /// <summary>

        /// 【启用事务横切?】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取启用事务横切子节点所对应的值。

        /// </remarks>

        public static readonly bool TranAopEnabled = AppSettingsHelper.GetContent("TranAOP", "Enabled").ObjToBool();

        #endregion

        #region Jwt授权配置================================================================================

        /// <summary>

        /// JwtBearer身份认证秘钥】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取JwtBearer身份认证秘钥子节点所对应的值。

        /// 说明:

        ///     为所有令牌(Token)字符串进行加密操作时,提供数据支撑的秘钥字符串。

        /// </remarks>

        /// </summary>

        public static readonly string JwtConfigSecretKey = AppSettingsHelper.GetContent("JwtConfig", "SecretKey");

        /// <summary>

        /// JwtBearer身份认证签发机关】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取JwtBearer身份认证签发机关子节点所对应的值。

        /// 说明:

        ///     用于生成所有令牌(Token)字符串实例,提供数据支撑的签发机关

        /// </remarks>

        /// </summary>

        public static readonly string JwtConfigIssuer = AppSettingsHelper.GetContent("JwtConfig", "Issuer");

        /// <summary>

        /// JwtBearer身份认证订阅者】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取JwtBearer身份认订阅者关子节点所对应的值。

        /// 说明:

        ///     用于生成所有令牌(Token)字符串实例,提供数据支撑的订阅者

        /// </remarks>

        /// </summary>

        public static readonly string JwtConfigAudience = AppSettingsHelper.GetContent("JwtConfig", "Audience");

        #endregion

        #region Cors跨域设置================================================================================

        /// <summary>

        /// Cors跨域策略名称】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取Cors跨域策略名称子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string CorsPolicyName = AppSettingsHelper.GetContent("Cors", "PolicyName");

        /// <summary>

        /// 【启用Cors跨域?

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取启用Cors跨域子节点所对应的值。

        /// 说明:

        ///     是否应用所有的IP,如设置为true,则取消跨域限制。

        /// </remarks>

        /// </summary>

        public static readonly bool CorsEnableAllIPs = AppSettingsHelper.GetContent("Cors", "EnableAllIPs").ObjToBool();

        /// <summary>

        /// Cors跨域IP集】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取Cors跨域IP集子节点所对应的值。

        /// 说明:

        ///     在启用跨域限制时,所允许前端App的域名,注意:IP集中和IIS部署时,最好不要使用8080端口,因为前端App启动时的默认端口一般为:8080,从因前后程序使用同1个端口而造成异常。

        /// </remarks>

        /// </summary>

        public static readonly string CorsIPs = AppSettingsHelper.GetContent("Cors", "IPs");

        #endregion

        #region Middleware中间件================================================================================

        /// <summary>

        /// 【启用Ip限流自定义中间件?】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取启用Ip限流自定义中间件子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly bool MiddlewareIpLogEnabled = AppSettingsHelper.GetContent("Middleware", "IPLog", "Enabled").ObjToBool();

        /// <summary>

        /// 【启用记录请求与返回数据自定义中间件?】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取启用记录请求与返回数据自定义中间件子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly bool MiddlewareRequestResponseLogEnabled = AppSettingsHelper.GetContent("Middleware", "RequestResponseLog", "Enabled").ObjToBool();

        /// <summary>

        /// 【启用用户访问记录日志自定义中间件?】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取启用用户访问记录日志自定义中间件子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly bool MiddlewareRecordAccessLogsEnabled = AppSettingsHelper.GetContent("Middleware", "RecordAccessLogs", "Enabled").ObjToBool();

        /// <summary>

        /// 【用户访问记录-过滤ip自定义中间件】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取用户访问记录-过滤ip自定义中间件子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string MiddlewareRecordAccessLogsIgnoreApis = AppSettingsHelper.GetContent("Middleware", "RecordAccessLogs", "IgnoreApis");

        #endregion

        #region 支付================================================================================

        /// <summary>

        /// 【微信支付回调】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取微信支付回调子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string PayCallBackWeChatPayUrl = AppSettingsHelper.GetContent("PayCallBack", "WeChatPayUrl");

        /// <summary>

        /// 【微信退款回调】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取微信退款回调子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string PayCallBackWeChatRefundUrl = AppSettingsHelper.GetContent("PayCallBack", "WeChatRefundUrl");

        /// <summary>

        /// 【支付宝支付回调】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取支付宝支付回调子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string PayCallBackAlipayUrl = AppSettingsHelper.GetContent("PayCallBack", "AlipayUrl");

        /// <summary>

        /// 【支付宝退款回调】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取支付宝退款回调子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string PayCallBackAlipayRefundUrl = AppSettingsHelper.GetContent("PayCallBack", "AlipayRefundUrl");

        #endregion

        #region 易联云打印机================================================================================

        /// <summary>

        /// 【启用易联云打印机?】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取启用易联云打印机子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly bool YiLianYunConfigEnabled = AppSettingsHelper.GetContent("YiLianYunConfig", "Enabled").ObjToBool();

        /// <summary>

        /// 【易联云打印机ID

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取易联云打印机ID子节点所对应的值。

        /// 说明:

        ///     一般由开发者所申请的易联云打印机服务的编号值。

        /// </remarks>

        /// </summary>

        public static readonly string YiLianYunConfigClientId = AppSettingsHelper.GetContent("YiLianYunConfig", "ClientId");

        /// <summary>

        /// 【易联云打印机密钥】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取易联云打印机ID子节点所对应的值。

        /// 说明:

        ///     一般由开发者所申请的易联云打印机服务的密钥。

        /// </remarks>

        /// </summary>

        public static readonly string YiLianYunConfigClientSecret = AppSettingsHelper.GetContent("YiLianYunConfig", "ClientSecret");

        /// <summary>

        /// 【易联云打印机设备号】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取易联云打印机设备号子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string YiLianYunConfigMachineCode = AppSettingsHelper.GetContent("YiLianYunConfig", "MachineCode");

        /// <summary>

        /// 【易联云打印机终端密钥】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取易联云打印机终端密钥子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string YiLianYunConfigMsign = AppSettingsHelper.GetContent("YiLianYunConfig", "Msign");

        /// <summary>

        /// 【易联云打印机名称】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取易联云打印机名称子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string YiLianYunConfigPrinterName = AppSettingsHelper.GetContent("YiLianYunConfig", "PrinterName");

        /// <summary>

        /// 【易联打印机设置联系方式】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取易联云打印机设置联系方式子节点所对应的值。

        /// </remarks>

        /// </summary>

        public static readonly string YiLianYunConfigPhone = AppSettingsHelper.GetContent("YiLianYunConfig", "Phone");

        #endregion

        #region HangFire定时任务================================================================================

        /// <summary>

        /// HangFire登录账号】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取HangFire登录账号子节点所对应的值。

        /// 说明:

        ///     HangFire一般用于自动触发执行当前程序中自定义的计划任务。

        /// </remarks>

        /// </summary>

        public static readonly string HangFireLogin = AppSettingsHelper.GetContent("HangFire", "Login");

        /// <summary>

        /// HangFire登录密码】

        /// <remarks>

        /// 摘要:

        ///     appsettings.json文件中,获取HangFire登录密码子节点所对应的值。

        /// 说明:

        ///     HangFire一般用于自动触发执行当前程序中自定义的计划任务。

        /// </remarks>

        /// </summary>

        public static readonly string HangFirePassWord = AppSettingsHelper.GetContent("HangFire", "PassWord");

        #endregion

    }

}

3 重构CoreCms.Net.Core.Config.SqlSugarSetup

using CoreCms.Net.Configuration;

using Microsoft.Extensions.DependencyInjection;

using SqlSugar;

using SqlSugar.IOC;                  

using System.Reflection;

namespace CoreCms.Net.Core.Config

{

    /// <summary>

    /// SqlSugarCore中间件启动--类】

    /// <remarks>

    /// 摘要:

    ///     通过该类中的方法成员,把SqlSugarCore中间件依赖注入到.Net(Core)框架内置依赖注入容器中。

    /// </remarks>

    /// </summary>

    public static class SqlSugarSetup

    {

        /// <param name="services">.Net(Core)框架内置依赖注入容器实例。</param>

        /// <summary>

        /// 【配置服务】

        /// <remarks>

        /// 摘要:

        ///     通过该方法成员,把SqlSugarCore中间件依赖注入到.Net(Core)框架内置依赖注入容器中。。

        /// </remarks>

        /// </summary>

        public static void AddSqlSugarSetup(this IServiceCollection services)

        {

            if (services == null) throw new ArgumentNullException(nameof(services));

            //注入 ORM

            SugarIocServices.AddSqlSugar(new IocConfig()

            {

                //数据库连接

                ConnectionString = AppSettingsConstVars.DbSqlConnection,

                //判断数据库类型

                DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer,

                //是否开启自动关闭数据库连接-//不设成true要手动close

                IsAutoCloseConnection = true,

            });

            //设置参数

            services.ConfigurationSugar(db =>

            {

                db.CurrentConnectionConfig.InitKeyType = InitKeyType.Attribute;

                //说明:CoreShop的程序是数据库优先,即必须先生成指定的数据库,本人更为喜欢代码优先所以进行了以下定义来实现代码优先。

                //如果指定的数据库软件中不存在指定的数据库,则自动生成该数据库。

                db.DbMaintenance.CreateDatabase();

                //通过反射操作,获取领域文件夹中的所有实体的类型实例。

                //直接获取指定项目中所有类的类型实例。

                Assembly assembly = Assembly.Load("CoreCms.Net.Model");

                //通过过滤操作,获取领域文件夹中的所有实体的类型实例。

                //注意:“Where”过滤操作中“ c.Namespace”最好使用“Contains”,而不要使用“==”

                Type[] _typeArray = assembly.GetTypes()

                    .Where(c => c.Namespace.Contains("CoreCms.Net.Model.Entities") && c.IsClass)//过滤操作。

                    .ToArray();

                //如果数据库软件对自动生成的数据库支持自动备份操作,则通过下行语句在自动生成该数据库中,根据当前项目中的实体类自动生成相应的表。

                //注意:SetStringDefaultLength(stringDefaultLength)必须定义在下行语句中,否则在自动生成表时,该约束定义将不会被映射到表的字段上。

                db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(_typeArray);

            });

        }

    }

}

4 CoreCms.Net.Web.Admin\appsettings.json

{

  "ConnectionStrings": {

    "DbType": "SqlServer", //数据库将支持两种模式【SqlServer,MySql

    "SqlConnection": "Server=.;uid=zz;pwd=zz;Database=CoreShop230628;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;"

    //SqlServer数据库连接字符串,需要开启数据库连接复用【MultipleActiveResultSets=true

    // 如果采用容器化部署Service 要写成mysql的服务名,否则写地址

    //"SqlConnection": "Server=127.0.0.1;Port=3306;Database=CoreShop;Uid=CoreShop;Pwd=CoreShop;CharSet=utf8;pooling=true;SslMode=None;Allow User Variables=true;Convert Zero Datetime=True;Allow Zero Datetime=True;"

    // Mysql数据库链接字符串,请保持后面的属性别少。经过测试,mysql版本需要5.7或以上

  }

}

5 CoreCms.Net.Web.Admin\Program.cs

//把持久化的配置文件“appsettings.json”中的所有数据实例化到“AppSettingsHelper”实例中。

builder.Services.AddSingleton(new AppSettingsHelper(builder.Environment.ContentRootPath));

6 CoreCms.Net.IServices.IBaseServices<T>

7 CoreCms.Net.Services.BaseServices<T>

8 CoreCms.Net.IServices.ISysRoleServices

9 CoreCms.Net.Services.SysRoleServices

10 重构CoreCms.Net.Core.AutoFac.AutofacModuleRegister

using Autofac;

using System.Reflection;

namespace CoreCms.Net.Core.AutoFac

{

    /// <summary>

    /// 【Autofac模型注入--类】

    /// <remarks>

    /// 摘要:

    ///     通过该类中的方法成员把指定的程序集(*.dll)依赖注入到Autofac容器中。

    /// </remarks>

    /// </summary>

    public class AutofacModuleRegister : Autofac.Module

    {

        /// <param name="builder">Autofac依赖注入容器实例。</param>

        /// <summary>

        /// 【载入】

        /// <remarks>

        /// 摘要:

        ///     通过该方法把指定程序集中的所有实例依赖注入到Autofac容器中。

        /// </remarks>

        /// </summary>

        protected override void Load(ContainerBuilder builder)

        {

            //获取当前程序启动项程序集(*.dll)文件所在目录(文件夹)的绝对路径字符串(这里特指“..\bin\Debug\net7.0”)。

            var basePath = AppContext.BaseDirectory;

            #region 带有接口层的服务注入

            var servicesDllFile = Path.Combine(basePath, "CoreCms.Net.Services.dll");

            var repositoryDllFile = Path.Combine(basePath, "CoreCms.Net.Repository.dll");

            if (!(File.Exists(servicesDllFile) && File.Exists(repositoryDllFile)))

            {

                var msg = "Repository.dll和Services.dll 丢失,因为项目解耦了,所以需要先F6编译,再F5运行,请检查 bin 文件夹,并拷贝。";

                throw new Exception(msg);

            }

            // 获取 Service.dll 程序集服务,并注册

            var assemblysServices = Assembly.LoadFrom(servicesDllFile);

            //支持属性注入依赖重复

            builder.RegisterAssemblyTypes(assemblysServices).AsImplementedInterfaces().InstancePerDependency()

                .PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies);

            // 获取 Repository.dll 程序集服务,并注册

            var assemblysRepository = Assembly.LoadFrom(repositoryDllFile);

            //支持属性注入依赖重复

            builder.RegisterAssemblyTypes(assemblysRepository).AsImplementedInterfaces().InstancePerDependency()

                .PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies);

            #endregion

        }

    }

}

11 CoreCms.Net.Web.Admin.Controllers.SysRoleController

using Microsoft.AspNetCore.Mvc;

using System.ComponentModel;

using CoreCms.Net.IServices;

namespace CoreCms.Net.Web.Admin.Controllers

{

    [ApiController]

    [Route("[controller]/[action]")]

    public class SysRoleController : ControllerBase

    {

        #region 拷贝构造方法与变量

        private readonly ISysRoleServices _sysRoleServices;

        /// <summary>

        ///     构造函数

        /// </summary>

        public SysRoleController(ISysRoleServices sysRoleServices)

        {

            _sysRoleServices = sysRoleServices;

        }

        #endregion

        #region 获取列表============================================================

        [HttpPost]

        [Description("获取列表")]

        public async Task</*AdminUiCallBack*/ bool> GetPageList()

        {

            //获取数据

            var list = await _sysRoleServices.QueryPageAsync(null, "");

            return true;

        }

        #endregion

    }

}  

 

对以上功能更为具体实现和注释见:230728_003CoreShop230628(配置与服务)。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/804266.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

LLVM(2)IR入门

1 不支持类型的隐式转换 int factorial(int val);int factorial(int val) {if (val < 2)return 1;return factorial(val - 1) factorial(val - 2); }int main(int argc, char **argv) {return factorial(2) * 7 42; }生成IR代码 clang -emit-llvm -S t3.cpp -o t3.ll ;…

Android平台GB28181设备接入侧如何同时对外输出RTSP流?

技术背景 GB28181的应用场景非常广泛&#xff0c;如公共安全、交通管理、企业安全、教育、医疗等众多领域&#xff0c;细分场景可用于如执法记录仪、智能安全帽、智能监控、智慧零售、智慧教育、远程办公、明厨亮灶、智慧交通、智慧工地、雪亮工程、平安乡村、生产运输、车载终…

云原生架构

1. 何为云原生&#xff1f; 很多IT业内小伙伴会经常听到这个名词&#xff0c;那么什么是云原生呢&#xff1f;云原生是在云计算环境中构建、部署和管理现代应用程序的软件方法。 当今时代&#xff0c;众多企业希望构建高度可扩展、灵活且有弹性的应用程序&#xff0c;以便能够快…

Linux CentOS 8 编译安装Apache Subversion

前言 距离上一篇发表已经过去了5年零2个多月&#xff0c;这次重新开始写技术博客&#xff0c;理由和原来一样&#xff0c;也就是想把自己学习和工作中遇到的问题和知识记录下来&#xff0c;今天记录一下Linux CentOS 8通过编译安装svn的过程。 下载SVN 下载地址&#xff1a;…

使用frp中的xtcp映射穿透指定服务实现不依赖公网ip网速的内网穿透p2p

使用frp中的xtcp映射穿透指定服务实现不依赖公网ip网速的内网穿透p2p 管理员Ubuntu配置公网服务端frps配置service自启(可选) 配置内网服务端frpc配置service自启(可选) 使用者配置service自启(可选) 效果 通过frp实现内网client访问另外一个内网服务器 管理员 1&#xff09;…

PHP8的注释-PHP8知识详解

欢迎你来到PHP服务网&#xff0c;学习《PHP8知识详解》系列教程&#xff0c;本文学习的是《PHP8的注释》。 什么是注释&#xff1f; 注释是在程序代码中添加的文本&#xff0c;用于解释和说明代码的功能、逻辑或其他相关信息。注释通常不会被编译器或解释器处理&#xff0c;而…

深度学习实战44-Keras框架下实现高中数学题目的智能分类功能应用

大家好,我是微学AI ,今天给大家介绍一下深度学习实战44-Keras框架实现高中数学题目的智能分类功能应用,该功能是基于人工智能技术的创新应用,通过对数学题目进行智能分类,提供个性化的学习辅助和教学支持。该功能的实现可以通过以下步骤:首先,采集大量的高中数学题目数据…

Clion实现Stm32标准库-HAL库开发配置

1、配置CLion用于STM32开发&#xff08;基于hal库开发&#xff09; 原文链接 https://zhuanlan.zhihu.com/p/145801160 2、配置CLion用于STM32开发&#xff08;基于标准库开发&#xff09; 参考文章&#xff1a;https://www.bilibili.com/read/cv11442303

不再困扰!教你如何方便快捷地将文件转换成PDF格式!

大家都知道PDF是电脑中最常见且兼容性最好的一种文档文件格式&#xff0c;而这种格式的文件既能保留文档的原始布局&#xff0c;又能够方便阅读和打印。那么&#xff0c;当我们需要将其他格式的文件转换成PDF格式时应该如何处理呢&#xff1f;我们可以使用一款文档转换工具&…

【QT 网络云盘客户端】——获取用户文件列表信息

目录 1.获取用户文件列表信息分析 2.设置图标属性 3.向服务器获取文件的数量 4.向服务器获取文件信息列表 4.显示图标 1.获取用户文件列表信息分析 1.将QListWidget设置为图标模式 2. 当我们点击"按下载量升序","按下载量降序",“更新” 菜单选项 都会…

3、HAproxy高级配置

基于cookie的会话保持 在 HAProxy 中&#xff0c;可以通过使用 cookie 配置来实现基于 Cookie 的会话保持。cookie 配置用于配置与会话保持相关的选项&#xff0c;允许您定义要在HTTP响应中插入或重写的Cookie以及其他与Cookie会话保持相关的参数。 以下是一些常用的 cookie 配…

已解决 IDEA Maven 项目中 “Could not find artifact“ 问题的常见情况和解决方案

&#x1f337;&#x1f341; 博主 libin9iOak带您 Go to New World.✨&#x1f341; &#x1f984; 个人主页——libin9iOak的博客&#x1f390; &#x1f433; 《面试题大全》 文章图文并茂&#x1f995;生动形象&#x1f996;简单易学&#xff01;欢迎大家来踩踩~&#x1f33…

QT第四讲

思维导图 基于QT的网络聊天室 widget.h #ifndef WIDGET_H #define WIDGET_H#include <QWidget> #include<QTcpServer> //服务器类 #include<QTcpSocket> //客户端类 #include<QMessageBox> //对话框类 #include<QList…

Windows使用Notepad++编辑Linux服务器的文件

&#x1f680; Windows使用Notepad编辑Linux服务器的文件 &#x1f680; &#x1f332; 算法刷题专栏 | 面试必备算法 | 面试高频算法 &#x1f340; &#x1f332; 越难的东西,越要努力坚持&#xff0c;因为它具有很高的价值&#xff0c;算法就是这样✨ &#x1f332; 作者简介…

<el-date-picker>组件选择开始时间,结束时间自动延长30min

背景&#xff1a;选择开始时间&#xff0c;结束时间自动增加30分钟&#xff0c;结束时间也可重新选择&#xff0c;如图&#xff1a; <el-form-item label"预约开始时间" prop"value1"><el-date-pickersize"large"v-model"ruleForm…

Vue2 第三节 数据代理和事件处理

1.Object.defineProperty 方法 2.数据代理 3.Vue中的数据代理 4.事件的基本使用 5.事件修饰符 6.键盘事件 一.Object.defineProperty 方法 &#xff08;1&#xff09;学习Object.defineProperty为下一节数据代理做准备 &#xff08;2&#xff09;更加高级的给对象添加属…

两个csv进行根据相同字段进行合并

源文件&#xff0c;第一列&#xff0c;编号0 目标文件&#xff0c; 编号3 根据社区名称进行匹配&#xff0c;然后将第一个csv文件的经纬度添加到第二个文件中。 import csvsource r"D:\000datasets\链家房价数据\2020去重后社区名称地理编码.csv" target r"…

TAURI桌面平台制作应用程序工具包初体验

原文&#xff1a;https://tauri.app/zh-cn/v1/guides/getting-started/setup/html-css-js 前提&#xff1a;https://tauri.app/zh-cn/v1/guides/getting-started/prerequisites 步骤1&#xff1a; 在 D:\MyStudy\TauriDemo 文件夹下新建 ui 文件夹&#xff0c;在 ui 文件夹中…

QChart笔记5:Polar Chart极坐标用法

QChart还有专门画极坐标的类QPolarChart&#xff0c;它的界面是一个圆盘。 #include <QApplication> #include <QDebug> #include <QtCharts/QScatterSeries> #include <QtCharts/QLineSeries> #include <QtCharts/QPolarChart> #include <Q…

HR:“抱歉不合适!”,竟是没有满足这项硬性要求?

兼容性测试主要通过人工或自动化的方式&#xff0c;在需要覆盖的终端设备上进行功能用例执行&#xff0c;查看软件性能、稳定性等是否正常。 对于需要覆盖的终端设备&#xff0c;大型互联网公司&#xff0c;像 BAT&#xff0c;基本都有自己的测试实验室&#xff0c;拥有大量终…