😎清理代码及升级依赖

This commit is contained in:
zuohuaijun 2025-03-21 01:17:59 +08:00
parent 7baf348f4f
commit 305690f32c
14 changed files with 157 additions and 77 deletions

View File

@ -33,7 +33,7 @@
".img": "application/octet-stream"
},
"LocalizationSettings": {
"SupportedCultures": [ "zh-CN", "zh-HK", "en", "de", "es", "fi", "fr", "it", "ja", "ko", "no", "pl", "pt", "ru", "zh-TW","id","ms","th" ], //
"SupportedCultures": [ "zh-CN", "zh-HK", "en", "de", "es", "fi", "fr", "it", "ja", "ko", "no", "pl", "pt", "ru", "zh-TW", "id", "ms", "th" ], //
"DefaultCulture": "zh-CN", //
"DateTimeFormatCulture": "zh-CN" //
},

View File

@ -35,20 +35,20 @@ public class SysTenantSeedData : ISqlSugarEntitySeedData<SysTenant>
ConfigId=SqlSugarConst.MainConfigId,
Remark="默认租户",
CreateTime=DateTime.Parse("2022-02-10 00:00:00"),
Logo = "/upload/logo.png",
Title = "Admin.NET.Pro",
ViceTitle = "Admin.NET",
ViceDesc = "站在巨人肩膀上的 .NET 通用权限开发框架",
Copyright = "Copyright © 2021-present Admin.NET All rights reserved.",
Icp = "省ICP备12345678号",
IcpUrl = "https://beian.miit.gov.cn",
Watermark = "Admin.NET",
Version = "v2.0.0",
ThemeColor = "#0f59a4",
Layout = "columns", // defaults|classic|transverse|columns
Animation = "fadeDown",
Captcha = true,
SecondVer = false
Logo="/upload/logo.png",
Title="Admin.NET.Pro",
ViceTitle="Admin.NET",
ViceDesc="站在巨人肩膀上的 .NET 通用权限开发框架",
Copyright="Copyright © 2021-present Admin.NET All rights reserved.",
Icp="省ICP备12345678号",
IcpUrl="https://beian.miit.gov.cn",
Watermark="Admin.NET",
Version="v2.0.0",
ThemeColor="#0f59a4",
Layout="columns", // defaults|classic|transverse|columns
Animation="fadeDown",
Captcha=true,
SecondVer=false
},
];
}

View File

@ -22,15 +22,15 @@
<ItemGroup>
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="3.1.1" />
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.412" />
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.448" />
<PackageReference Include="AngleSharp" Version="1.2.0" />
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.5.1" Aliases="BouncyCastleV2" />
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.17.2" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.25" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.25" />
<PackageReference Include="Furion.Pure" Version="4.9.7.25" />
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.17.3" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.26" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.26" />
<PackageReference Include="Furion.Pure" Version="4.9.7.26" />
<PackageReference Include="Hardware.Info" Version="101.0.1" />
<PackageReference Include="Hashids.net" Version="1.7.0" />
<PackageReference Include="IPTools.China" Version="1.6.0" />
@ -40,7 +40,7 @@
<PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.2" />
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.2" />
<PackageReference Include="MailKit" Version="4.11.0" />
<PackageReference Include="MiniExcel" Version="1.38.0" />
<PackageReference Include="MiniExcel" Version="1.39.0" />
<PackageReference Include="MiniWord" Version="0.9.2" />
<PackageReference Include="MQTTnet.Server" Version="5.0.1.1416" />
<PackageReference Include="MySqlBackup.NET.MySqlConnector" Version="2.3.9" />
@ -48,15 +48,15 @@
<PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="4.0.0" />
<PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.2.0" />
<PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="RabbitMQ.Client" Version="7.1.1" />
<PackageReference Include="RabbitMQ.Client" Version="7.1.2" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.4" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.7.0" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.11.0" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.182" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.185" />
<PackageReference Include="SSH.NET" Version="2024.2.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.6.0.2" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1200" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1204" />
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup>

View File

@ -768,7 +768,7 @@ public enum ErrorCodeEnum
/// </summary>
[ErrorCodeItemMetadata("实体文件不存在或匹配不到。如果是刚刚生成的实体,请重启服务后再试")]
db1003,
/// <summary>
/// 数据库类型:{0} 不支持备份
/// </summary>

