当前位置: 首页 > news >正文

第3章 配置与服务

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(配置与服务)。

相关文章:

第3章 配置与服务

1 CoreCms.Net.Configuration.AppSettingsHelper using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration.Json; namespace CoreCms.Net.Configuration { /// <summary> /// 【应用设置助手--类】 /// <remarks> /// 摘要&#x…...

Arcgis之 KML/KMZ文件转shp

一般我们在Goole Earth上勾画的区域导出后都为KML或者KMZ格式的&#xff0c;但无法在arcgis等软件上直接应用&#xff0c;故需进行一定的转换 1.打开ArcMap&#xff0c;选择ArcToolbox->Conversion Tools->From KML->KML To Layer 得到如下结果&#xff08;由于本KML…...

python绘制3D条形图

文章目录 数据导入三维条形图bar3d 数据导入 尽管在matplotlib支持在一个坐标系中绘制多组条形图&#xff0c;效果如下 其中&#xff0c;蓝色表示中国&#xff0c;橘色表示美国&#xff0c;绿色表示欧盟。从这个图就可以非常直观地看出&#xff0c;三者自2018到2022年的GDP变化…...

计算从曲线的起点到param指定的点的曲线段的长度

以下方法只能用于继承于AcDbCurve的类型 主要使用两个接口 派生类中此函数的实现应返回, 并将endParam设置为曲线端点的参数。 如果成功则返回Acad::eOk。 默认情况下, 该函数返回Acad::eNotImplemented。 virtual Acad::ErrorStatus getEndParam(double&endParam) cons…...

POLARDB IMCI 白皮书 云原生HTAP 数据库系统 一 数据压缩和打包处理与数据更新

开头还是介绍一下群&#xff0c;如果感兴趣polardb ,mongodb ,mysql ,postgresql ,redis 等有问题&#xff0c;有需求都可以加群群内有各大数据库行业大咖&#xff0c;CTO&#xff0c;可以解决你的问题。加群请联系 liuaustin3 &#xff0c;在新加的朋友会分到2群&#xff08;共…...

linux----源码安装如何加入到系统服务中(systemclt)

将自己源码安装的软件加入到系统服务中。例如nginx,mysql 就以nginx为例&#xff0c;源码安装&#xff0c;加入到系统服务中 使用yum安装nginx&#xff0c;自动会加入到系统服务 16-Linux系统服务 - 刘清政 - 博客园 (cnblogs.com) 第一步: 源码安装好nginx之后&#xff0…...

Unity 使用UnityWebRequest 读取存档 (IOS只能这样做)

打IOS包的时候发现的&#xff0c;不能使用正常的IO流读取&#xff0c;不然会读取不到数据&#xff0c;只能使用UnityWebRequest 读取 代码如下 public IEnumerator ReadArchive(Action<bool, string> ac, string filepath ""){UnityWebRequest request Unit…...

Caused by: org.springframework.beans.factory.

问题解决:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name IUserRepository defined in app.test4.OpportunityMatching.IUserRepository defined in EnableJpaRepositories declared on JpaRepositoriesRegistrar.Enable…...

【docker 安装】 与【docker-compose 安装】

不同的操作系统需要不同的docker安装文件&#xff1a;具体下载位置&#xff1a; Docker: https://download.docker.com/linux/static/stable/ docekr-compose&#xff1a;https://github.com/docker/compose/releases 1. 验证客户机器是否有docker 和docker-compose docker -…...

意外:WPS编程新工具,不用编程,excel用户:可以不用VBA啦

来来来&#xff0c;拓宽一下视野&#xff01; 别总以为excel和WPS只能用VBA编程&#xff0c;也别总是想着ACCESS这些老生常谈的工具。其实对于电子表格高级用户来讲&#xff0c;不会VBA&#xff0c;不用ACCESS&#xff0c;也一样可以解决复杂问题或者高级应用。 尤其是WPS用户…...

GAMES101 笔记 Lecture12 Geometry3

目录 Mesh Operations: Geometry ProcessingMesh Subdivision (曲面细分)Mesh Simplification(曲面简化)Mesh Regularization(曲面正则化) Subdivision(细分)Loop Subdivision(Loop细分)如何来调整顶点位置呢&#xff1f;Loop Subdivision Result (Loop细分的结果) Catmull-Cla…...

Java的内部类

内部类的概念 在 Java 中&#xff0c;内部类是定义在另一个类或者方法的内部的类。内部类可以访问外部类的所有成员和方法&#xff0c;同时可以被外部类和其他类所访问。内部类可以分为四种类型&#xff1a;静态内部类、成员内部类、局部内部类和匿名内部类。 静态内部类 静…...

电赛培训(高频电路类赛题)学习总结

此篇文章基于全国电子设计大赛培训网的官网的高频电路类赛题总结的知识点。 高频电路赛题的相关理论知识点 &#xff08;1&#xff09;高频电路的单位 a.1kHz1000Hz不等于1KHz&#xff08;大写的K是错误的&#xff09; b.S是西门子&#xff0c;电导的单位&#xff0c;s是秒&…...

Rust ESP32C3开发

Rust ESP32C3开发 系统开发逐步使用Rust语言&#xff0c;在嵌入式领域Rust也逐步完善&#xff0c;本着学习Rust和ESP32的目的&#xff0c;搭建了ESP32C3的环境&#xff0c;过程中遇到了不少问题&#xff0c;予以记录。 ESP-IDF开发ESP32 这一部分可跳过&#xff0c;是使用C开…...

【Spring Cloud Gateway 新一代网关】—— 每天一点小知识

&#x1f4a7; S p r i n g C l o u d G a t e w a y 新一代网关 \color{#FF1493}{Spring Cloud Gateway 新一代网关} SpringCloudGateway新一代网关&#x1f4a7; &#x1f337; 仰望天空&#xff0c;妳我亦是行人.✨ &#x1f984; 个人主页——微风撞见云的博客&a…...

Java 中的关键字 final 和 static

一、关键字 final final 修饰符可以用来修饰类、方法和变量&#xff0c;final 修饰的类不能够被继承&#xff0c;修饰的方法不能被继承类重新定义&#xff0c;修饰的变量为常量&#xff0c;是不可修改的。 1.1 final 变量 final 有"最后的、最终的"的含义&#xf…...

Spring Cloud OpenFeign 全教程

1. 声明式 REST 客户端&#xff1a; Feign Feign 是一个声明式的 Web Service 客户端。它使编写 Web Service 客户端更容易。要使用 Feign&#xff0c;需要创建一个接口并对其进行注解。它有可插拔的注解支持&#xff0c;包括 Feign 注解和 JAX-RS 注解。Feign 还支持可插拔的…...

LLaMA模型论文《LLaMA: Open and Efficient Foundation Language Models》阅读笔记

文章目录 1. 简介2.方法2.1 预训练数据2.2 网络架构2.3 优化器2.4 高效的实现 3.论文其余部分4. 参考资料 1. 简介 LLaMA是meta在2023年2月开源的大模型&#xff0c;在这之后&#xff0c;很多开源模型都是基于LLaMA的&#xff0c;比如斯坦福大学的羊驼模型。 LLaMA的重点是比…...

了解Unity编辑器 之组件篇Effects(十一)

一、Halo&#xff1a;是一个可用于游戏对象的特效组件&#xff0c;它可以在对象周围添加一个光晕效果 Color属性: 用于设置Halo的颜色。你可以通过选择颜色面板中的颜色来指定光晕的外观。选择适当的颜色可以使光晕与游戏场景中的其他元素相匹配或突出显示。 Size属性: 用于设…...

笔记整理-SpringBoot中的扩展点

SpringBoot有哪些扩展点 aware 感知类接口 aware系列的扩展接口&#xff0c;允许spring应用感知/获取特定的上下文环境或对象。bean生命周期控制类接口 bean生命周期类的接口&#xff0c;可以控制spring容器对bean的处理。app生命周期控制类接口 app生命周期控制类接口&#xf…...

【杂谈】-递归进化:人工智能的自我改进与监管挑战

递归进化&#xff1a;人工智能的自我改进与监管挑战 文章目录 递归进化&#xff1a;人工智能的自我改进与监管挑战1、自我改进型人工智能的崛起2、人工智能如何挑战人类监管&#xff1f;3、确保人工智能受控的策略4、人类在人工智能发展中的角色5、平衡自主性与控制力6、总结与…...

django filter 统计数量 按属性去重

在Django中&#xff0c;如果你想要根据某个属性对查询集进行去重并统计数量&#xff0c;你可以使用values()方法配合annotate()方法来实现。这里有两种常见的方法来完成这个需求&#xff1a; 方法1&#xff1a;使用annotate()和Count 假设你有一个模型Item&#xff0c;并且你想…...

《基于Apache Flink的流处理》笔记

思维导图 1-3 章 4-7章 8-11 章 参考资料 源码&#xff1a; https://github.com/streaming-with-flink 博客 https://flink.apache.org/bloghttps://www.ververica.com/blog 聚会及会议 https://flink-forward.orghttps://www.meetup.com/topics/apache-flink https://n…...

springboot整合VUE之在线教育管理系统简介

可以学习到的技能 学会常用技术栈的使用 独立开发项目 学会前端的开发流程 学会后端的开发流程 学会数据库的设计 学会前后端接口调用方式 学会多模块之间的关联 学会数据的处理 适用人群 在校学生&#xff0c;小白用户&#xff0c;想学习知识的 有点基础&#xff0c;想要通过项…...

免费PDF转图片工具

免费PDF转图片工具 一款简单易用的PDF转图片工具&#xff0c;可以将PDF文件快速转换为高质量PNG图片。无需安装复杂的软件&#xff0c;也不需要在线上传文件&#xff0c;保护您的隐私。 工具截图 主要特点 &#x1f680; 快速转换&#xff1a;本地转换&#xff0c;无需等待上…...

在Mathematica中实现Newton-Raphson迭代的收敛时间算法(一般三次多项式)

考察一般的三次多项式&#xff0c;以r为参数&#xff1a; p[z_, r_] : z^3 (r - 1) z - r; roots[r_] : z /. Solve[p[z, r] 0, z]&#xff1b; 此多项式的根为&#xff1a; 尽管看起来这个多项式是特殊的&#xff0c;其实一般的三次多项式都是可以通过线性变换化为这个形式…...

redis和redission的区别

Redis 和 Redisson 是两个密切相关但又本质不同的技术&#xff0c;它们扮演着完全不同的角色&#xff1a; Redis: 内存数据库/数据结构存储 本质&#xff1a; 它是一个开源的、高性能的、基于内存的 键值存储数据库。它也可以将数据持久化到磁盘。 核心功能&#xff1a; 提供丰…...

Java求职者面试指南:Spring、Spring Boot、Spring MVC与MyBatis技术解析

Java求职者面试指南&#xff1a;Spring、Spring Boot、Spring MVC与MyBatis技术解析 一、第一轮基础概念问题 1. Spring框架的核心容器是什么&#xff1f;它的作用是什么&#xff1f; Spring框架的核心容器是IoC&#xff08;控制反转&#xff09;容器。它的主要作用是管理对…...

从物理机到云原生:全面解析计算虚拟化技术的演进与应用

前言&#xff1a;我的虚拟化技术探索之旅 我最早接触"虚拟机"的概念是从Java开始的——JVM&#xff08;Java Virtual Machine&#xff09;让"一次编写&#xff0c;到处运行"成为可能。这个软件层面的虚拟化让我着迷&#xff0c;但直到后来接触VMware和Doc…...

前端开发者常用网站

Can I use网站&#xff1a;一个查询网页技术兼容性的网站 一个查询网页技术兼容性的网站Can I use&#xff1a;Can I use... Support tables for HTML5, CSS3, etc (查询浏览器对HTML5的支持情况) 权威网站&#xff1a;MDN JavaScript权威网站&#xff1a;JavaScript | MDN...