View File

@ -34,20 +34,20 @@ public class SysTenantSeedData : ISqlSugarEntitySeedData<SysTenant>
ConfigId=SqlSugarConst.MainConfigId,
Remark="默认租户",
CreateTime=DateTime.Parse("2022-02-10 00:00:00"),
Logo = "/upload/logo.png",
Title = "Admin.NET.Pro",
ViceTitle = "Admin.NET",
ViceDesc = "站在巨人肩膀上的 .NET 通用权限开发框架",
Copyright = "Copyright © 2021-present Admin.NET All rights reserved.",
Icp = "省ICP备12345678号",
IcpUrl = "https://beian.miit.gov.cn",
Watermark = "Admin.NET",
Version = "v2.0.0",
ThemeColor = "#0f59a4",
Layout = "columns", // defaults|classic|transverse|columns
Animation = "fadeDown",
Captcha = true,
SecondVer = false
Logo="/upload/logo.png",
Title="Admin.NET.Pro",
ViceTitle="Admin.NET",
ViceDesc="站在巨人肩膀上的 .NET 通用权限开发框架",
Copyright="Copyright © 2021-present Admin.NET All rights reserved.",
Icp="省ICP备12345678号",
IcpUrl="https://beian.miit.gov.cn",
Watermark="Admin.NET",
Version="v2.0.0",
ThemeColor="#0f59a4",
Layout="columns", // defaults|classic|transverse|columns
Animation="fadeDown",
Captcha=true,
SecondVer=false
},
];
}

View File

@ -46,7 +46,6 @@ public class SysDatabaseService : IDynamicApiController, ITransient
DbName = db.Ado.Connection.Database
});
}
return dbOutputs;
}
@ -339,8 +338,7 @@ public class SysDatabaseService : IDynamicApiController, ITransient
if (_codeGenOptions.BaseEntityNames.Contains(input.BaseClassName, StringComparer.OrdinalIgnoreCase))
dbColumnInfos = dbColumnInfos.Where(u => !dbColumnNames.Contains(u.PropertyName, StringComparer.OrdinalIgnoreCase)).ToList();
var dbTableInfo = db.DbMaintenance.GetTableInfoList(false).FirstOrDefault(u => u.Name == input.TableName || u.Name == input.TableName.ToLower()) ??
throw Oops.Oh(ErrorCodeEnum.db1001);
var dbTableInfo = db.DbMaintenance.GetTableInfoList(false).FirstOrDefault(u => u.Name == input.TableName || u.Name == input.TableName.ToLower()) ?? throw Oops.Oh(ErrorCodeEnum.db1001);
var templatePath = GetEntityTemplatePath();
var tContent = File.ReadAllText(templatePath);
var tResult = _viewEngine.RunCompileFromCached(tContent, new
@ -401,20 +399,15 @@ public class SysDatabaseService : IDynamicApiController, ITransient
if (input.FilterExistingData && records.Count != 0)
{
// 获取实体类型-所有种数据数据类型
var entityTypes = App.EffectiveTypes.Where(u =>
!u.IsInterface && !u.IsAbstract && u.IsClass && u.IsDefined(typeof(SugarTable), false) && u.FullName.EndsWith("." + input.EntityName))
.Where(u => !u.GetCustomAttributes<IgnoreTableAttribute>().Any())
.ToList();
var entityTypes = App.EffectiveTypes.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.IsDefined(typeof(SugarTable), false) && u.FullName.EndsWith("." + input.EntityName))
.Where(u => !u.GetCustomAttributes<IgnoreTableAttribute>().Any()).ToList();
if (entityTypes.Count == 1) // 只有一个实体匹配才能过滤
{
// 获取实体的主键对应的属性名称
var pkInfo = entityTypes[0].GetProperties().FirstOrDefault(u => u.GetCustomAttribute<SugarColumn>()?.IsPrimaryKey == true);
if (pkInfo != null)
{
var seedDataTypes = App.EffectiveTypes
.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.GetInterfaces()
.Any(i => i.HasImplementedRawGeneric(typeof(ISqlSugarEntitySeedData<>)) && i.GenericTypeArguments[0] == entityTypes[0])
).ToList();
var seedDataTypes = App.EffectiveTypes.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.GetInterfaces().Any(i => i.HasImplementedRawGeneric(typeof(ISqlSugarEntitySeedData<>)) && i.GenericTypeArguments[0] == entityTypes[0])).ToList();
// 可能会重名的种子数据不作为过滤项
string doNotFilterFullName1 = $"{input.Position}.SeedData.{input.SeedDataName}";
string doNotFilterFullName2 = $"{input.Position}.{input.SeedDataName}"; // Core中的命名空间没有SeedData
@ -454,8 +447,7 @@ public class SysDatabaseService : IDynamicApiController, ITransient
// 检查有没有 System.Text.Json.Serialization.JsonIgnore 或 Newtonsoft.Json.JsonIgnore 的属性
// 如果 JsonIgnore 和 SugarColumn 都存在那么后成序更化时就生成这了这些字段就需要在这里另外补充以处理用户表SysUser中的Password为例
var jsonIgnoreProperties = entityType.GetProperties().Where(p => (p.GetAttribute<System.Text.Json.Serialization.JsonIgnoreAttribute>() != null ||
p.GetAttribute<Newtonsoft.Json.JsonIgnoreAttribute>() != null) && p.GetAttribute<SugarColumn>() != null)
.ToList();
p.GetAttribute<Newtonsoft.Json.JsonIgnoreAttribute>() != null) && p.GetAttribute<SugarColumn>() != null).ToList();
var jsonIgnoreInfo = new List<List<JsonIgnoredPropertyData>>();
if (jsonIgnoreProperties.Count > 0)
{

View File

@ -101,12 +101,15 @@ public class SysDbBackupService : IDynamicApiController, ITransient
case DbType.MySql:
ext = "sql";
break;
case DbType.SqlServer:
ext = "bak";
break;
case DbType.Sqlite:
ext = "db";
break;
case DbType.PostgreSQL:
ext = "sql";
break;
@ -120,6 +123,7 @@ public class SysDbBackupService : IDynamicApiController, ITransient
case DbType.MySql or DbType.Sqlite or DbType.SqlServer:
await Task.Run(() => { db.DbMaintenance.BackupDataBase(db.Ado.Connection.Database, path); });
break;
case DbType.PostgreSQL:
{
var fileStreamResult = (FileStreamResult)(await _databaseService.BackupDatabase());
@ -158,7 +162,7 @@ public class SysDbBackupService : IDynamicApiController, ITransient
}
}
}
/// <summary>
/// 下载备份 🔖
/// </summary>

View File

@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="3.3.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.13.0" />
<PackageReference Include="Rezero.Api" Version="1.7.14" />
<PackageReference Include="Rezero.Api" Version="1.8.2" />
</ItemGroup>
<ItemGroup>

View File

@ -2,7 +2,7 @@
"name": "admin.net.pro",
"type": "module",
"version": "2.4.33",
"lastBuildTime": "2025.03.17",
"lastBuildTime": "2025.03.21",
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
"author": "zuohuaijun",
"license": "MIT",
@ -29,7 +29,7 @@
"@wangeditor/editor-for-vue": "^5.1.12",
"animate.css": "^4.1.1",
"async-validator": "^4.2.5",
"axios": "^1.8.3",
"axios": "^1.8.4",
"countup.js": "^2.8.0",
"cropperjs": "^1.6.2",
"crypto-js": "^4.2.0",
@ -46,7 +46,7 @@
"jsplumb": "^2.15.6",
"jwchat": "^2.0.3",
"lodash-es": "^4.17.21",
"md-editor-v3": "^5.4.1",
"md-editor-v3": "^5.4.2",
"mitt": "^3.0.1",
"monaco-editor": "^0.52.2",
"mqtt": "^5.10.4",
@ -76,8 +76,8 @@
"vue-signature-pad": "^3.0.2",
"vue3-flag-icons": "^0.0.3",
"vue3-tree-org": "^4.2.2",
"vxe-pc-ui": "^4.4.16",
"vxe-table": "^4.11.24",
"vxe-pc-ui": "^4.4.20",
"vxe-table": "^4.11.28",
"vxe-table-plugin-element": "^4.0.4",
"vxe-table-plugin-export-xlsx": "^4.0.7",
"xe-utils": "^3.7.4",
@ -90,9 +90,9 @@
"@types/node": "^20.17.24",
"@types/nprogress": "^0.2.3",
"@types/sortablejs": "^1.15.8",
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@vitejs/plugin-vue": "^5.2.2",
"@typescript-eslint/eslint-plugin": "^8.27.0",
"@typescript-eslint/parser": "^8.27.0",
"@vitejs/plugin-vue": "^5.2.3",
"@vitejs/plugin-vue-jsx": "^4.1.2",
"@vue/compiler-sfc": "^3.5.13",
"code-inspector-plugin": "^0.20.6",
@ -102,7 +102,7 @@
"less": "^4.2.2",
"prettier": "^3.5.3",
"rollup-plugin-visualizer": "^5.14.0",
"sass": "^1.85.1",
"sass": "^1.86.0",
"terser": "^5.39.0",
"typescript": "^5.8.2",
"vite": "^6.2.2",

View File

@ -120,6 +120,55 @@ export const SysDbBackupApiAxiosParamCreator = function (configuration?: Configu
options: localVarRequestOptions,
};
},
/**
*
* @summary 🔖
* @param {string} fileName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysDbBackupDownloadFileNameGet: async (fileName: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'fileName' is not null or undefined
if (fileName === null || fileName === undefined) {
throw new RequiredError('fileName','Required parameter fileName was null or undefined when calling apiSysDbBackupDownloadFileNameGet.');
}
const localVarPath = `/api/sysDbBackup/download/{fileName}`
.replace(`{${"fileName"}}`, encodeURIComponent(String(fileName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary 🔖
@ -200,6 +249,20 @@ export const SysDbBackupApiFp = function(configuration?: Configuration) {
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {string} fileName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysDbBackupDownloadFileNameGet(fileName: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysDbBackupApiAxiosParamCreator(configuration).apiSysDbBackupDownloadFileNameGet(fileName, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
@ -242,6 +305,16 @@ export const SysDbBackupApiFactory = function (configuration?: Configuration, ba
async apiSysDbBackupDeletePost(fileName?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysDbBackupApiFp(configuration).apiSysDbBackupDeletePost(fileName, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {string} fileName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysDbBackupDownloadFileNameGet(fileName: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysDbBackupApiFp(configuration).apiSysDbBackupDownloadFileNameGet(fileName, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
@ -283,6 +356,17 @@ export class SysDbBackupApi extends BaseAPI {
public async apiSysDbBackupDeletePost(fileName?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysDbBackupApiFp(this.configuration).apiSysDbBackupDeletePost(fileName, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {string} fileName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysDbBackupApi
*/
public async apiSysDbBackupDownloadFileNameGet(fileName: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysDbBackupApiFp(this.configuration).apiSysDbBackupDownloadFileNameGet(fileName, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖

View File

@ -47,6 +47,7 @@ export enum DbType {
NUMBER_26 = 26,
NUMBER_27 = 27,
NUMBER_28 = 28,
NUMBER_29 = 29,
NUMBER_900 = 900
}

View File

@ -25,7 +25,6 @@ export enum GenericParameterAttributes {
NUMBER_4 = 4,
NUMBER_8 = 8,
NUMBER_16 = 16,
NUMBER_28 = 28,
NUMBER_32 = 32
NUMBER_28 = 28
}

View File

@ -61,6 +61,12 @@ export interface TypeInfo {
*/
metadataToken?: number;
/**
* @type {boolean}
* @memberof TypeInfo
*/
isInterface?: boolean;
/**
* @type {MemberTypes}
* @memberof TypeInfo
@ -97,12 +103,6 @@ export interface TypeInfo {
*/
module?: Module;
/**
* @type {boolean}
* @memberof TypeInfo
*/
isInterface?: boolean;
/**
* @type {boolean}
* @memberof TypeInfo

View File

@ -55,6 +55,12 @@ export interface Type {
*/
metadataToken?: number;
/**
* @type {boolean}
* @memberof Type
*/
isInterface?: boolean;
/**
* @type {MemberTypes}
* @memberof Type
@ -91,12 +97,6 @@ export interface Type {
*/
module?: Module;
/**
* @type {boolean}
* @memberof Type
*/
isInterface?: boolean;
/**
* @type {boolean}
* @memberof Type