diff --git a/Admin.NET/Admin.NET.Application/Configuration/Alipay.json b/Admin.NET/Admin.NET.Application/Configuration/Alipay.json index 3c1e24fc..b3d2d2bc 100644 --- a/Admin.NET/Admin.NET.Application/Configuration/Alipay.json +++ b/Admin.NET/Admin.NET.Application/Configuration/Alipay.json @@ -3,16 +3,32 @@ // 支付宝支付配置,文档地址:https://openhome.alipay.com/develop/sandbox/app "Alipay": { - "AppId": "9000000000000000", // 支付宝 APPID - "AlipayWebsocketUrl": "openchannel-sandbox.dl.alipaydev.com", // websocket服务地址 "ServerUrl": "https://openapi-sandbox.dl.alipaydev.com/gateway.do", // 支付宝网关地址 - "AuthUrl": "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm", // 授权回调地址 - "NotifyUrl": "http://xxxx.xxx/api/Alipay/Notify", // 应用网关地址 - "PrivateKey": "xxxxxxxxx", // 应用私钥 - "SignType": "RSA2", // 加密算法 - "EncryptKey": "xxxxxxxx", // 从支付宝获取敏感信息时的加密密钥 - "AlipayPublicCertPath": "/AlipayCrt/alipayPublicCert.crt", // 支付宝公钥证书存放路径 - "RootCertPath": "/AlipayCrt/alipayRootCert.crt", // 支付宝根证书存放路径 - "AppCertPath": "/AlipayCrt/appPublicCert.crt" // 应用公钥证书存放路径 + "WebsocketUrl": "openchannel-sandbox.dl.alipaydev.com", // websocket服务地址 + //"AuthUrl": "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm", // 正式环境授权回调地址 + "AuthUrl": "https://openauth-sandbox.dl.alipaydev.com/oauth2/publicAppAuthorize.htm", // 沙箱环境授权回调地址 + "AppAuthUrl": "http://xxxxxxxxxx", // 应用授权回调地址 + "NotifyUrl": "http://xxxxxxxxx/api/sysAlipay/Notify", // 应用网关地址 + "RootCertPath": "Alipaycrt/alipayRootCert.crt", // 支付宝根证书存放路径 + "AccountList": [ + { + "Name": "sandbox 默认应用", + "AppId": "xxxxxxxxxxxxxx", + "SignType": "RSA2", + "PrivateKey": "xxxxxxxxxxxxxxxxx", + "EncryptKey": "xxxxxxxxxxxxxxxxxxxx", + "AppCertPath": "Alipaycrt/appPublicCert.crt", // 应用公钥证书存放路径 + "AlipayPublicCertPath": "Alipaycrt/alipayPublicCert.crt" // 支付宝公钥证书存放路径 + }, + { + "Name": "sandbox 默认应用2", + "AppId": "xxxxxxxxxxxxxx", + "SignType": "RSA2", + "PrivateKey": "xxxxxxxxxxxxxxxxx", + "EncryptKey": "xxxxxxxxxxxxxxxxxxxx", + "AppCertPath": "Alipaycrt/appPublicCert.crt", // 应用公钥证书存放路径 + "AlipayPublicCertPath": "Alipaycrt/alipayPublicCert.crt" // 支付宝公钥证书存放路径 + } + ] } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Application/Configuration/Swagger.json b/Admin.NET/Admin.NET.Application/Configuration/Swagger.json index f91fe788..6d636b7a 100644 --- a/Admin.NET/Admin.NET.Application/Configuration/Swagger.json +++ b/Admin.NET/Admin.NET.Application/Configuration/Swagger.json @@ -27,7 +27,7 @@ "Servers": [ { "Url": "http://ip/xxx", - "Description": "应用程序名" + "Description": "二级目录应用程序名" } ], "LoginInfo": { diff --git a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj index 516f8572..07593b51 100644 --- a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj +++ b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj @@ -20,9 +20,9 @@ - - - + + + @@ -33,7 +33,7 @@ - + @@ -49,7 +49,7 @@ - + diff --git a/Admin.NET/Admin.NET.Core/Entity/SysAlipayAuthInfo.cs b/Admin.NET/Admin.NET.Core/Entity/SysAlipayAuthInfo.cs new file mode 100644 index 00000000..88425462 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Entity/SysAlipayAuthInfo.cs @@ -0,0 +1,149 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 支付宝授权记录表 +/// +[SugarTable(null, "支付宝授权记录表")] +[SysTable] +[SugarIndex("index_{table}_U", nameof(UserId), OrderByType.Asc)] +[SugarIndex("index_{table}_T", nameof(OpenId), OrderByType.Asc)] +public class SysAlipayAuthInfo : EntityBase +{ + /// + /// 商户AppId + /// + [SugarColumn(ColumnDescription = "商户AppId", Length = 64)] + public string? AppId { get; set; } + + /// + /// 开放ID + /// + [SugarColumn(ColumnDescription = "开放ID", Length = 64)] + public string? OpenId { get; set; } + + /// + /// 用户ID + /// + [SugarColumn(ColumnDescription = "用户ID", Length = 64)] + public string? UserId { get; set; } + + /// + /// 性别 + /// + [SugarColumn(ColumnDescription = "性别", Length = 8)] + public GenderEnum Gender { get; set; } + + /// + /// 年龄 + /// + [SugarColumn(ColumnDescription = "年龄", Length = 16)] + public int Age { get; set; } + + /// + /// 手机号 + /// + [SugarColumn(ColumnDescription = "手机号", Length = 32)] + public string Mobile { get; set; } + + /// + /// 显示名称 + /// + [SugarColumn(ColumnDescription = "显示名称", Length = 128)] + public string DisplayName { get; set; } + + /// + /// 昵称 + /// + [SugarColumn(ColumnDescription = "昵称", Length = 64)] + public string NickName { get; set; } + + /// + /// 用户名 + /// + [SugarColumn(ColumnDescription = "用户名", Length = 64)] + public string UserName { get; set; } + + /// + /// 头像 + /// + [SugarColumn(ColumnDescription = "头像", Length = 512)] + public string? Avatar { get; set; } + + /// + /// 邮箱 + /// + [SugarColumn(ColumnDescription = "邮箱", Length = 128)] + public string? Email { get; set; } + + /// + /// 用户民族 + /// + [SugarColumn(ColumnDescription = "用户民族", Length = 32)] + public string? UserNation { get; set; } + + /// + /// 淘宝ID + /// + [SugarColumn(ColumnDescription = "淘宝ID", Length = 64)] + public string? TaobaoId { get; set; } + + /// + /// 电话 + /// + [SugarColumn(ColumnDescription = "电话", Length = 32)] + public string? Phone { get; set; } + + /// + /// 生日 + /// + [SugarColumn(ColumnDescription = "生日", Length = 32)] + public string? PersonBirthday { get; set; } + + /// + /// 职业 + /// + [SugarColumn(ColumnDescription = "职业", Length = 64)] + public string? Profession { get; set; } + + /// + /// 省份 + /// + [SugarColumn(ColumnDescription = "省份", Length = 64)] + public string? Province { get; set; } + + /// + /// 用户状态 + /// + [SugarColumn(ColumnDescription = "用户状态", Length = 32)] + public string? UserStatus { get; set; } + + /// + /// 学历 + /// + [SugarColumn(ColumnDescription = "学历", Length = 32)] + public string? Degree { get; set; } + + /// + /// 用户类型 + /// + [SugarColumn(ColumnDescription = "用户类型", Length = 32)] + public string? UserType { get; set; } + + /// + /// 邮编 + /// + [SugarColumn(ColumnDescription = "邮编", Length = 16)] + public string? Zip { get; set; } + + /// + /// 地址 + /// + [SugarColumn(ColumnDescription = "地址", Length = 256)] + public string? Address { get; set; } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Entity/SysAlipayTransaction.cs b/Admin.NET/Admin.NET.Core/Entity/SysAlipayTransaction.cs new file mode 100644 index 00000000..5913471d --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Entity/SysAlipayTransaction.cs @@ -0,0 +1,108 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 支付宝交易记录表 +/// +[SugarTable(null, "支付宝交易记录表")] +[SysTable] +[SugarIndex("index_{table}_U", nameof(UserId), OrderByType.Asc)] +[SugarIndex("index_{table}_T", nameof(TradeNo), OrderByType.Asc)] +[SugarIndex("index_{table}_O", nameof(OutTradeNo), OrderByType.Asc)] +public class SysAlipayTransaction : EntityBase +{ + /// + /// 用户Id + /// + [SugarColumn(ColumnDescription = "用户Id", Length = 64)] + public long UserId { get; set; } + + /// + /// 交易号 + /// + [SugarColumn(ColumnDescription = "交易号", Length = 64)] + public string? TradeNo { get; set; } + + /// + /// 商户订单号 + /// + [SugarColumn(ColumnDescription = "商户订单号", Length = 64)] + public string OutTradeNo { get; set; } + + /// + /// 交易金额 + /// + [SugarColumn(ColumnDescription = "交易金额", Length = 20)] + public decimal TotalAmount { get; set; } + + /// + /// 交易状态 + /// + [SugarColumn(ColumnDescription = "交易状态", Length = 32)] + public string TradeStatus { get; set; } + + /// + /// 交易完成时间 + /// + [SugarColumn(ColumnDescription = "交易完成时间")] + public DateTime? FinishTime { get; set; } + + /// + /// 交易标题 + /// + [SugarColumn(ColumnDescription = "交易标题", Length = 256)] + public string Subject { get; set; } + + /// + /// 交易描述 + /// + [SugarColumn(ColumnDescription = "交易描述", Length = 512)] + public string? Body { get; set; } + + /// + /// 买家支付宝账号 + /// + [SugarColumn(ColumnDescription = "买家支付宝账号", Length = 128)] + public string? BuyerLogonId { get; set; } + + /// + /// 买家支付宝用户ID + /// + [SugarColumn(ColumnDescription = "买家支付宝用户ID", Length = 32)] + public string? BuyerUserId { get; set; } + + /// + /// 卖家支付宝用户ID + /// + [SugarColumn(ColumnDescription = "卖家支付宝用户ID", Length = 32)] + public string? SellerUserId { get; set; } + + /// + /// 商户AppId + /// + [SugarColumn(ColumnDescription = "商户AppId", Length = 64)] + public string? AppId { get; set; } + + /// + /// 交易扩展信息 + /// + [SugarColumn(ColumnDescription = "交易扩展信息", Length = 1024)] + public string? ExtendInfo { get; set; } + + /// + /// 交易异常信息 + /// + [SugarColumn(ColumnDescription = "交易扩展信息", Length = 1024)] + public string? ErrorInfo { get; set; } + + /// + /// 交易备注 + /// + [SugarColumn(ColumnDescription = "交易备注", Length = 512)] + public string? Remark { get; set; } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenConfig.cs b/Admin.NET/Admin.NET.Core/Entity/SysCodeGenConfig.cs index 87f3bba3..575cebfe 100644 --- a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenConfig.cs +++ b/Admin.NET/Admin.NET.Core/Entity/SysCodeGenConfig.cs @@ -130,6 +130,13 @@ public partial class SysCodeGenConfig : EntityBase [MaxLength(8)] public string? WhetherSortable { get; set; } + /// + /// 是否是统计字段 + /// + [SugarColumn(ColumnDescription = "是否是统计字段", Length = 8)] + [MaxLength(8)] + public string? Statistical { get; set; } + /// /// 是否是查询条件 /// diff --git a/Admin.NET/Admin.NET.Core/Entity/SysTenant.cs b/Admin.NET/Admin.NET.Core/Entity/SysTenant.cs index 45422726..08708e62 100644 --- a/Admin.NET/Admin.NET.Core/Entity/SysTenant.cs +++ b/Admin.NET/Admin.NET.Core/Entity/SysTenant.cs @@ -171,11 +171,11 @@ public partial class SysTenant : EntityBase /// 图形验证码 /// [SugarColumn(ColumnDescription = "图形验证码")] - public virtual bool Captcha { get; set; } = true; + public virtual bool? Captcha { get; set; } = true; /// /// 登录二次验证 /// [SugarColumn(ColumnDescription = "登录二次验证")] - public virtual bool SecondVer { get; set; } = false; + public virtual bool? SecondVer { get; set; } = false; } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Entity/SysTenantCarousel.cs b/Admin.NET/Admin.NET.Core/Entity/SysTenantCarousel.cs new file mode 100644 index 00000000..5d6f25ee --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Entity/SysTenantCarousel.cs @@ -0,0 +1,45 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +//namespace Admin.NET.Core; + +///// +///// 系统租户轮播图表 +///// +//[SugarTable(null, "系统租户轮播图表")] +//[SysTable] +//public partial class SysTenantCarousel : EntityBaseId +//{ +// /// +// /// 租户Id +// /// +// [SugarColumn(ColumnDescription = "租户Id")] +// public long TenantId { get; set; } + +// ///// +// ///// 文件Id +// ///// +// //[SugarColumn(ColumnDescription = "文件Id")] +// //public long? FileId { get; set; } + +// /// +// /// 文件名称 +// /// +// [SugarColumn(ColumnDescription = "文件名称", Length = 64), MaxLength(64)] +// public string? FileName { get; set; } + +// /// +// /// 文件路径 +// /// +// [SugarColumn(ColumnDescription = "文件路径", Length = 256), MaxLength(256)] +// public string? FilePath { get; set; } + +// /// +// /// 排序 +// /// +// [SugarColumn(ColumnDescription = "排序", DefaultValue = "100")] +// public int OrderNo { get; set; } = 100; +//} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Extension/StringExtension.cs b/Admin.NET/Admin.NET.Core/Extension/StringExtension.cs index 81a62c0d..67840410 100644 --- a/Admin.NET/Admin.NET.Core/Extension/StringExtension.cs +++ b/Admin.NET/Admin.NET.Core/Extension/StringExtension.cs @@ -98,6 +98,17 @@ public static class StringExtension return char.ToLower(input[0]) + input[1..]; } + /// + /// 转首字母大写 + /// + public static string ToFirstLetterUpperCase(this string input) + { + if (string.IsNullOrWhiteSpace(input)) return input; + if (input.Length == 1) return input.ToUpper(); // 处理单字符字符串 + + return char.ToUpper(input[0]) + input[1..]; + } + /// /// 渲染字符串,替换占位符 /// diff --git a/Admin.NET/Admin.NET.Core/GlobalUsings.cs b/Admin.NET/Admin.NET.Core/GlobalUsings.cs index f27d03f7..29633ba0 100644 --- a/Admin.NET/Admin.NET.Core/GlobalUsings.cs +++ b/Admin.NET/Admin.NET.Core/GlobalUsings.cs @@ -6,7 +6,6 @@ global using Admin.NET.Core.Service; global using Furion; -global using Furion.ClayObject; global using Furion.ConfigurableOptions; global using Furion.DatabaseAccessor; global using Furion.DataEncryption; @@ -15,10 +14,11 @@ global using Furion.DependencyInjection; global using Furion.DynamicApiController; global using Furion.EventBus; global using Furion.FriendlyException; +global using Furion.HttpRemote; global using Furion.JsonSerialization; global using Furion.Logging; -global using Furion.HttpRemote; global using Furion.Schedule; +global using Furion.Shapeless; global using Furion.UnifyResult; global using Furion.ViewEngine; global using Magicodes.ExporterAndImporter.Core; diff --git a/Admin.NET/Admin.NET.Core/Option/AlipayOptions.cs b/Admin.NET/Admin.NET.Core/Option/AlipayOptions.cs index 2ece6bb6..ddd1bb02 100644 --- a/Admin.NET/Admin.NET.Core/Option/AlipayOptions.cs +++ b/Admin.NET/Admin.NET.Core/Option/AlipayOptions.cs @@ -4,6 +4,8 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! +using Aop.Api; + namespace Admin.NET.Core; /// @@ -12,57 +14,106 @@ namespace Admin.NET.Core; public sealed class AlipayOptions : IConfigurableOptions { /// - /// 支付宝 APPID(必填) + /// 支付宝网关地址 /// - public string AppId { get; set; } + public string ServerUrl { get; init; } /// - /// 支付宝 websocket 服务地址 (必填) + /// 支付宝授权回调地址 /// - public string AlipayWebsocketUrl { get; set; } + public string AuthUrl { get; init; } /// - /// 支付宝网关地址 (必填) + /// 应用授权回调地址 /// - public string ServerUrl { get; set; } + public string AppAuthUrl { get; init; } /// - /// 支付宝授权回调地址 (必填) + /// 支付宝 websocket 服务地址 /// - public string AuthUrl { get; set; } + public string WebsocketUrl { get; init; } /// /// 应用回调地址 /// - public string NotifyUrl { get; set; } + public string NotifyUrl { get; init; } /// - /// 加密算法(必填) + /// 支付宝根证书存放路径 /// - public string SignType { get; set; } + public string RootCertPath { get; init; } + + /// + /// 支付宝商户账号列表 + /// + public List AccountList { get; init; } + + /// + /// 获取支付宝客户端 + /// + /// + public DefaultAopClient GetClient(AlipayMerchantAccount account) + { + account = account ?? throw new Exception("未找到支付宝商户账号"); + string path = App.WebHostEnvironment.ContentRootPath; + return new DefaultAopClient(new AlipayConfig + { + Format = "json", + Charset = "UTF-8", + ServerUrl = ServerUrl, + AppId = account.AppId, + SignType = account.SignType, + PrivateKey = account.PrivateKey, + EncryptKey = account.EncryptKey, + RootCertPath = Path.Combine(path, RootCertPath), + AppCertPath = Path.Combine(path, account.AppCertPath), + AlipayPublicCertPath = Path.Combine(path, account.AlipayPublicCertPath) + }); + } +} + +/// +/// 支付宝商户账号信息 +/// +public class AlipayMerchantAccount +{ + /// + /// 配置Id + /// + public long Id { get; init; } + + /// + /// 商户名称 + /// + public string Name { get; init; } + + /// + /// 商户AppId + /// + public string AppId { get; init; } + + /// + /// 应用私钥 + /// + public string PrivateKey { get; init; } /// /// 从支付宝获取敏感信息时的加密密钥(可选) /// - public string EncryptKey { get; set; } + public string EncryptKey { get; init; } /// - /// 应用私钥 (必填) + /// 加密算法 /// - public string PrivateKey { get; set; } + public string SignType { get; init; } /// - /// 支付宝公钥证书存放路径(证书加签方式必填) + /// 应用公钥证书路径 /// - public string AlipayPublicCertPath { get; set; } + public string AppCertPath { get; init; } /// - /// 支付宝根证书存放路径(证书加签方式必填) + /// 支付宝公钥证书路径 /// - public string RootCertPath { get; set; } - - /// - /// 应用公钥证书存放路径(证书加签方式必填) - /// - public string AppCertPath { get; set; } + public string AlipayPublicCertPath { get; init; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplateSeedData.cs b/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplateSeedData.cs index a851e002..fa13ecd0 100644 --- a/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplateSeedData.cs +++ b/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplateSeedData.cs @@ -25,7 +25,7 @@ public class SysCodeGenTemplateSeedData : ISqlSugarEntitySeedData -/// 支付宝支付服务 🧩 -/// -[ApiDescriptionSettings(Order = 240)] -public class AlipayService : IDynamicApiController, ITransient -{ - private readonly IEnumerable _alipayNotifyList; - private readonly IWebHostEnvironment _webHostEnvironment; - private readonly SysConfigService _sysConfigService; - private readonly IHttpContextAccessor _httpContext; - private readonly AlipayOptions _alipayOptions; - private readonly IAopClient _alipayClient; - private readonly UserManager _userManager; - - public AlipayService( - UserManager userManager, - IHttpContextAccessor httpContext, - SysConfigService sysConfigService, - IWebHostEnvironment webHostEnvironment, - IOptions alipayOptions) - { - _userManager = userManager; - _httpContext = httpContext; - _sysConfigService = sysConfigService; - _alipayOptions = alipayOptions.Value; - _webHostEnvironment = webHostEnvironment; - _alipayNotifyList = App.GetServices(); - - // 初始化支付宝客户端 - string path = App.WebHostEnvironment.ContentRootPath; - _alipayClient = new DefaultAopClient(new AlipayConfig - { - Format = "json", - Charset = "UTF-8", - AppId = _alipayOptions.AppId, - SignType = _alipayOptions.SignType, - ServerUrl = _alipayOptions.ServerUrl, - PrivateKey = _alipayOptions.PrivateKey, - EncryptKey = _alipayOptions.EncryptKey, - AppCertPath = Path.Combine(path, _alipayOptions.AppCertPath), - RootCertPath = Path.Combine(path, _alipayOptions.RootCertPath), - AlipayPublicCertPath = Path.Combine(path, _alipayOptions.AlipayPublicCertPath) - }); - } - - /// - /// 获取授权信息 🔖 - /// - /// - /// - [NonUnify] - [AllowAnonymous] - [DisplayName("获取授权信息")] - [ApiDescriptionSettings(Name = "GetAuthInfo"), HttpGet] - public ActionResult GetAuthInfo([FromQuery] AlipayAuthInfoInput input) - { - var type = input.UserId.Split('-').FirstOrDefault().ToInt(); - var userId = input.UserId.Split('-').LastOrDefault().ToLong(); - - // 当前网页接口地址 - var currentUrl = $"{_httpContext.HttpContext!.Request.GetOrigin()}{_httpContext.HttpContext!.Request.Path}?userId={input.UserId}"; - if (string.IsNullOrEmpty(input.AuthCode)) - { - // 重新授权 - var url = $"{_alipayOptions.AuthUrl}?app_id={_alipayOptions.AppId}&scope=auth_user&redirect_uri={currentUrl}"; - return new RedirectResult(url); - } - - // 组装授权请求参数 - AlipaySystemOauthTokenRequest request = new() - { - GrantType = AlipayConst.GrantType, - Code = input.AuthCode - }; - AlipaySystemOauthTokenResponse response = _alipayClient.CertificateExecute(request); - - // token换取用户信息 - AlipayUserInfoShareRequest infoShareRequest = new(); - AlipayUserInfoShareResponse info = _alipayClient.CertificateExecute(infoShareRequest, response.AccessToken); - - // 循环执行扫码后需要执行的业务逻辑,需要至少一个继承方法返回true,否则抛出异常 - var pass = false; - foreach (var notify in _alipayNotifyList) - if (notify.ScanCallback(type, userId, info)) pass = true; - if (!pass) throw Oops.Oh("未处理的授权逻辑"); - - // 执行完,重定向到指定界面 - var authPageUrl = _sysConfigService.GetConfigValueByCode(ConfigConst.AlipayAuthPageUrl + type).Result; - return new RedirectResult(authPageUrl); - } - - /// - /// 支付回调 🔖 - /// - /// - [AllowAnonymous] - [DisplayName("支付回调")] - [ApiDescriptionSettings(Name = "Notify"), HttpPost] - public string Notify() - { - SortedDictionary sorted = []; - foreach (string key in _httpContext.HttpContext!.Request.Form.Keys) - sorted.Add(key, _httpContext.HttpContext.Request.Form[key]); - - string alipayPublicKey = Path.Combine(_webHostEnvironment.ContentRootPath, _alipayOptions.AlipayPublicCertPath!.Replace('/', '\\').TrimStart('\\')); - bool signVerified = AlipaySignature.RSACertCheckV1(sorted, alipayPublicKey, "UTF-8", _alipayOptions.SignType); // 调用SDK验证签名 - if (!signVerified) throw Oops.Oh("交易失败"); - - var outTradeNo = sorted.GetValueOrDefault("out_trade_no"); - try - { - // 记录回调日志 - File.AppendAllText($"{_webHostEnvironment.ContentRootPath}\\AlipayLog\\Notify-{DateTime.Today:yyyy-MM-dd}.txt", - $"支付宝支付到平台({DateTime.Now:yyyy-MM-dd HH:mm:ss}):{Environment.NewLine} " + - $"登录人:{_userManager.UserId}-{_userManager.RealName}{Environment.NewLine} " + - $"IP:{App.HttpContext?.GetRemoteIpAddressToIPv4(true)} {Environment.NewLine} " + - $"交易号:{outTradeNo}{Environment.NewLine} " + - $"参数:{JSON.Serialize(sorted)}{Environment.NewLine} " + - $"-----------------------------------------------------------------------------------------------------------------------" + - $"{Environment.NewLine}{Environment.NewLine}{Environment.NewLine}"); - } - catch (Exception ex) - { - Log.Error("支付宝支付回调日志写入失败:", ex); - } - - if (sorted.GetValueOrDefault(AlipayConst.TradeStatus) == AlipayConst.TradeSuccess) - { - // 约定交易码前四位为类型码,后面为订单号 - var tradeNo = long.Parse(outTradeNo); - var type = long.Parse(outTradeNo[..4]); - - // 循环执行业务逻辑,若都未处理(回调全部返回false)则交易失败 - var isError = true; - foreach (var notify in _alipayNotifyList) - if (notify.TopUpCallback(type, tradeNo)) isError = false; - if (isError) throw Oops.Oh("交易失败"); - } - return "success"; - } - - /// - /// 统一收单下单并支付页面接口 🔖 - /// - /// - /// - [DisplayName("统一收单下单并支付页面接口")] - [ApiDescriptionSettings(Name = "AlipayTradePagePay"), HttpPost] - public string AlipayTradePagePay(AlipayTradePagePayInput input) - { - AlipayTradeWapPayRequest request = new(); - - // 组装业务参数model - AlipayTradeWapPayModel model = new() - { - Subject = input.Subject, - OutTradeNo = input.OutTradeNo, - TotalAmount = input.TotalAmount, - Body = input.Body, - ProductCode = "QUICK_WAP_WAY", - TimeExpire = input.TimeoutExpress - }; - request.SetBizModel(model); - - // 设置异步通知接收地址 - request.SetNotifyUrl(_alipayOptions.NotifyUrl); - - var response = _alipayClient.SdkExecute(request); - if (response.IsError) throw Oops.Oh(response.SubMsg); - return $"{_alipayOptions.ServerUrl}?{response.Body}"; - } - - /// - /// 交易预创建 🔖 - /// - /// - /// - [DisplayName("交易预创建")] - [ApiDescriptionSettings(Name = "AlipayPreCreate"), HttpPost] - public string AlipayPreCreate(AlipayPreCreateInput input) - { - AlipayTradePrecreateRequest request = new(); - - // 设置异步通知接收地址 - request.SetNotifyUrl(_alipayOptions.NotifyUrl); - - // 组装业务参数model - AlipayTradePrecreateModel model = new() - { - Subject = input.Subject, - OutTradeNo = input.OutTradeNo, - TotalAmount = input.TotalAmount, - TimeoutExpress = input.TimeoutExpress - }; - request.SetBizModel(model); - - var response = _alipayClient.CertificateExecute(request); - if (response.IsError) throw Oops.Oh(response.SubMsg); - return response.QrCode; - } - - /// - /// 单笔转账到支付宝账户 - /// https://opendocs.alipay.com/open/62987723_alipay.fund.trans.uni.transfer - /// - [NonAction] - public Task Transfer(AlipayFundTransUniTransferInput input) - { - // 构造请求参数以调用接口 - AlipayFundTransUniTransferRequest request = new(); - AlipayFundTransUniTransferModel model = new() - { - BizScene = AlipayConst.BizScene, - ProductCode = AlipayConst.ProductCode, - - // 设置商家侧唯一订单号 - OutBizNo = input.OutBizNo, - - // 设置订单总金额 - TransAmount = input.TransAmount.ToString(), - - // 设置转账业务的标题 - OrderTitle = input.OrderTitle - }; - - // 设置收款方信息 - Participant payeeInfo = new() - { - CertType = input.CertType.ToString(), - CertNo = input.CertNo, - Identity = input.Identity, - Name = input.Name, - IdentityType = input.IdentityType.ToString() - }; - model.PayeeInfo = payeeInfo; - - // 设置业务备注 - model.Remark = input.Remark; - - // 设置转账业务请求的扩展参数 - string payerShowNameUseAlias = input.PayerShowNameUseAlias.ToString().ToLower(); - model.BusinessParams = $"{{\"payer_show_name_use_alias\":\"{payerShowNameUseAlias}\"}}"; - - request.SetBizModel(model); - var response = _alipayClient.CertificateExecute(request); - - try - { - File.AppendAllText($"{_webHostEnvironment.ContentRootPath}\\AlipayLog\\{DateTime.Today:yyyy-MM-dd}.txt", - $"支付宝付款到账户({DateTime.Now:yyyy-MM-dd HH:mm:ss}):{Environment.NewLine} " + - $"登录人:{_userManager.UserId}-{_userManager.RealName}{Environment.NewLine} " + - $"IP:{App.HttpContext?.GetRemoteIpAddressToIPv4(true)} {Environment.NewLine} " + - $"参数:{JSON.Serialize(model)}{Environment.NewLine} " + - $"返回:{JSON.Serialize(response)}{Environment.NewLine}" + - $"-----------------------------------------------------------------------------------------------------------------------" + - $"{Environment.NewLine}{Environment.NewLine}{Environment.NewLine}"); - } - catch (Exception ex) - { - Log.Error("单笔转账到支付宝账户日志写入失败:", ex); - } - return Task.FromResult(response); - } -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/Alipay/Dto/AlipayInput.cs b/Admin.NET/Admin.NET.Core/Service/Alipay/Dto/AlipayInput.cs index 03421b25..c70d45ec 100644 --- a/Admin.NET/Admin.NET.Core/Service/Alipay/Dto/AlipayInput.cs +++ b/Admin.NET/Admin.NET.Core/Service/Alipay/Dto/AlipayInput.cs @@ -5,27 +5,36 @@ // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! using Aop.Api.Domain; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Admin.NET.Core.Service; public class AlipayFundTransUniTransferInput { /// - /// 商家侧唯一订单号 + /// 用户ID + /// + public long UserId { get; set; } + + /// + /// 商户AppId + /// + public string AppId { get; set; } + + /// + /// 商家订单号 /// - [Required(ErrorMessage = "订单号不能为空")] public string OutBizNo { get; set; } /// /// 转账金额 /// - [Required(ErrorMessage = "转账金额不能为空")] - public decimal? TransAmount { get; set; } + public decimal TransAmount { get; set; } /// - /// 转账业务标题 + /// 业务标题 /// - [Required(ErrorMessage = "业务标题不能为空")] public string OrderTitle { get; set; } /// @@ -46,25 +55,21 @@ public class AlipayFundTransUniTransferInput /// /// 收款方证件号码,条件必填 /// - [CommonValidation($"{nameof(CertType)} != null && string.IsNullOrWhiteSpace({nameof(CertNo)})", "", ErrorMessage = "证件号码不能为空")] public string CertNo { get; set; } /// /// 收款方身份标识 /// - [Required(ErrorMessage = "身份标识不能为空")] public string Identity { get; set; } /// /// 收款方真实姓名 /// - [Required(ErrorMessage = "真实姓名不能为空")] public string Name { get; set; } /// /// 收款方身份标识类型 /// - [Required(ErrorMessage = "身份标识类型不能为空")] public AlipayIdentityTypeEnum? IdentityType { get; set; } } @@ -159,10 +164,17 @@ public class AlipayAuthInfoInput /// /// 用户Id /// + + [JsonProperty("user_id")] + [JsonPropertyName("user_id")] + [FromQuery(Name = "user_id")] public string UserId { get; set; } /// /// 授权码 /// + [JsonProperty("auth_code")] + [JsonPropertyName("auth_code")] + [FromQuery(Name = "auth_code")] public string AuthCode { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/Alipay/SysAlipayService.cs b/Admin.NET/Admin.NET.Core/Service/Alipay/SysAlipayService.cs new file mode 100644 index 00000000..8d727a03 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Service/Alipay/SysAlipayService.cs @@ -0,0 +1,271 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +using Aop.Api; +using Aop.Api.Domain; +using Aop.Api.Request; +using Aop.Api.Response; +using Aop.Api.Util; +using Microsoft.AspNetCore.Hosting; +using NewLife.Reflection; + +namespace Admin.NET.Core.Service; + +/// +/// 支付宝支付服务 🧩 +/// +[ApiDescriptionSettings(Order = 240)] +public class SysAlipayService : IDynamicApiController, ITransient +{ + private readonly IWebHostEnvironment _webHostEnvironment; + private readonly SysConfigService _sysConfigService; + private readonly List _alipayClientList; + private readonly IHttpContextAccessor _httpContext; + private readonly AlipayOptions _option; + private readonly ISqlSugarClient _db; + + public SysAlipayService( + ISqlSugarClient db, + IHttpContextAccessor httpContext, + SysConfigService sysConfigService, + IWebHostEnvironment webHostEnvironment, + IOptions alipayOptions) + { + _db = db; + _httpContext = httpContext; + _sysConfigService = sysConfigService; + _option = alipayOptions.Value; + _webHostEnvironment = webHostEnvironment; + + // 初始化支付宝客户端列表 + _alipayClientList = []; + foreach (var account in _option.AccountList) _alipayClientList.Add(_option.GetClient(account)); + } + + /// + /// 获取授权信息 🔖 + /// + /// + /// + [NonUnify] + [AllowAnonymous] + [DisplayName("获取授权信息")] + [ApiDescriptionSettings(Name = "AuthInfo"), HttpGet] + public ActionResult GetAuthInfo([FromQuery] AlipayAuthInfoInput input) + { + var type = input.UserId?.Split('-').FirstOrDefault().ToInt(); + var userId = input.UserId?.Split('-').LastOrDefault().ToLong(); + var account = _option.AccountList.FirstOrDefault(); + var alipayClient = _alipayClientList.First(); + + // 当前网页接口地址 + var currentUrl = $"{_option.AppAuthUrl}{_httpContext.HttpContext!.Request.Path}?userId={input.UserId}"; + if (string.IsNullOrEmpty(input.AuthCode)) + { + // 重新授权 + var url = $"{_option.AuthUrl}?app_id={account!.AppId}&scope=auth_user&redirect_uri={currentUrl}"; + return new RedirectResult(url); + } + + // 组装授权请求参数 + AlipaySystemOauthTokenRequest request = new() + { + GrantType = AlipayConst.GrantType, + Code = input.AuthCode + }; + AlipaySystemOauthTokenResponse response = alipayClient.CertificateExecute(request); + + // token换取用户信息 + AlipayUserInfoShareRequest infoShareRequest = new(); + AlipayUserInfoShareResponse info = alipayClient.CertificateExecute(infoShareRequest, response.AccessToken); + + // 记录授权信息 + var entity = _db.Queryable().First(u => + (!string.IsNullOrWhiteSpace(u.UserId) && u.UserId == info.UserId) || + (!string.IsNullOrWhiteSpace(u.OpenId) && u.OpenId == info.OpenId)) ?? new(); + entity.Copy(info, excludes: [nameof(SysAlipayAuthInfo.Gender), nameof(SysAlipayAuthInfo.Age)]); + entity.Age = int.Parse(info.Age); + entity.Gender = info.Gender switch + { + "m" => GenderEnum.Male, + "f" => GenderEnum.Female, + _ => GenderEnum.Unknown + }; + entity.AppId = account!.AppId; + if (entity.Id <= 0) _db.Insertable(entity).ExecuteCommand(); + else _db.Updateable(entity).ExecuteCommand(); + + // 执行完,重定向到指定界面 + //var authPageUrl = _sysConfigService.GetConfigValueByCode(ConfigConst.AlipayAuthPageUrl + type).Result; + //return new RedirectResult(authPageUrl); + return new RedirectResult(_option.AppAuthUrl + "/index.html"); + } + + /// + /// 支付回调 🔖 + /// + /// + [AllowAnonymous] + [DisplayName("支付回调")] + [ApiDescriptionSettings(Name = "Notify"), HttpPost] + public string Notify() + { + SortedDictionary sorted = []; + foreach (string key in _httpContext.HttpContext!.Request.Form.Keys) + sorted.Add(key, _httpContext.HttpContext.Request.Form[key]); + + var account = _option.AccountList.FirstOrDefault(); + string alipayPublicKey = Path.Combine(_webHostEnvironment.ContentRootPath, account!.AlipayPublicCertPath!.Replace('/', '\\').TrimStart('\\')); + bool signVerified = AlipaySignature.RSACertCheckV1(sorted, alipayPublicKey, "UTF-8", account.SignType); // 调用SDK验证签名 + if (!signVerified) throw Oops.Oh("交易失败"); + + // 更新交易记录 + var outTradeNo = sorted.GetValueOrDefault("out_trade_no"); + var transaction = _db.Queryable().First(x => x.OutTradeNo == outTradeNo) ?? throw Oops.Oh("交易记录不存在"); + transaction.TradeNo = sorted.GetValueOrDefault("trade_no"); + transaction.TradeStatus = sorted.GetValueOrDefault("trade_status"); + transaction.FinishTime = sorted.ContainsKey("gmt_payment") ? DateTime.Parse(sorted.GetValueOrDefault("gmt_payment")) : null; + transaction.BuyerLogonId = sorted.GetValueOrDefault("buyer_logon_id"); + transaction.BuyerUserId = sorted.GetValueOrDefault("buyer_user_id"); + transaction.SellerUserId = sorted.GetValueOrDefault("seller_id"); + transaction.Remark = sorted.GetValueOrDefault("remark"); + _db.Updateable(transaction).ExecuteCommand(); + + return "success"; + } + + /// + /// 统一收单下单并支付页面接口 🔖 + /// + /// + /// + [DisplayName("统一收单下单并支付页面接口")] + [ApiDescriptionSettings(Name = "AlipayTradePagePay"), HttpPost] + public string AlipayTradePagePay(AlipayTradePagePayInput input) + { + // 创建交易记录,状态为等待支付 + var transactionRecord = new SysAlipayTransaction + { + AppId = _option.AccountList.First().AppId, + OutTradeNo = input.OutTradeNo, + TotalAmount = input.TotalAmount.ToDecimal(), + TradeStatus = "WAIT_PAY", // 等待支付 + CreateTime = DateTime.Now, + Subject = input.Subject, + Body = input.Body, + Remark = "等待用户支付" + }; + _db.Insertable(transactionRecord).ExecuteCommand(); + + // 设置支付页面请求,并组装业务参数model,设置异步通知接收地址 + AlipayTradeWapPayRequest request = new(); + request.SetBizModel(new AlipayTradeWapPayModel() + { + Subject = input.Subject, + OutTradeNo = input.OutTradeNo, + TotalAmount = input.TotalAmount, + Body = input.Body, + ProductCode = "QUICK_WAP_WAY", + TimeExpire = input.TimeoutExpress + }); + request.SetNotifyUrl(_option.NotifyUrl); + + var alipayClient = _alipayClientList.First(); + var response = alipayClient.SdkExecute(request); + if (response.IsError) throw Oops.Oh(response.SubMsg); + return $"{_option.ServerUrl}?{response.Body}"; + } + + /// + /// 交易预创建 🔖 + /// + /// + /// + [DisplayName("交易预创建")] + [ApiDescriptionSettings(Name = "AlipayPreCreate"), HttpPost] + public string AlipayPreCreate(AlipayPreCreateInput input) + { + // 创建交易记录,状态为等待支付 + var transactionRecord = new SysAlipayTransaction + { + AppId = _option.AccountList.First().AppId, + OutTradeNo = input.OutTradeNo, + TotalAmount = input.TotalAmount.ToDecimal(), + TradeStatus = "WAIT_PAY", // 等待支付 + CreateTime = DateTime.Now, + Subject = input.Subject, + Remark = "等待用户支付" + }; + _db.Insertable(transactionRecord).ExecuteCommand(); + + // 设置异步通知接收地址,并组装业务参数model + AlipayTradePrecreateRequest request = new(); + request.SetNotifyUrl(_option.NotifyUrl); + request.SetBizModel(new AlipayTradePrecreateModel() + { + Subject = input.Subject, + OutTradeNo = input.OutTradeNo, + TotalAmount = input.TotalAmount, + TimeoutExpress = input.TimeoutExpress + }); + + var alipayClient = _alipayClientList.First(); + var response = alipayClient.CertificateExecute(request); + if (response.IsError) throw Oops.Oh(response.SubMsg); + return response.QrCode; + } + + /// + /// 单笔转账到支付宝账户 + /// https://opendocs.alipay.com/open/62987723_alipay.fund.trans.uni.transfer + /// + [NonAction] + public async Task Transfer(AlipayFundTransUniTransferInput input) + { + var account = _option.AccountList.FirstOrDefault(u => u.AppId == input.AppId) ?? throw Oops.Oh("未找到商户支付宝账号"); + var alipayClient = _option.GetClient(account); + + // 构造请求参数以调用接口 + AlipayFundTransUniTransferRequest request = new(); + AlipayFundTransUniTransferModel model = new() + { + BizScene = AlipayConst.BizScene, + ProductCode = AlipayConst.ProductCode, + OutBizNo = input.OutBizNo, // 商家订单 + TransAmount = $"{input.TransAmount}:F2", // 订单总金额 + OrderTitle = input.OrderTitle, // 业务标题 + Remark = input.Remark, // 业务备注 + PayeeInfo = new() // 收款方信息 + { + CertType = input.CertType?.ToString(), + CertNo = input.CertNo, + Identity = input.Identity, + Name = input.Name, + IdentityType = input.IdentityType.ToString() + }, + BusinessParams = input.PayerShowNameUseAlias ? "{\"payer_show_name_use_alias\":\"true\"}" : null + }; + + request.SetBizModel(model); + var response = alipayClient.CertificateExecute(request); + + // 保存转账记录 + await _db.Insertable(new SysAlipayTransaction + { + UserId = input.UserId, + AppId = input.AppId, + TradeNo = response.OrderId, + OutTradeNo = input.OutBizNo, + TotalAmount = response.Amount.ToDecimal(), + TradeStatus = response.Code == "10000" ? "SUCCESS" : "FAILED", + Subject = input.OrderTitle, + ErrorInfo = response.SubMsg, + Remark = input.Remark + }).ExecuteCommandAsync(); + + return response; + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs b/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs index b572a0d3..f7ae023d 100644 --- a/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs @@ -13,7 +13,7 @@ namespace Admin.NET.Core.Service; /// 系统登录授权服务 🧩 /// [ApiDescriptionSettings(Order = 500, Description = "登录授权")] -[AppApiDescription("账号密码登录 🔖")] +[AppApiDescription("登录授权")] public class SysAuthService : IDynamicApiController, ITransient { private readonly UserManager _userManager; diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenConfig.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenConfig.cs index f1d15717..80dade27 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenConfig.cs +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenConfig.cs @@ -118,6 +118,11 @@ public class CodeGenConfig /// public string WhetherSortable { get; set; } + /// + /// 是否是统计字段 + /// + public string Statistical { get; set; } + /// /// 是否是查询条件 /// diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenConfigService.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenConfigService.cs index bb5d8ec0..f7d3997b 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenConfigService.cs +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenConfigService.cs @@ -13,10 +13,149 @@ namespace Admin.NET.Core.Service; public class SysCodeGenConfigService : IDynamicApiController, ITransient { private readonly ISqlSugarClient _db; + private readonly CodeGenOptions _codeGenOptions; + private readonly DbConnectionOptions _dbConnectionOptions; + private readonly SysDatabaseService _databaseService; - public SysCodeGenConfigService(ISqlSugarClient db) + public SysCodeGenConfigService(ISqlSugarClient db, + SysDatabaseService databaseService, + IOptions dbConnectionOptions, + IOptions codeGenOptions) { _db = db; + _dbConnectionOptions = dbConnectionOptions.Value; + _codeGenOptions = codeGenOptions.Value; + _databaseService = databaseService; + } + + /// + /// 获取数据表列(实体属性)集合 + /// + /// + public List GetColumnList([FromQuery] AddCodeGenInput input) + { + return GetColumnList(input.TableName, input.ConfigId); + } + + /// + /// 获取数据表列(实体属性)集合 + /// + /// + /// + /// + public List GetColumnList(string EntityName, string ConfigId) + { + var entityType = GetEntityInfos().GetAwaiter().GetResult().FirstOrDefault(u => u.EntityName == EntityName); + if (entityType == null) return null; + + var config = _dbConnectionOptions.ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == ConfigId); + var dbTableName = config!.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(entityType.DbTableName) : entityType.DbTableName; + int bracketIndex = dbTableName.IndexOf('{'); + if (bracketIndex != -1) + { + dbTableName = dbTableName[..bracketIndex]; + var dbTableInfos = _db.AsTenant().GetConnectionScope(ConfigId).DbMaintenance.GetTableInfoList(false); + var table = dbTableInfos.FirstOrDefault(u => u.Name.StartsWith(config.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(dbTableName) : dbTableName, StringComparison.CurrentCultureIgnoreCase)); + if (table != null) + dbTableName = table.Name; + } + + // 切库---多库代码生成用 + var provider = _db.AsTenant().GetConnectionScope(!string.IsNullOrEmpty(ConfigId) ? ConfigId : SqlSugarConst.MainConfigId); + + var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenantBaseData)]; + var columnInfos = provider.DbMaintenance.GetColumnInfosByTableName(dbTableName, false); + var result = columnInfos.Select(u => new ColumnOuput + { + // 转下划线后的列名需要再转回来(暂时不转) + //ColumnName = config.DbSettings.EnableUnderLine ? CodeGenUtil.CamelColumnName(u.DbColumnName, entityBasePropertyNames) : u.DbColumnName, + ColumnName = u.DbColumnName, + ColumnLength = u.Length, + IsPrimarykey = u.IsPrimarykey, + IsNullable = u.IsNullable, + ColumnKey = u.IsPrimarykey.ToString(), + NetType = CodeGenUtil.ConvertDataType(u, provider.CurrentConnectionConfig.DbType), + DataType = u.DataType, + ColumnComment = string.IsNullOrWhiteSpace(u.ColumnDescription) ? u.DbColumnName : u.ColumnDescription, + DefaultValue = u.DefaultValue, + }).ToList(); + + // 获取实体的属性信息,赋值给PropertyName属性(CodeFirst模式应以PropertyName为实际使用名称) + var entityProperties = entityType.Type.GetProperties(); + for (int i = result.Count - 1; i >= 0; i--) + { + var columnOutput = result[i]; + // 先找自定义字段名的,如果找不到就再找自动生成字段名的(并且过滤掉没有SugarColumn的属性) + var propertyInfo = entityProperties.FirstOrDefault(u => (u.GetCustomAttribute()?.ColumnName ?? "").ToLower() == columnOutput.ColumnName.ToLower()) ?? + entityProperties.FirstOrDefault(u => u.GetCustomAttribute() != null && u.Name.ToLower() == (config.DbSettings.EnableUnderLine + ? CodeGenUtil.CamelColumnName(columnOutput.ColumnName, entityBasePropertyNames).ToLower() + : columnOutput.ColumnName.ToLower())); + if (propertyInfo != null) + { + columnOutput.PropertyName = propertyInfo.Name; + columnOutput.ColumnComment = propertyInfo.GetCustomAttribute()!.ColumnDescription; + } + else + { + result.RemoveAt(i); // 移除没有定义此属性的字段 + } + } + return result; + } + + /// + /// 获取库表信息 + /// + /// 是否排除带SysTable属性的表 + /// + public async Task> GetEntityInfos(bool excludeSysTable = false) + { + var types = new List(); + if (_codeGenOptions.EntityAssemblyNames != null) + { + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + foreach (var assembly in assemblies) + { + var assemblyName = assembly.GetName().Name!; + if (_codeGenOptions.EntityAssemblyNames.Contains(assemblyName) || _codeGenOptions.EntityAssemblyNames.Any(name => assemblyName.Contains(name))) + { + Assembly asm = Assembly.Load(assemblyName); + types.AddRange(asm.GetExportedTypes().ToList()); + } + } + } + var sugarTableType = typeof(SugarTable); + bool IsMyAttribute(Attribute[] o) + { + foreach (Attribute a in o) + { + if (a.GetType() == sugarTableType) + return true; + } + return false; + } + Type[] cosType = types.Where(u => IsMyAttribute(Attribute.GetCustomAttributes(u, false))).ToArray(); + + var entityInfos = new List(); + foreach (var ct in cosType) + { + // 若实体贴[SysTable]特性,则禁止显示系统自带的 + if (excludeSysTable && ct.IsDefined(typeof(SysTableAttribute), false)) + continue; + + var des = ct.GetCustomAttributes(typeof(DescriptionAttribute), false); + var description = des.Length > 0 ? ((DescriptionAttribute)des[0]).Description : ""; + var sugarAttribute = ct.GetCustomAttributes(sugarTableType, true).FirstOrDefault(); + + entityInfos.Add(new EntityInfo() + { + EntityName = ct.Name, + DbTableName = sugarAttribute == null ? ct.Name : ((SugarTable)sugarAttribute).TableName, + TableDescription = sugarAttribute == null ? description : ((SugarTable)sugarAttribute).TableDescription, + Type = ct + }); + } + return await Task.FromResult(entityInfos); } /// @@ -27,6 +166,41 @@ public class SysCodeGenConfigService : IDynamicApiController, ITransient [DisplayName("获取代码生成配置列表")] public async Task> GetList([FromQuery] CodeGenConfig input) { + // 获取主表 + var codeGenTable = _db.Queryable().Single(u => u.Id == input.CodeGenId); + // 获取配置的字段 + var genConfigColumnList = await _db.Queryable().Where(u => u.CodeGenId == input.CodeGenId).ToListAsync(); + // 获取实体所有字段 + var tableColumnList = GetColumnList(codeGenTable.TableName, codeGenTable.ConfigId); + // 获取新增的字段 + var addColumnList = tableColumnList.Where(u => !genConfigColumnList.Select(d => d.ColumnName).Contains(u.ColumnName)).ToList(); + // 获取删除的字段 + var delColumnList = genConfigColumnList.Where(u => !tableColumnList.Select(d => d.ColumnName).Contains(u.ColumnName)).ToList(); + // 获取更新的字段 + var updateColumnList = new List(); + foreach (var column in genConfigColumnList) + { + // 获取没有增减的 + if (tableColumnList.Any(u => u.ColumnName == column.ColumnName)) + { + var nmd = tableColumnList.Single(u => u.ColumnName == column.ColumnName); + // 如果数据库类型或者长度改变 + if (nmd.NetType != column.NetType || nmd.ColumnLength != column.ColumnLength || nmd.ColumnComment != column.ColumnComment) + { + column.NetType = nmd.NetType; + column.ColumnLength = nmd.ColumnLength; + column.ColumnComment = nmd.ColumnComment; + updateColumnList.Add(column); + } + } + } + // 增加新增的 + if (addColumnList.Count > 0) AddList(addColumnList, codeGenTable); + // 删除没有的 + if (delColumnList.Count > 0) await _db.Deleteable(delColumnList).ExecuteCommandAsync(); + // 更新配置 + if (updateColumnList.Count > 0) await _db.Updateable(updateColumnList).ExecuteCommandAsync(); + // 重新获取配置 return await _db.Queryable() .Where(u => u.CodeGenId == input.CodeGenId) .Select() @@ -48,6 +222,7 @@ public class SysCodeGenConfigService : IDynamicApiController, ITransient public async Task UpdateCodeGenConfig(List inputList) { if (inputList == null || inputList.Count < 1) return; + await _db.Updateable(inputList.Adapt>()) .IgnoreColumns(u => new { u.ColumnLength, u.ColumnName, u.PropertyName }) .ExecuteCommandAsync(); diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs index ae463436..70b1bd0d 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs @@ -77,7 +77,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient .ExecuteReturnEntityAsync(); // 增加配置表 - _codeGenConfigService.AddList(GetColumnList(input), newCodeGen); + _codeGenConfigService.AddList(_codeGenConfigService.GetColumnList(input), newCodeGen); } /// @@ -108,9 +108,10 @@ public class SysCodeGenService : IDynamicApiController, ITransient [DisplayName("更新代码生成")] public async Task UpdateCodeGen(UpdateCodeGenInput input) { - var isExist = await _db.Queryable().AnyAsync(u => u.TableName == input.TableName && u.Id != input.Id); - if (isExist) - throw Oops.Oh(ErrorCodeEnum.D1400); + //开发阶段不断生成调整 + //var isExist = await _db.Queryable().AnyAsync(u => u.TableName == input.TableName && u.Id != input.Id); + //if (isExist) + // throw Oops.Oh(ErrorCodeEnum.D1400); var codeGen = input.Adapt(); var templateRelations = GetCodeGenTemplateRelation(codeGen.Id, input.CodeGenTemplateIds); @@ -121,7 +122,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient .ExecuteCommandAsync(); // 更新配置表 - _codeGenConfigService.AddList(GetColumnList(input.Adapt()), codeGen); + _codeGenConfigService.AddList(_codeGenConfigService.GetColumnList(input.Adapt()), codeGen); } /// @@ -183,7 +184,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient var config = _dbConnectionOptions.ConnectionConfigs.FirstOrDefault(u => configId.Equals(u.ConfigId)); - IEnumerable entityInfos = await GetEntityInfos(); // 获取所有实体定义 + IEnumerable entityInfos = await _codeGenConfigService.GetEntityInfos(); // 获取所有实体定义 entityInfos = entityInfos.OrderBy(u => u.EntityName.StartsWith("Sys") ? 1 : 0).ThenBy(u => u.EntityName); var tableOutputList = new List(); @@ -225,10 +226,10 @@ public class SysCodeGenService : IDynamicApiController, ITransient // 获取实体类型属性 var entityType = provider.DbMaintenance.GetTableInfoList(false).FirstOrDefault(u => u.Name == tableName); if (entityType == null) return null; - var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenant)]; + var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenantBaseData)]; tableName = GetRealTableName(tableName); - var properties = GetEntityInfos().Result.First(u => GetRealTableName(u.DbTableName).EqualIgnoreCase(tableName)).Type.GetProperties() + var properties = _codeGenConfigService.GetEntityInfos().Result.First(u => GetRealTableName(u.DbTableName).EqualIgnoreCase(tableName)).Type.GetProperties() .Where(u => u.GetCustomAttribute()?.IsIgnore == false).Select(u => new { PropertyName = u.Name, @@ -269,128 +270,6 @@ public class SysCodeGenService : IDynamicApiController, ITransient } } - /// - /// 获取数据表列(实体属性)集合 - /// - /// - private List GetColumnList([FromQuery] AddCodeGenInput input) - { - var entityType = GetEntityInfos().GetAwaiter().GetResult().FirstOrDefault(u => u.EntityName == input.TableName); - if (entityType == null) - return null; - var config = _dbConnectionOptions.ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == input.ConfigId); - var dbTableName = config!.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(entityType.DbTableName) : entityType.DbTableName; - - int bracketIndex = dbTableName.IndexOf('{'); - if (bracketIndex != -1) - { - dbTableName = dbTableName.Substring(0, bracketIndex); - var dbTableInfos = _db.AsTenant().GetConnectionScope(input.ConfigId).DbMaintenance.GetTableInfoList(false); - var table = dbTableInfos.FirstOrDefault(x => x.Name.StartsWith(config.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(dbTableName) : dbTableName, StringComparison.CurrentCultureIgnoreCase)); - if (table != null) - dbTableName = table.Name; - } - - // 切库---多库代码生成用 - var provider = _db.AsTenant().GetConnectionScope(!string.IsNullOrEmpty(input.ConfigId) ? input.ConfigId : SqlSugarConst.MainConfigId); - - var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenant)]; - var columnInfos = provider.DbMaintenance.GetColumnInfosByTableName(dbTableName, false); - var result = columnInfos.Select(u => new ColumnOuput - { - // 转下划线后的列名需要再转回来(暂时不转) - //ColumnName = config.DbSettings.EnableUnderLine ? CodeGenUtil.CamelColumnName(u.DbColumnName, entityBasePropertyNames) : u.DbColumnName, - ColumnName = u.DbColumnName, - ColumnLength = u.Length, - IsPrimarykey = u.IsPrimarykey, - IsNullable = u.IsNullable, - ColumnKey = u.IsPrimarykey.ToString(), - NetType = CodeGenUtil.ConvertDataType(u, provider.CurrentConnectionConfig.DbType), - DataType = u.DataType, - ColumnComment = string.IsNullOrWhiteSpace(u.ColumnDescription) ? u.DbColumnName : u.ColumnDescription, - DefaultValue = u.DefaultValue, - }).ToList(); - - // 获取实体的属性信息,赋值给PropertyName属性(CodeFirst模式应以PropertyName为实际使用名称) - var entityProperties = entityType.Type.GetProperties(); - - for (int i = result.Count - 1; i >= 0; i--) - { - var columnOutput = result[i]; - // 先找自定义字段名的,如果找不到就再找自动生成字段名的(并且过滤掉没有SugarColumn的属性) - var propertyInfo = entityProperties.FirstOrDefault(u => (u.GetCustomAttribute()?.ColumnName ?? "").ToLower() == columnOutput.ColumnName.ToLower()) ?? - entityProperties.FirstOrDefault(u => u.GetCustomAttribute() != null && u.Name.ToLower() == (config.DbSettings.EnableUnderLine - ? CodeGenUtil.CamelColumnName(columnOutput.ColumnName, entityBasePropertyNames).ToLower() - : columnOutput.ColumnName.ToLower())); - if (propertyInfo != null) - { - columnOutput.PropertyName = propertyInfo.Name; - columnOutput.ColumnComment = propertyInfo.GetCustomAttribute()!.ColumnDescription; - } - else - { - result.RemoveAt(i); // 移除没有定义此属性的字段 - } - } - return result; - } - - /// - /// 获取库表信息 - /// - /// 是否排除带SysTable属性的表 - /// - private async Task> GetEntityInfos(bool excludeSysTable = false) - { - var types = new List(); - if (_codeGenOptions.EntityAssemblyNames != null) - { - var assemblies = AppDomain.CurrentDomain.GetAssemblies(); - foreach (var assembly in assemblies) - { - var assemblyName = assembly.GetName().Name!; - if (_codeGenOptions.EntityAssemblyNames.Contains(assemblyName) || _codeGenOptions.EntityAssemblyNames.Any(name => assemblyName.Contains(name))) - { - Assembly asm = Assembly.Load(assemblyName); - types.AddRange(asm.GetExportedTypes().ToList()); - } - } - } - var sugarTableType = typeof(SugarTable); - bool IsMyAttribute(Attribute[] o) - { - foreach (Attribute a in o) - { - if (a.GetType() == sugarTableType) - return true; - } - return false; - } - Type[] cosType = types.Where(u => IsMyAttribute(Attribute.GetCustomAttributes(u, false))).ToArray(); - - var entityInfos = new List(); - foreach (var ct in cosType) - { - // 若实体贴[SysTable]特性,则禁止显示系统自带的 - if (excludeSysTable && ct.IsDefined(typeof(SysTableAttribute), false)) - continue; - - var des = ct.GetCustomAttributes(typeof(DescriptionAttribute), false); - var description = des.Length > 0 ? ((DescriptionAttribute)des[0]).Description : ""; - - var sugarAttribute = ct.GetCustomAttributes(sugarTableType, true).FirstOrDefault(); - - entityInfos.Add(new EntityInfo() - { - EntityName = ct.Name, - DbTableName = sugarAttribute == null ? ct.Name : ((SugarTable)sugarAttribute).TableName, - TableDescription = sugarAttribute == null ? description : ((SugarTable)sugarAttribute).TableDescription, - Type = ct - }); - } - return await Task.FromResult(entityInfos); - } - /// /// 获取程序保存位置 🔖 /// @@ -414,15 +293,13 @@ public class SysCodeGenService : IDynamicApiController, ITransient if (Directory.Exists(outputPath)) Directory.Delete(outputPath, true); var tableFieldList = await _codeGenConfigService.GetList(new CodeGenConfig { CodeGenId = input.Id }); // 字段集合 - ProcessTableFieldList(tableFieldList); // 处理字段集合 var queryWhetherList = tableFieldList.Where(u => u.QueryWhether == YesNoEnum.Y.ToString()).ToList(); // 前端查询集合 var joinTableList = tableFieldList.Where(u => u.EffectType is "Upload" or "ForeignKey" or "ApiTreeSelector").ToList(); // 需要连表查询的字段 - var data = CreateCustomViewEngine(input, tableFieldList, queryWhetherList, joinTableList); // 创建视图引擎数据 - // 获得菜单 + // 获取菜单 var menuList = await GetMenus(input.TableName!, input.BusName!, input.MenuPid ?? 0, input.MenuIcon!, input.PagePath!, tableFieldList); if (input.GenerateMenu) { @@ -435,7 +312,6 @@ public class SysCodeGenService : IDynamicApiController, ITransient for (var i = 0; i < templateList.Count; i++) { string tResult = await ProcessTemplate(templateList[i], input, templatePath, data, menuList); // 处理模板 - string targetFile = templateList[i].OutputFile .Replace("{PagePath}", input.PagePath) .Replace("{TableName}", input.TableName) @@ -454,7 +330,6 @@ public class SysCodeGenService : IDynamicApiController, ITransient tmpPath = templateList[i].Type == CodeGenTypeEnum.Frontend ? Path.Combine(outputPath, _codeGenOptions.FrontRootPath, "src") : Path.Combine(outputPath, input!.NameSpace!); } targetFile = Path.Combine(tmpPath, targetFile); - var dirPath = new DirectoryInfo(targetFile).Parent!.FullName; if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath); @@ -478,12 +353,10 @@ public class SysCodeGenService : IDynamicApiController, ITransient public async Task> Preview(SysCodeGen input) { var tableFieldList = await _codeGenConfigService.GetList(new CodeGenConfig { CodeGenId = input.Id }); // 字段集合 - ProcessTableFieldList(tableFieldList); // 处理字段集合 var queryWhetherList = tableFieldList.Where(u => u.QueryWhether == YesNoEnum.Y.ToString()).ToList(); // 前端查询集合 var joinTableList = tableFieldList.Where(u => u.EffectType is "Upload" or "ForeignKey" or "ApiTreeSelector").ToList(); // 需要连表查询的字段 - var data = CreateCustomViewEngine(input, tableFieldList, queryWhetherList, joinTableList); // 创建视图引擎数据 // 获取模板文件并替换 @@ -493,8 +366,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient await _db.Ado.BeginTranAsync(); try { - var menuList = await GetMenus(input.TableName!, input.BusName!, input.MenuPid ?? 0, input.MenuIcon!, - input.PagePath!, tableFieldList); + var menuList = await GetMenus(input.TableName!, input.BusName!, input.MenuPid ?? 0, input.MenuIcon!, input.PagePath!, tableFieldList); var result = new Dictionary(); foreach (var template in templateList) { @@ -521,18 +393,16 @@ public class SysCodeGenService : IDynamicApiController, ITransient if (!string.IsNullOrWhiteSpace(item.Rules)) { if (item.Rules != "[]") - { list = JSON.Deserialize>(item.Rules); - } } else { item.Rules = "[]"; } item.RuleItems = list; - item.WhetherRequired = list.Any(t => t.Type == "required") ? YesNoEnum.Y.ToString() : YesNoEnum.N.ToString(); + item.WhetherRequired = list.Any(u => u.Type == "required") ? YesNoEnum.Y.ToString() : YesNoEnum.N.ToString(); item.AnyRule = list.Count > 0; - item.RemoteVerify = list.Any(t => t.Type == "remote"); + item.RemoteVerify = list.Any(u => u.Type == "remote"); } } @@ -599,7 +469,8 @@ public class SysCodeGenService : IDynamicApiController, ITransient if (filename == "web_views_index.vue.vm") { filename = string.IsNullOrEmpty(input.LeftTab) ? filename : "web_views_LeftTree.vue.vm"; // 左树右列表 - filename = string.IsNullOrEmpty(input.BottomTab) ? filename : "web_views_BottomIndx.vue.vm"; // 左数右上列表下列表属性 + filename = (!string.IsNullOrEmpty(input.LeftTab) && !string.IsNullOrEmpty(input.BottomTab)) ? "web_views_BottomIndx.vue.vm" : filename; // 左树右上列表下列表属性 + filename = (string.IsNullOrEmpty(input.LeftTab) && !string.IsNullOrEmpty(input.BottomTab)) ? "web_views_UDIndx.vue.vm" : filename; // 右上列表下列表属性 } var templateFilePath = Path.Combine(templatePath, filename); if (!File.Exists(templateFilePath)) return null; diff --git a/Admin.NET/Admin.NET.Core/Service/Common/SysCommonService.cs b/Admin.NET/Admin.NET.Core/Service/Common/SysCommonService.cs index 22e03192..e416dbb9 100644 --- a/Admin.NET/Admin.NET.Core/Service/Common/SysCommonService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Common/SysCommonService.cs @@ -183,11 +183,11 @@ public class SysCommonService : IDynamicApiController, ITransient } /// - /// 生成所有移动端接口 🔖 + /// 生成所有移动端接口文件 🔖 /// /// [HttpGet] - [DisplayName("生成所有移动端接口")] + [DisplayName("生成所有移动端接口文件")] public void GenerateAppApi([FromQuery] string groupName = "", [FromQuery] bool isAppApi = true) { var defaultRoutePrefix = App.GetOptions().DefaultRoutePrefix; diff --git a/Admin.NET/Admin.NET.Core/Service/DataBase/SysDatabaseService.cs b/Admin.NET/Admin.NET.Core/Service/DataBase/SysDatabaseService.cs index 0108f9f0..b32932fd 100644 --- a/Admin.NET/Admin.NET.Core/Service/DataBase/SysDatabaseService.cs +++ b/Admin.NET/Admin.NET.Core/Service/DataBase/SysDatabaseService.cs @@ -4,6 +4,7 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! +using Admin.NET.Core; using Newtonsoft.Json.Converters; using Npgsql; @@ -271,6 +272,37 @@ public class SysDatabaseService : IDynamicApiController, ITransient [ApiDescriptionSettings(Name = "CreateEntity"), HttpPost] [DisplayName("创建实体")] public void CreateEntity(CreateEntityInput input) + { + var tResult = GenerateEntity(input); + var targetPath = GetEntityTargetPath(input); + File.WriteAllText(targetPath, tResult, Encoding.UTF8); + } + + /// + /// 创建实体文件内容 + /// + /// + /// + /// + /// + /// + public string GenerateEntity(string ConfigId, string TableName, string Position, string BaseClassName) + { + var input = new CreateEntityInput(); + input.TableName = TableName; + input.EntityName = TableName.ToFirstLetterUpperCase(); + input.ConfigId = ConfigId; + input.Position = string.IsNullOrWhiteSpace(Position) ? "Admin.NET.Application" : Position; + input.BaseClassName = string.IsNullOrWhiteSpace(BaseClassName) ? "EntityBaseId" : BaseClassName; + return GenerateEntity(input); + } + + /// + /// 创建实体文件内容 + /// + /// + /// + public string GenerateEntity(CreateEntityInput input) { var config = App.GetOptions().ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == input.ConfigId); input.Position = string.IsNullOrWhiteSpace(input.Position) ? "Admin.NET.Application" : input.Position; @@ -307,8 +339,8 @@ public class SysDatabaseService : IDynamicApiController, ITransient Description = string.IsNullOrWhiteSpace(dbTableInfo.Description) ? input.EntityName + "业务表" : dbTableInfo.Description, TableField = dbColumnInfos }); - var targetPath = GetEntityTargetPath(input); - File.WriteAllText(targetPath, tResult, Encoding.UTF8); + + return tResult; } /// diff --git a/Admin.NET/Admin.NET.Core/Service/Message/SysSmsService.cs b/Admin.NET/Admin.NET.Core/Service/Message/SysSmsService.cs index 4b718eca..709b109f 100644 --- a/Admin.NET/Admin.NET.Core/Service/Message/SysSmsService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Message/SysSmsService.cs @@ -74,10 +74,10 @@ public class SysSmsService : IDynamicApiController, ITransient var random = new Random(); var verifyCode = random.Next(100000, 999999); - var templateParam = Clay.Object(new + var templateParam = new { code = verifyCode - }); + }; var client = CreateAliyunClient(); var template = _smsOptions.Aliyun.GetTemplate(); diff --git a/Admin.NET/Admin.NET.Core/Service/Tenant/Dto/SysInfoInput.cs b/Admin.NET/Admin.NET.Core/Service/Tenant/Dto/SysInfoInput.cs index 7d7fdb5b..280a1ae1 100644 --- a/Admin.NET/Admin.NET.Core/Service/Tenant/Dto/SysInfoInput.cs +++ b/Admin.NET/Admin.NET.Core/Service/Tenant/Dto/SysInfoInput.cs @@ -97,4 +97,9 @@ public class SysInfoInput /// 登录二次验证 /// public bool SecondVer { get; set; } = false; + + /// + /// 轮播图 + /// + public List CarouselFiles { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs b/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs index 956a79a6..c8b510e3 100644 --- a/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs @@ -20,10 +20,12 @@ public class SysTenantService : IDynamicApiController, ITransient private readonly SqlSugarRepository _sysUserExtOrgRep; private readonly SqlSugarRepository _sysRoleMenuRep; private readonly SqlSugarRepository _userRoleRep; + private readonly SqlSugarRepository _fileRep; private readonly SysUserRoleService _sysUserRoleService; private readonly SysRoleMenuService _sysRoleMenuService; private readonly SysConfigService _sysConfigService; private readonly SysCacheService _sysCacheService; + private readonly SysFileService _sysFileService; private readonly IEventPublisher _eventPublisher; public SysTenantService(SqlSugarRepository sysTenantRep, @@ -34,10 +36,12 @@ public class SysTenantService : IDynamicApiController, ITransient SqlSugarRepository sysUserExtOrgRep, SqlSugarRepository sysRoleMenuRep, SqlSugarRepository userRoleRep, + SqlSugarRepository fileRep, SysUserRoleService sysUserRoleService, SysRoleMenuService sysRoleMenuService, SysConfigService sysConfigService, SysCacheService sysCacheService, + SysFileService sysFileService, IEventPublisher eventPublisher) { _sysTenantRep = sysTenantRep; @@ -48,10 +52,12 @@ public class SysTenantService : IDynamicApiController, ITransient _sysUserExtOrgRep = sysUserExtOrgRep; _sysRoleMenuRep = sysRoleMenuRep; _userRoleRep = userRoleRep; + _fileRep = fileRep; _sysUserRoleService = sysUserRoleService; _sysRoleMenuService = sysRoleMenuService; _sysConfigService = sysConfigService; _sysCacheService = sysCacheService; + _sysFileService = sysFileService; _eventPublisher = eventPublisher; } @@ -81,6 +87,7 @@ public class SysTenantService : IDynamicApiController, ITransient RealName = a.RealName, Phone = a.Phone, Email = a.Email, + Host = u.Host, ExpirationTime = u.ExpirationTime, TenantType = u.TenantType, DbType = u.DbType, @@ -566,11 +573,12 @@ public class SysTenantService : IDynamicApiController, ITransient var tenant = await _sysTenantRep.GetFirstAsync(u => u.Id == tenantId); if (tenant == null) return ""; - // 若租户系统标题为空,则获取默认租户系统信息 + // 若租户系统标题为空,则获取默认租户系统信息(兼容已有未配置的租户) if (string.IsNullOrWhiteSpace(tenant.Title)) tenant = await _sysTenantRep.GetFirstAsync(u => u.Id == SqlSugarConst.DefaultTenantId); // 获取首页轮播图列表 + var carouselFiles = await _fileRep.GetListAsync(u => u.BelongId == tenant.Id && u.RelationId == tenant.Id && u.FileType == "Carousel"); var forceChangePassword = await _sysConfigService.GetConfigValueByCode(ConfigConst.SysForceChangePassword); // 强制修改密码 var passwordExpirationTime = await _sysConfigService.GetConfigValueByCode(ConfigConst.SysPasswordExpirationTime); // 密码有效期 @@ -595,7 +603,8 @@ public class SysTenantService : IDynamicApiController, ITransient tenant.SecondVer, ForceChangePassword = forceChangePassword, PasswordExpirationTime = passwordExpirationTime, - PublicKey = publicKey + PublicKey = publicKey, + CarouselFiles = carouselFiles }; } @@ -629,8 +638,8 @@ public class SysTenantService : IDynamicApiController, ITransient // 根据文件名取扩展名 var ext = string.IsNullOrWhiteSpace(input.LogoFileName) ? ".png" : Path.GetExtension(input.LogoFileName); // 本地图标保存路径 - var path = "upload"; - var fileName = $"{input.TenantId}-logo{ext}".ToLower(); + var path = $"upload/{input.TenantId}/"; + var fileName = $"logo{ext}".ToLower(); var absoluteFilePath = Path.Combine(App.WebHostEnvironment.WebRootPath, path, fileName); // 删除已存在文件 @@ -648,6 +657,61 @@ public class SysTenantService : IDynamicApiController, ITransient // 保存图标配置 tenant.Logo = $"/{path}/{fileName}"; } - await _sysTenantRep.AsUpdateable(tenant).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + + await _sysTenantRep.AsUpdateable(tenant) + .UpdateColumns(u => new + { + u.Logo, + u.Title, + u.ViceTitle, + u.ViceDesc, + u.Copyright, + u.Icp, + u.IcpUrl, + u.Watermark, + u.Version, + u.ThemeColor, + u.Layout, + u.Animation, + u.Captcha, + u.SecondVer + }) + .ExecuteCommandAsync(); + } + + /// + /// 上传轮播图单文件 🔖 + /// + /// + /// + [DisplayName("上传轮播图单文件")] + public async Task UploadCarouselFile([Required] IFormFile file) + { + var tenantId = long.Parse(App.User?.FindFirst(ClaimConst.TenantId)?.Value ?? "0"); + if (tenantId < 1) tenantId = SqlSugarConst.DefaultTenantId; + var tenant = await _sysTenantRep.GetFirstAsync(u => u.Id == tenantId); + if (tenant == null) return null; + + if (file == null) + throw Oops.Oh(ErrorCodeEnum.D8000); + + // 本地轮播图保存路径 + var path = $"upload/{tenantId}/carousel"; + var absoluteDirPath = Path.Combine(App.WebHostEnvironment.WebRootPath, path); + + // 创建文件夹 + if (!Directory.Exists(absoluteDirPath)) + Directory.CreateDirectory(absoluteDirPath); + + // 保存轮播图文件 + var sysFile = await _sysFileService.UploadFile(new UploadFileInput { File = file, FileType = "Carousel", SavePath = path }); + + // 保存轮播图配置 + sysFile.BelongId = tenant.Id; + sysFile.RelationId = tenant.Id; + + await _sysFileService.UpdateFile(sysFile); + + return sysFile; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Web.Core/Handlers/JwtHandler.cs b/Admin.NET/Admin.NET.Web.Core/Handlers/JwtHandler.cs index 1129299f..2d35cb3f 100644 --- a/Admin.NET/Admin.NET.Web.Core/Handlers/JwtHandler.cs +++ b/Admin.NET/Admin.NET.Web.Core/Handlers/JwtHandler.cs @@ -100,18 +100,19 @@ namespace Admin.NET.Web.Core if (App.User.FindFirst(ClaimConst.AccountType)?.Value == ((int)AccountTypeEnum.SuperAdmin).ToString()) return true; + var serviceScope = httpContext.RequestServices.CreateScope(); + // 当前接口路由 var path = httpContext.Request.Path.ToString(); // 移动端接口权限判断 if (App.User.FindFirst(ClaimConst.LoginMode)?.Value == ((int)LoginModeEnum.APP).ToString()) { - var appApiList = App.GetRequiredService().GetAppApiList(); // 获取移动端所有接口 + var appApiList = serviceScope.ServiceProvider.GetRequiredService().GetAppApiList(); return appApiList.Exists(u => path.EndsWith(u, StringComparison.CurrentCultureIgnoreCase)); } // 获取当前用户按钮权限集合和接口黑名单 - var serviceScope = httpContext.RequestServices.CreateScope(); var sysRoleService = serviceScope.ServiceProvider.GetRequiredService(); var roleApis = await sysRoleService.GetUserApiList(); diff --git a/Admin.NET/Admin.NET.Web.Entry/Alipaycrt/alipayPublicCert.crt b/Admin.NET/Admin.NET.Web.Entry/Alipaycrt/alipayPublicCert.crt new file mode 100644 index 00000000..5ced5641 --- /dev/null +++ b/Admin.NET/Admin.NET.Web.Entry/Alipaycrt/alipayPublicCert.crt @@ -0,0 +1,38 @@ +-----BEGIN CERTIFICATE----- +MIIDszCCApugAwIBAgIQICQSIl9wqwjbcsS1A/zPajANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE +BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjQxMjIyMTE0NzAzWhcNMjUxMjIyMTE0NzAzWjCB +hDELMAkGA1UEBhMCQ04xHzAdBgNVBAoMFm10cXdudzEyODlAc2FuZGJveC5jb20xDzANBgNVBAsM +BkFsaXBheTFDMEEGA1UEAww65pSv5LuY5a6dKOS4reWbvSnnvZHnu5zmioDmnK/mnInpmZDlhazl +j7gtMjA4ODcyMTA1MzI1NzEzMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIPs9UeN +0Hhp0qFTXE51E/a2EQ7YmMI8dJdBLWP17Irzo1I1Zxw3BIsrxEsdPJSGr76oQlunEyWYNyiVsOaL +6KE8V1FK6uPSJr5BK5W9o3wKg3XX7BKdflyB4964uRNJOOPpqNi4vwY1ZZFVpSHrZJ0ZAthDHGYo +o3/zdEEIwEWRkVAtMC6pJa8K0qk3qyaqHRMzwO3r13Ex8q/7+kO1iOsQ5UFQwKeV/g6/NuyEW9BZ +6y59BehHQBqf51ZJcPa91Dc6va/C6McKe/OWd+km9EFwjab0L2GvwdRtrxUAikR0tghgvx3fAfJw +nkfdjTzYUi/umDuVJlyW6xg0p9cJwLcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3 +DQEBCwUAA4IBAQAoaQR/LYaBNMQ9pjEAHNaLdheebL6TbDNI8thKYAhMKFfeJ4ZNZPwqg2FnCfhf +eVJctLqJtxgzzl0vazVGeFJRwrMvJXkZsU9veRjLP1s4QUOO5NqjxkDNuQnFnQZBsySLWkM/+0f3 +AcFImbXVUDuod/KnPZ6i2gbYNmaADAvYM8M87aqbvrfbLHBk6wtHR21l9MMu1BXyAlJn29k47xYj +XNRJo6292M4Y4fyGFxT7tC+kt+MA6WUTl4hB+PvuXJh26tUOEo6EcXAZekcDJNOLCioNTW9/ck4P +bj2Qxvouztndmd3zsT+flLiImEtGgRaClveKuUwrd9rzWLNkl2lw +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDszCCApugAwIBAgIQIBkIGbgVxq210KxLJ+YA/TANBgkqhkiG9w0BAQsFADCBhDELMAkGA1UE +BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxJTAjBgNVBAsMHENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IHRlc3QxNjA0BgNVBAMMLUFudCBGaW5hbmNpYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgUjEgdGVzdDAeFw0xOTA4MTkxMTE2MDBaFw0yNDA4MDExMTE2MDBaMIGRMQswCQYDVQQGEwJD +TjEbMBkGA1UECgwSQW50IEZpbmFuY2lhbCB0ZXN0MSUwIwYDVQQLDBxDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eSB0ZXN0MT4wPAYDVQQDDDVBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IENsYXNzIDIgUjEgdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMh4FKYO +ZyRQHD6eFbPKZeSAnrfjfU7xmS9Yoozuu+iuqZlb6Z0SPLUqqTZAFZejOcmr07ln/pwZxluqplxC +5+B48End4nclDMlT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm +VUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi +t25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG +wpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3 +DQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT +yWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf +LTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p +j1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy +1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW +-----END CERTIFICATE----- diff --git a/Admin.NET/Admin.NET.Web.Entry/Alipaycrt/alipayRootCert.crt b/Admin.NET/Admin.NET.Web.Entry/Alipaycrt/alipayRootCert.crt new file mode 100644 index 00000000..d129c75e --- /dev/null +++ b/Admin.NET/Admin.NET.Web.Entry/Alipaycrt/alipayRootCert.crt @@ -0,0 +1,88 @@ +-----BEGIN CERTIFICATE----- +MIIBszCCAVegAwIBAgIIaeL+wBcKxnswDAYIKoEcz1UBg3UFADAuMQswCQYDVQQG +EwJDTjEOMAwGA1UECgwFTlJDQUMxDzANBgNVBAMMBlJPT1RDQTAeFw0xMjA3MTQw +MzExNTlaFw00MjA3MDcwMzExNTlaMC4xCzAJBgNVBAYTAkNOMQ4wDAYDVQQKDAVO +UkNBQzEPMA0GA1UEAwwGUk9PVENBMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE +MPCca6pmgcchsTf2UnBeL9rtp4nw+itk1Kzrmbnqo05lUwkwlWK+4OIrtFdAqnRT +V7Q9v1htkv42TsIutzd126NdMFswHwYDVR0jBBgwFoAUTDKxl9kzG8SmBcHG5Yti +W/CXdlgwDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFEwysZfZ +MxvEpgXBxuWLYlvwl3ZYMAwGCCqBHM9VAYN1BQADSAAwRQIgG1bSLeOXp3oB8H7b +53W+CKOPl2PknmWEq/lMhtn25HkCIQDaHDgWxWFtnCrBjH16/W3Ezn7/U/Vjo5xI +pDoiVhsLwg== +-----END CERTIFICATE----- + +-----BEGIN CERTIFICATE----- +MIIF0zCCA7ugAwIBAgIIH8+hjWpIDREwDQYJKoZIhvcNAQELBQAwejELMAkGA1UE +BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmlj +YXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5jaWFsIENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5IFIxMB4XDTE4MDMyMTEzNDg0MFoXDTM4MDIyODEzNDg0 +MFowejELMAkGA1UEBhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNV +BAsMF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5j +aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFIxMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEAtytTRcBNuur5h8xuxnlKJetT65cHGemGi8oD+beHFPTk +rUTlFt9Xn7fAVGo6QSsPb9uGLpUFGEdGmbsQ2q9cV4P89qkH04VzIPwT7AywJdt2 +xAvMs+MgHFJzOYfL1QkdOOVO7NwKxH8IvlQgFabWomWk2Ei9WfUyxFjVO1LVh0Bp +dRBeWLMkdudx0tl3+21t1apnReFNQ5nfX29xeSxIhesaMHDZFViO/DXDNW2BcTs6 +vSWKyJ4YIIIzStumD8K1xMsoaZBMDxg4itjWFaKRgNuPiIn4kjDY3kC66Sl/6yTl +YUz8AybbEsICZzssdZh7jcNb1VRfk79lgAprm/Ktl+mgrU1gaMGP1OE25JCbqli1 +Pbw/BpPynyP9+XulE+2mxFwTYhKAwpDIDKuYsFUXuo8t261pCovI1CXFzAQM2w7H +DtA2nOXSW6q0jGDJ5+WauH+K8ZSvA6x4sFo4u0KNCx0ROTBpLif6GTngqo3sj+98 +SZiMNLFMQoQkjkdN5Q5g9N6CFZPVZ6QpO0JcIc7S1le/g9z5iBKnifrKxy0TQjtG +PsDwc8ubPnRm/F82RReCoyNyx63indpgFfhN7+KxUIQ9cOwwTvemmor0A+ZQamRe +9LMuiEfEaWUDK+6O0Gl8lO571uI5onYdN1VIgOmwFbe+D8TcuzVjIZ/zvHrAGUcC +AwEAAaNdMFswCwYDVR0PBAQDAgEGMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFF90 +tATATwda6uWx2yKjh0GynOEBMB8GA1UdIwQYMBaAFF90tATATwda6uWx2yKjh0Gy +nOEBMA0GCSqGSIb3DQEBCwUAA4ICAQCVYaOtqOLIpsrEikE5lb+UARNSFJg6tpkf +tJ2U8QF/DejemEHx5IClQu6ajxjtu0Aie4/3UnIXop8nH/Q57l+Wyt9T7N2WPiNq +JSlYKYbJpPF8LXbuKYG3BTFTdOVFIeRe2NUyYh/xs6bXGr4WKTXb3qBmzR02FSy3 +IODQw5Q6zpXj8prYqFHYsOvGCEc1CwJaSaYwRhTkFedJUxiyhyB5GQwoFfExCVHW +05ZFCAVYFldCJvUzfzrWubN6wX0DD2dwultgmldOn/W/n8at52mpPNvIdbZb2F41 +T0YZeoWnCJrYXjq/32oc1cmifIHqySnyMnavi75DxPCdZsCOpSAT4j4lAQRGsfgI +kkLPGQieMfNNkMCKh7qjwdXAVtdqhf0RVtFILH3OyEodlk1HYXqX5iE5wlaKzDop +PKwf2Q3BErq1xChYGGVS+dEvyXc/2nIBlt7uLWKp4XFjqekKbaGaLJdjYP5b2s7N +1dM0MXQ/f8XoXKBkJNzEiM3hfsU6DOREgMc1DIsFKxfuMwX3EkVQM1If8ghb6x5Y +jXayv+NLbidOSzk4vl5QwngO/JYFMkoc6i9LNwEaEtR9PhnrdubxmrtM+RjfBm02 +77q3dSWFESFQ4QxYWew4pHE0DpWbWy/iMIKQ6UZ5RLvB8GEcgt8ON7BBJeMc+Dyi +kT9qhqn+lw== +-----END CERTIFICATE----- + +-----BEGIN CERTIFICATE----- +MIICiDCCAgygAwIBAgIIQX76UsB/30owDAYIKoZIzj0EAwMFADB6MQswCQYDVQQG +EwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UECwwXQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNpYWwgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgRTEwHhcNMTkwNDI4MTYyMDQ0WhcNNDkwNDIwMTYyMDQ0 +WjB6MQswCQYDVQQGEwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UE +CwwXQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNp +YWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRTEwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAASCCRa94QI0vR5Up9Yr9HEupz6hSoyjySYqo7v837KnmjveUIUNiuC9pWAU +WP3jwLX3HkzeiNdeg22a0IZPoSUCpasufiLAnfXh6NInLiWBrjLJXDSGaY7vaokt +rpZvAdmjXTBbMAsGA1UdDwQEAwIBBjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBRZ +4ZTgDpksHL2qcpkFkxD2zVd16TAfBgNVHSMEGDAWgBRZ4ZTgDpksHL2qcpkFkxD2 +zVd16TAMBggqhkjOPQQDAwUAA2gAMGUCMQD4IoqT2hTUn0jt7oXLdMJ8q4vLp6sg +wHfPiOr9gxreb+e6Oidwd2LDnC4OUqCWiF8CMAzwKs4SnDJYcMLf2vpkbuVE4dTH +Rglz+HGcTLWsFs4KxLsq7MuU+vJTBUeDJeDjdA== +-----END CERTIFICATE----- + +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIUEMdk6dVgOEIS2cCP0Q43P90Ps5YwDQYJKoZIhvcNAQEF +BQAwajELMAkGA1UEBhMCQ04xEzARBgNVBAoMCmlUcnVzQ2hpbmExHDAaBgNVBAsM +E0NoaW5hIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMMH2lUcnVzQ2hpbmEgQ2xhc3Mg +MiBSb290IENBIC0gRzMwHhcNMTMwNDE4MDkzNjU2WhcNMzMwNDE4MDkzNjU2WjBq +MQswCQYDVQQGEwJDTjETMBEGA1UECgwKaVRydXNDaGluYTEcMBoGA1UECwwTQ2hp +bmEgVHJ1c3QgTmV0d29yazEoMCYGA1UEAwwfaVRydXNDaGluYSBDbGFzcyAyIFJv +b3QgQ0EgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOPPShpV +nJbMqqCw6Bz1kehnoPst9pkr0V9idOwU2oyS47/HjJXk9Rd5a9xfwkPO88trUpz5 +4GmmwspDXjVFu9L0eFaRuH3KMha1Ak01citbF7cQLJlS7XI+tpkTGHEY5pt3EsQg +wykfZl/A1jrnSkspMS997r2Gim54cwz+mTMgDRhZsKK/lbOeBPpWtcFizjXYCqhw +WktvQfZBYi6o4sHCshnOswi4yV1p+LuFcQ2ciYdWvULh1eZhLxHbGXyznYHi0dGN +z+I9H8aXxqAQfHVhbdHNzi77hCxFjOy+hHrGsyzjrd2swVQ2iUWP8BfEQqGLqM1g +KgWKYfcTGdbPB1MCAwEAAaNjMGEwHQYDVR0OBBYEFG/oAMxTVe7y0+408CTAK8hA +uTyRMB8GA1UdIwQYMBaAFG/oAMxTVe7y0+408CTAK8hAuTyRMA8GA1UdEwEB/wQF +MAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBLnUTfW7hp +emMbuUGCk7RBswzOT83bDM6824EkUnf+X0iKS95SUNGeeSWK2o/3ALJo5hi7GZr3 +U8eLaWAcYizfO99UXMRBPw5PRR+gXGEronGUugLpxsjuynoLQu8GQAeysSXKbN1I +UugDo9u8igJORYA+5ms0s5sCUySqbQ2R5z/GoceyI9LdxIVa1RjVX8pYOj8JFwtn +DJN3ftSFvNMYwRuILKuqUYSHc2GPYiHVflDh5nDymCMOQFcFG3WsEuB+EYQPFgIU +1DHmdZcz7Llx8UOZXX2JupWCYzK1XhJb+r4hK5ncf/w8qGtYlmyJpxk3hr1TfUJX +Yf4Zr0fJsGuv +-----END CERTIFICATE----- \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Web.Entry/Alipaycrt/appPublicCert.crt b/Admin.NET/Admin.NET.Web.Entry/Alipaycrt/appPublicCert.crt new file mode 100644 index 00000000..a6a89dfa --- /dev/null +++ b/Admin.NET/Admin.NET.Web.Entry/Alipaycrt/appPublicCert.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDmTCCAoGgAwIBAgIQICQSIV6QZN2y3Knbwe6r9TANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE +BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjQxMjIxMTEzOTMzWhcNMjUxMjI2MTEzOTMzWjBr +MQswCQYDVQQGEwJDTjEfMB0GA1UECgwWbXRxd253MTI4OUBzYW5kYm94LmNvbTEPMA0GA1UECwwG +QWxpcGF5MSowKAYDVQQDDCEyMDg4NzIxMDUzMjU3MTMyLTkwMjEwMDAxNDI2ODYzOTUwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCxJhoamnjWZGQp+1kHXTyQgA2va0rTQv8ZvFggERZv +fOg2i5RYTBFLB0J1l3hj+23iBqzRTgzPxCLUTZUrj6WgwdDbXi11eE2wltVwmDHI1r3YdLC6KCQN +Jpv6SKSHs9JV6UDpzsHaJbsoi6NymYpkbFClLCh3MOcyha9Ju4B9n5mKze1GEDTNcAs1nGfSsH1E +wAWoe65iVM8pbTXTzjbEW/jJc2xbFT9RPRTihflkEf6p3kOpaPtgFmcUqdJ4BsldL6iWqbdR5JhT +mVKT8hDmsbW9KpPnCXWedxBZHmNiuOOCOeDhHGV3zFrZvIPJa7umAL+eweg0egN5RHP9tDAnAgMB +AAGjEjAQMA4GA1UdDwEB/wQEAwIE8DANBgkqhkiG9w0BAQsFAAOCAQEANPJelQG99aAZb+KXUE3Z +ES+ZjPD9WwCBWpfcjyDq6duEQc9Qo0B2vW6EunbOi2qhS0dJ3pgJFaRrbi72BqQavT1eVYHcfXeC +y8I3dI7oxn5BS944oiGTzaYTx6dJ8lXDmlQO8ULz+6/wBCkhr6TgKbjIOh7p3/B9NPcfL5z6OrbQ +fXRk439uRfjWlzohE9q4cAY5AYnHLZCgbHwRX+YusDmJCu+LS9hioNHjwJ9t/jXsjzEQ09sfzEHF +uPGKS4JGmzwqGp2Ly68MCzp7WOgEFBexYUio4suzKlZUcv1+HDi6fEosZ6Fr7Z3CEMwKelq8m2l7 +jg83G0PECp5unR1Hcw== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_UDIndx.vue.vm b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_UDIndx.vue.vm new file mode 100644 index 00000000..c13b6798 --- /dev/null +++ b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_UDIndx.vue.vm @@ -0,0 +1,91 @@ +@{ + string LowerFirstLetter(string text) + { + return text.ToString()[..1].ToLower() + text[1..]; // 首字母小写 + } + var pkField = Model.TableField.Where(c => c.ColumnKey == "True").FirstOrDefault(); + string pkFieldName = null; + if(pkField != null && !string.IsNullOrEmpty(pkField.PropertyName)) + { + pkFieldName = LowerFirstLetter(pkField.PropertyName); + } + Dictionary definedObjects = new Dictionary(); + bool haveLikeCdt = false; + foreach (var column in Model.TableField){ + if (column.QueryWhether == "Y" && column.QueryType == "like"){ + haveLikeCdt = true; + } + } +} + + + + + diff --git a/Admin.NET/Admin.NET.Web.Entry/wwwroot/upload/logo.png b/Admin.NET/Admin.NET.Web.Entry/wwwroot/upload/logo.png new file mode 100644 index 00000000..da794297 Binary files /dev/null and b/Admin.NET/Admin.NET.Web.Entry/wwwroot/upload/logo.png differ diff --git a/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Service/SuperApiAop.cs b/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Service/SuperApiAop.cs index 77599a93..c0f27817 100644 --- a/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Service/SuperApiAop.cs +++ b/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Service/SuperApiAop.cs @@ -5,7 +5,6 @@ // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! using Admin.NET.Core; -using Furion.ClayObject; using Furion.DataEncryption; using Furion.FriendlyException; using Furion.JsonSerialization; @@ -73,7 +72,7 @@ public class SuperApiAop : DefaultSuperApiAop var paths = api.Url.Split('/'); var actionName = paths[paths.Length - 1]; - var apiInfo = Clay.Object(new + var apiInfo = new { requestUrl = api.Url, httpMethod = api.HttpMethod, @@ -100,7 +99,7 @@ public class SuperApiAop : DefaultSuperApiAop }, }, exception = aopContext.Exception == null ? null : JSON.Serialize(aopContext.Exception) - }); + }; var logger = App.GetRequiredService().CreateLogger(CommonConst.SysLogCategoryName); using var scope = logger.ScopeContext(new Dictionary { diff --git a/Web/package.json b/Web/package.json index c3fb2432..b1399655 100644 --- a/Web/package.json +++ b/Web/package.json @@ -2,7 +2,7 @@ "name": "admin.net.pro", "type": "module", "version": "2.4.33", - "lastBuildTime": "2025.01.17", + "lastBuildTime": "2025.01.23", "description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架", "author": "zuohuaijun", "license": "MIT", @@ -24,7 +24,7 @@ "@vue-office/docx": "^1.6.2", "@vue-office/excel": "^1.7.14", "@vue-office/pdf": "^2.0.9", - "@vueuse/core": "^12.4.0", + "@vueuse/core": "^12.5.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.12", "animate.css": "^4.1.1", @@ -51,7 +51,7 @@ "mqtt": "^5.10.3", "nprogress": "^0.2.0", "ol": "^10.3.1", - "pinia": "^2.3.0", + "pinia": "^2.3.1", "print-js": "^1.6.0", "push.js": "^1.0.12", "qrcodejs2-fixes": "^0.0.2", @@ -74,7 +74,7 @@ "vue-router": "^4.5.0", "vue-signature-pad": "^3.0.2", "vue3-tree-org": "^4.2.2", - "vxe-pc-ui": "^4.3.75", + "vxe-pc-ui": "^4.3.78", "vxe-table": "^4.10.0", "vxe-table-plugin-element": "^4.0.4", "vxe-table-plugin-export-xlsx": "^4.0.7", @@ -88,8 +88,8 @@ "@types/node": "^20.17.14", "@types/nprogress": "^0.2.3", "@types/sortablejs": "^1.15.8", - "@typescript-eslint/eslint-plugin": "^8.20.0", - "@typescript-eslint/parser": "^8.20.0", + "@typescript-eslint/eslint-plugin": "^8.21.0", + "@typescript-eslint/parser": "^8.21.0", "@vitejs/plugin-vue": "^5.2.1", "@vitejs/plugin-vue-jsx": "^4.1.1", "@vue/compiler-sfc": "^3.5.13", @@ -97,13 +97,13 @@ "eslint": "^9.18.0", "eslint-plugin-vue": "^9.32.0", "globals": "^15.14.0", - "less": "^4.2.1", + "less": "^4.2.2", "prettier": "^3.4.2", "rollup-plugin-visualizer": "^5.14.0", "sass": "^1.83.4", "terser": "^5.37.0", "typescript": "^5.7.3", - "vite": "^6.0.7", + "vite": "^6.0.11", "vite-plugin-cdn-import": "^1.0.1", "vite-plugin-compression2": "^1.3.3", "vite-plugin-vue-setup-extend": "^0.4.0", diff --git a/Web/src/api-services/api.ts b/Web/src/api-services/api.ts index 569de2a7..ab72a5ab 100644 --- a/Web/src/api-services/api.ts +++ b/Web/src/api-services/api.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ export * from './apis/apijsonapi'; -export * from './apis/alipay-api'; +export * from './apis/sys-alipay-api'; export * from './apis/sys-auth-api'; export * from './apis/sys-cache-api'; export * from './apis/sys-code-gen-api'; diff --git a/Web/src/api-services/apis/alipay-api.ts b/Web/src/api-services/apis/sys-alipay-api.ts similarity index 75% rename from Web/src/api-services/apis/alipay-api.ts rename to Web/src/api-services/apis/sys-alipay-api.ts index d3cc402d..8c0d498b 100644 --- a/Web/src/api-services/apis/alipay-api.ts +++ b/Web/src/api-services/apis/sys-alipay-api.ts @@ -21,10 +21,10 @@ import { AdminNETResultString } from '../models'; import { AlipayPreCreateInput } from '../models'; import { AlipayTradePagePayInput } from '../models'; /** - * AlipayApi - axios parameter creator + * SysAlipayApi - axios parameter creator * @export */ -export const AlipayApiAxiosParamCreator = function (configuration?: Configuration) { +export const SysAlipayApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * @@ -33,8 +33,8 @@ export const AlipayApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiAlipayAlipayPreCreatePost: async (body?: AlipayPreCreateInput, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/alipay/alipayPreCreate`; + apiSysAlipayAlipayPreCreatePost: async (body?: AlipayPreCreateInput, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysAlipay/alipayPreCreate`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; @@ -81,8 +81,8 @@ export const AlipayApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiAlipayAlipayTradePagePayPost: async (body?: AlipayTradePagePayInput, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/alipay/alipayTradePagePay`; + apiSysAlipayAlipayTradePagePayPost: async (body?: AlipayTradePagePayInput, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysAlipay/alipayTradePagePay`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; @@ -130,8 +130,8 @@ export const AlipayApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiAlipayGetAuthInfoGet: async (userId?: string, authCode?: string, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/alipay/getAuthInfo`; + apiSysAlipayAuthInfoGet: async (userId?: string, authCode?: string, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysAlipay/authInfo`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; @@ -152,11 +152,11 @@ export const AlipayApiAxiosParamCreator = function (configuration?: Configuratio } if (userId !== undefined) { - localVarQueryParameter['UserId'] = userId; + localVarQueryParameter['user_id'] = userId; } if (authCode !== undefined) { - localVarQueryParameter['AuthCode'] = authCode; + localVarQueryParameter['auth_code'] = authCode; } const query = new URLSearchParams(localVarUrlObj.search); @@ -181,8 +181,8 @@ export const AlipayApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiAlipayNotifyPost: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/alipay/notify`; + apiSysAlipayNotifyPost: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysAlipay/notify`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; @@ -222,10 +222,10 @@ export const AlipayApiAxiosParamCreator = function (configuration?: Configuratio }; /** - * AlipayApi - functional programming interface + * SysAlipayApi - functional programming interface * @export */ -export const AlipayApiFp = function(configuration?: Configuration) { +export const SysAlipayApiFp = function(configuration?: Configuration) { return { /** * @@ -234,8 +234,8 @@ export const AlipayApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiAlipayAlipayPreCreatePost(body?: AlipayPreCreateInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await AlipayApiAxiosParamCreator(configuration).apiAlipayAlipayPreCreatePost(body, options); + async apiSysAlipayAlipayPreCreatePost(body?: AlipayPreCreateInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysAlipayApiAxiosParamCreator(configuration).apiSysAlipayAlipayPreCreatePost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -248,8 +248,8 @@ export const AlipayApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiAlipayAlipayTradePagePayPost(body?: AlipayTradePagePayInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await AlipayApiAxiosParamCreator(configuration).apiAlipayAlipayTradePagePayPost(body, options); + async apiSysAlipayAlipayTradePagePayPost(body?: AlipayTradePagePayInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysAlipayApiAxiosParamCreator(configuration).apiSysAlipayAlipayTradePagePayPost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -263,8 +263,8 @@ export const AlipayApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiAlipayGetAuthInfoGet(userId?: string, authCode?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await AlipayApiAxiosParamCreator(configuration).apiAlipayGetAuthInfoGet(userId, authCode, options); + async apiSysAlipayAuthInfoGet(userId?: string, authCode?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysAlipayApiAxiosParamCreator(configuration).apiSysAlipayAuthInfoGet(userId, authCode, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -276,8 +276,8 @@ export const AlipayApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiAlipayNotifyPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await AlipayApiAxiosParamCreator(configuration).apiAlipayNotifyPost(options); + async apiSysAlipayNotifyPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysAlipayApiAxiosParamCreator(configuration).apiSysAlipayNotifyPost(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -287,10 +287,10 @@ export const AlipayApiFp = function(configuration?: Configuration) { }; /** - * AlipayApi - factory interface + * SysAlipayApi - factory interface * @export */ -export const AlipayApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { +export const SysAlipayApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * @@ -299,8 +299,8 @@ export const AlipayApiFactory = function (configuration?: Configuration, basePat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiAlipayAlipayPreCreatePost(body?: AlipayPreCreateInput, options?: AxiosRequestConfig): Promise> { - return AlipayApiFp(configuration).apiAlipayAlipayPreCreatePost(body, options).then((request) => request(axios, basePath)); + async apiSysAlipayAlipayPreCreatePost(body?: AlipayPreCreateInput, options?: AxiosRequestConfig): Promise> { + return SysAlipayApiFp(configuration).apiSysAlipayAlipayPreCreatePost(body, options).then((request) => request(axios, basePath)); }, /** * @@ -309,8 +309,8 @@ export const AlipayApiFactory = function (configuration?: Configuration, basePat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiAlipayAlipayTradePagePayPost(body?: AlipayTradePagePayInput, options?: AxiosRequestConfig): Promise> { - return AlipayApiFp(configuration).apiAlipayAlipayTradePagePayPost(body, options).then((request) => request(axios, basePath)); + async apiSysAlipayAlipayTradePagePayPost(body?: AlipayTradePagePayInput, options?: AxiosRequestConfig): Promise> { + return SysAlipayApiFp(configuration).apiSysAlipayAlipayTradePagePayPost(body, options).then((request) => request(axios, basePath)); }, /** * @@ -320,8 +320,8 @@ export const AlipayApiFactory = function (configuration?: Configuration, basePat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiAlipayGetAuthInfoGet(userId?: string, authCode?: string, options?: AxiosRequestConfig): Promise> { - return AlipayApiFp(configuration).apiAlipayGetAuthInfoGet(userId, authCode, options).then((request) => request(axios, basePath)); + async apiSysAlipayAuthInfoGet(userId?: string, authCode?: string, options?: AxiosRequestConfig): Promise> { + return SysAlipayApiFp(configuration).apiSysAlipayAuthInfoGet(userId, authCode, options).then((request) => request(axios, basePath)); }, /** * @@ -329,29 +329,29 @@ export const AlipayApiFactory = function (configuration?: Configuration, basePat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiAlipayNotifyPost(options?: AxiosRequestConfig): Promise> { - return AlipayApiFp(configuration).apiAlipayNotifyPost(options).then((request) => request(axios, basePath)); + async apiSysAlipayNotifyPost(options?: AxiosRequestConfig): Promise> { + return SysAlipayApiFp(configuration).apiSysAlipayNotifyPost(options).then((request) => request(axios, basePath)); }, }; }; /** - * AlipayApi - object-oriented interface + * SysAlipayApi - object-oriented interface * @export - * @class AlipayApi + * @class SysAlipayApi * @extends {BaseAPI} */ -export class AlipayApi extends BaseAPI { +export class SysAlipayApi extends BaseAPI { /** * * @summary 交易预创建 🔖 * @param {AlipayPreCreateInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AlipayApi + * @memberof SysAlipayApi */ - public async apiAlipayAlipayPreCreatePost(body?: AlipayPreCreateInput, options?: AxiosRequestConfig) : Promise> { - return AlipayApiFp(this.configuration).apiAlipayAlipayPreCreatePost(body, options).then((request) => request(this.axios, this.basePath)); + public async apiSysAlipayAlipayPreCreatePost(body?: AlipayPreCreateInput, options?: AxiosRequestConfig) : Promise> { + return SysAlipayApiFp(this.configuration).apiSysAlipayAlipayPreCreatePost(body, options).then((request) => request(this.axios, this.basePath)); } /** * @@ -359,10 +359,10 @@ export class AlipayApi extends BaseAPI { * @param {AlipayTradePagePayInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AlipayApi + * @memberof SysAlipayApi */ - public async apiAlipayAlipayTradePagePayPost(body?: AlipayTradePagePayInput, options?: AxiosRequestConfig) : Promise> { - return AlipayApiFp(this.configuration).apiAlipayAlipayTradePagePayPost(body, options).then((request) => request(this.axios, this.basePath)); + public async apiSysAlipayAlipayTradePagePayPost(body?: AlipayTradePagePayInput, options?: AxiosRequestConfig) : Promise> { + return SysAlipayApiFp(this.configuration).apiSysAlipayAlipayTradePagePayPost(body, options).then((request) => request(this.axios, this.basePath)); } /** * @@ -371,19 +371,19 @@ export class AlipayApi extends BaseAPI { * @param {string} [authCode] 授权码 * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AlipayApi + * @memberof SysAlipayApi */ - public async apiAlipayGetAuthInfoGet(userId?: string, authCode?: string, options?: AxiosRequestConfig) : Promise> { - return AlipayApiFp(this.configuration).apiAlipayGetAuthInfoGet(userId, authCode, options).then((request) => request(this.axios, this.basePath)); + public async apiSysAlipayAuthInfoGet(userId?: string, authCode?: string, options?: AxiosRequestConfig) : Promise> { + return SysAlipayApiFp(this.configuration).apiSysAlipayAuthInfoGet(userId, authCode, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary 支付回调 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AlipayApi + * @memberof SysAlipayApi */ - public async apiAlipayNotifyPost(options?: AxiosRequestConfig) : Promise> { - return AlipayApiFp(this.configuration).apiAlipayNotifyPost(options).then((request) => request(this.axios, this.basePath)); + public async apiSysAlipayNotifyPost(options?: AxiosRequestConfig) : Promise> { + return SysAlipayApiFp(this.configuration).apiSysAlipayNotifyPost(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/Web/src/api-services/apis/sys-code-gen-config-api.ts b/Web/src/api-services/apis/sys-code-gen-config-api.ts index 1468519d..dc007486 100644 --- a/Web/src/api-services/apis/sys-code-gen-config-api.ts +++ b/Web/src/api-services/apis/sys-code-gen-config-api.ts @@ -17,9 +17,14 @@ import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { AdminNETResultIEnumerableEntityInfo } from '../models'; import { AdminNETResultListCodeGenConfig } from '../models'; +import { AdminNETResultListColumnOuput } from '../models'; import { AdminNETResultSysCodeGenConfig } from '../models'; import { CodeGenConfig } from '../models'; +import { Filter } from '../models'; +import { FilterLogicEnum } from '../models'; +import { FilterOperatorEnum } from '../models'; import { VerifyRuleItem } from '../models'; /** * SysCodeGenConfigApi - axios parameter creator @@ -27,6 +32,343 @@ import { VerifyRuleItem } from '../models'; */ export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * + * @summary 获取数据表列(实体属性)集合 + * @param {string} entityName + * @param {string} configId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenConfigColumnListEntityNameConfigIdGet: async (entityName: string, configId: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'entityName' is not null or undefined + if (entityName === null || entityName === undefined) { + throw new RequiredError('entityName','Required parameter entityName was null or undefined when calling apiSysCodeGenConfigColumnListEntityNameConfigIdGet.'); + } + // verify required parameter 'configId' is not null or undefined + if (configId === null || configId === undefined) { + throw new RequiredError('configId','Required parameter configId was null or undefined when calling apiSysCodeGenConfigColumnListEntityNameConfigIdGet.'); + } + const localVarPath = `/api/sysCodeGenConfig/columnList/{entityName}/{configId}` + .replace(`{${"entityName"}}`, encodeURIComponent(String(entityName))) + .replace(`{${"configId"}}`, encodeURIComponent(String(configId))); + // 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 获取数据表列(实体属性)集合 + * @param {string} tableName 数据库表名 + * @param {string} busName 业务名(业务代码包名称) + * @param {string} nameSpace 命名空间 + * @param {string} authorName 作者姓名 + * @param {string} generateType 生成方式 + * @param {boolean} generateMenu 是否生成菜单 + * @param {boolean} [isApiService] 是否使用 Api Service + * @param {Array} [codeGenTemplateIds] 模板Id集合 + * @param {string} [leftTab] 左边树形结构表 + * @param {string} [leftKey] 左边关联字段 + * @param {string} [leftPrimaryKey] 左边关联主表字段 + * @param {string} [leftName] 左边树Name + * @param {string} [bottomTab] 下表名称 + * @param {string} [bottomKey] 下表关联字段 + * @param {string} [bottomPrimaryKey] 下表关联主表字段 + * @param {string} [template] 模板 + * @param {string} [className] 类名 + * @param {string} [tablePrefix] 是否移除表前缀 + * @param {string} [configId] 库定位器名 + * @param {string} [dbName] 数据库名(保留字段) + * @param {string} [dbType] 数据库类型 + * @param {string} [connectionString] 数据库链接 + * @param {string} [treeName] 树控件名称 + * @param {string} [tableComment] 功能名(数据库表名称) + * @param {string} [menuApplication] 菜单应用分类(应用编码) + * @param {number} [menuPid] 菜单父级 + * @param {string} [menuIcon] 菜单图标 + * @param {string} [pagePath] 页面目录 + * @param {string} [printType] 支持打印类型 + * @param {string} [printName] 打印模版名称 + * @param {number} [page] 当前页码 + * @param {number} [pageSize] 页码容量 + * @param {string} [field] 排序字段 + * @param {string} [order] 排序方向 + * @param {string} [descStr] 降序排序 + * @param {Array} [searchFields] 字段名称集合 + * @param {string} [searchKeyword] 关键字 + * @param {string} [keyword] 模糊查询关键字 + * @param {FilterLogicEnum} [filterLogic] 过滤条件 + * @param {Array} [filterFilters] 筛选过滤条件子项 + * @param {string} [filterField] 字段名称 + * @param {FilterOperatorEnum} [filterOperator] 逻辑运算符 + * @param {any} [filterValue] 字段值 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenConfigColumnListGet: async (tableName: string, busName: string, nameSpace: string, authorName: string, generateType: string, generateMenu: boolean, isApiService?: boolean, codeGenTemplateIds?: Array, leftTab?: string, leftKey?: string, leftPrimaryKey?: string, leftName?: string, bottomTab?: string, bottomKey?: string, bottomPrimaryKey?: string, template?: string, className?: string, tablePrefix?: string, configId?: string, dbName?: string, dbType?: string, connectionString?: string, treeName?: string, tableComment?: string, menuApplication?: string, menuPid?: number, menuIcon?: string, pagePath?: string, printType?: string, printName?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'tableName' is not null or undefined + if (tableName === null || tableName === undefined) { + throw new RequiredError('tableName','Required parameter tableName was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); + } + // verify required parameter 'busName' is not null or undefined + if (busName === null || busName === undefined) { + throw new RequiredError('busName','Required parameter busName was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); + } + // verify required parameter 'nameSpace' is not null or undefined + if (nameSpace === null || nameSpace === undefined) { + throw new RequiredError('nameSpace','Required parameter nameSpace was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); + } + // verify required parameter 'authorName' is not null or undefined + if (authorName === null || authorName === undefined) { + throw new RequiredError('authorName','Required parameter authorName was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); + } + // verify required parameter 'generateType' is not null or undefined + if (generateType === null || generateType === undefined) { + throw new RequiredError('generateType','Required parameter generateType was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); + } + // verify required parameter 'generateMenu' is not null or undefined + if (generateMenu === null || generateMenu === undefined) { + throw new RequiredError('generateMenu','Required parameter generateMenu was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); + } + const localVarPath = `/api/sysCodeGenConfig/columnList`; + // 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; + } + + if (tableName !== undefined) { + localVarQueryParameter['TableName'] = tableName; + } + + if (busName !== undefined) { + localVarQueryParameter['BusName'] = busName; + } + + if (nameSpace !== undefined) { + localVarQueryParameter['NameSpace'] = nameSpace; + } + + if (authorName !== undefined) { + localVarQueryParameter['AuthorName'] = authorName; + } + + if (generateType !== undefined) { + localVarQueryParameter['GenerateType'] = generateType; + } + + if (generateMenu !== undefined) { + localVarQueryParameter['GenerateMenu'] = generateMenu; + } + + if (isApiService !== undefined) { + localVarQueryParameter['IsApiService'] = isApiService; + } + + if (codeGenTemplateIds) { + localVarQueryParameter['CodeGenTemplateIds'] = codeGenTemplateIds; + } + + if (leftTab !== undefined) { + localVarQueryParameter['LeftTab'] = leftTab; + } + + if (leftKey !== undefined) { + localVarQueryParameter['LeftKey'] = leftKey; + } + + if (leftPrimaryKey !== undefined) { + localVarQueryParameter['LeftPrimaryKey'] = leftPrimaryKey; + } + + if (leftName !== undefined) { + localVarQueryParameter['LeftName'] = leftName; + } + + if (bottomTab !== undefined) { + localVarQueryParameter['BottomTab'] = bottomTab; + } + + if (bottomKey !== undefined) { + localVarQueryParameter['BottomKey'] = bottomKey; + } + + if (bottomPrimaryKey !== undefined) { + localVarQueryParameter['BottomPrimaryKey'] = bottomPrimaryKey; + } + + if (template !== undefined) { + localVarQueryParameter['Template'] = template; + } + + if (className !== undefined) { + localVarQueryParameter['ClassName'] = className; + } + + if (tablePrefix !== undefined) { + localVarQueryParameter['TablePrefix'] = tablePrefix; + } + + if (configId !== undefined) { + localVarQueryParameter['ConfigId'] = configId; + } + + if (dbName !== undefined) { + localVarQueryParameter['DbName'] = dbName; + } + + if (dbType !== undefined) { + localVarQueryParameter['DbType'] = dbType; + } + + if (connectionString !== undefined) { + localVarQueryParameter['ConnectionString'] = connectionString; + } + + if (treeName !== undefined) { + localVarQueryParameter['TreeName'] = treeName; + } + + if (tableComment !== undefined) { + localVarQueryParameter['TableComment'] = tableComment; + } + + if (menuApplication !== undefined) { + localVarQueryParameter['MenuApplication'] = menuApplication; + } + + if (menuPid !== undefined) { + localVarQueryParameter['MenuPid'] = menuPid; + } + + if (menuIcon !== undefined) { + localVarQueryParameter['MenuIcon'] = menuIcon; + } + + if (pagePath !== undefined) { + localVarQueryParameter['PagePath'] = pagePath; + } + + if (printType !== undefined) { + localVarQueryParameter['PrintType'] = printType; + } + + if (printName !== undefined) { + localVarQueryParameter['PrintName'] = printName; + } + + if (page !== undefined) { + localVarQueryParameter['Page'] = page; + } + + if (pageSize !== undefined) { + localVarQueryParameter['PageSize'] = pageSize; + } + + if (field !== undefined) { + localVarQueryParameter['Field'] = field; + } + + if (order !== undefined) { + localVarQueryParameter['Order'] = order; + } + + if (descStr !== undefined) { + localVarQueryParameter['DescStr'] = descStr; + } + + if (searchFields) { + localVarQueryParameter['Search.Fields'] = searchFields; + } + + if (searchKeyword !== undefined) { + localVarQueryParameter['Search.Keyword'] = searchKeyword; + } + + if (keyword !== undefined) { + localVarQueryParameter['Keyword'] = keyword; + } + + if (filterLogic !== undefined) { + localVarQueryParameter['Filter.Logic'] = filterLogic; + } + + if (filterFilters) { + localVarQueryParameter['Filter.Filters'] = filterFilters; + } + + if (filterField !== undefined) { + localVarQueryParameter['Filter.Field'] = filterField; + } + + if (filterOperator !== undefined) { + localVarQueryParameter['Filter.Operator'] = filterOperator; + } + + if (filterValue !== undefined) { + localVarQueryParameter['Filter.Value'] = filterValue; + } + + 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 获取代码生成配置详情 🔖 @@ -51,6 +393,7 @@ export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Co * @param {string} [whetherRetract] 列表是否缩进(字典) * @param {string} [whetherRequired] 是否必填(字典) * @param {string} [whetherSortable] 是否可排序(字典) + * @param {string} [statistical] 是否是统计字段 * @param {string} [queryWhether] 是否是查询条件 * @param {string} [queryType] 查询方式 * @param {string} [whetherTable] 列表显示 @@ -72,7 +415,7 @@ export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysCodeGenConfigDetailGet: async (id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options: AxiosRequestConfig = {}): Promise => { + apiSysCodeGenConfigDetailGet: async (id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/sysCodeGenConfig/detail`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); @@ -177,6 +520,10 @@ export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Co localVarQueryParameter['WhetherSortable'] = whetherSortable; } + if (statistical !== undefined) { + localVarQueryParameter['Statistical'] = statistical; + } + if (queryWhether !== undefined) { localVarQueryParameter['QueryWhether'] = queryWhether; } @@ -265,6 +612,55 @@ export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Co options: localVarRequestOptions, }; }, + /** + * + * @summary 获取库表信息 + * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenConfigEntityInfosExcludeSysTableGet: async (excludeSysTable: boolean, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'excludeSysTable' is not null or undefined + if (excludeSysTable === null || excludeSysTable === undefined) { + throw new RequiredError('excludeSysTable','Required parameter excludeSysTable was null or undefined when calling apiSysCodeGenConfigEntityInfosExcludeSysTableGet.'); + } + const localVarPath = `/api/sysCodeGenConfig/entityInfos/{excludeSysTable}` + .replace(`{${"excludeSysTable"}}`, encodeURIComponent(String(excludeSysTable))); + // 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 获取代码生成配置列表 🔖 @@ -289,6 +685,7 @@ export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Co * @param {string} [whetherRetract] 列表是否缩进(字典) * @param {string} [whetherRequired] 是否必填(字典) * @param {string} [whetherSortable] 是否可排序(字典) + * @param {string} [statistical] 是否是统计字段 * @param {string} [queryWhether] 是否是查询条件 * @param {string} [queryType] 查询方式 * @param {string} [whetherTable] 列表显示 @@ -310,7 +707,7 @@ export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Co * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysCodeGenConfigListGet: async (id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options: AxiosRequestConfig = {}): Promise => { + apiSysCodeGenConfigListGet: async (id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/sysCodeGenConfig/list`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); @@ -415,6 +812,10 @@ export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Co localVarQueryParameter['WhetherSortable'] = whetherSortable; } + if (statistical !== undefined) { + localVarQueryParameter['Statistical'] = statistical; + } + if (queryWhether !== undefined) { localVarQueryParameter['QueryWhether'] = queryWhether; } @@ -560,6 +961,77 @@ export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Co */ export const SysCodeGenConfigApiFp = function(configuration?: Configuration) { return { + /** + * + * @summary 获取数据表列(实体属性)集合 + * @param {string} entityName + * @param {string} configId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName: string, configId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName, configId, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary 获取数据表列(实体属性)集合 + * @param {string} tableName 数据库表名 + * @param {string} busName 业务名(业务代码包名称) + * @param {string} nameSpace 命名空间 + * @param {string} authorName 作者姓名 + * @param {string} generateType 生成方式 + * @param {boolean} generateMenu 是否生成菜单 + * @param {boolean} [isApiService] 是否使用 Api Service + * @param {Array} [codeGenTemplateIds] 模板Id集合 + * @param {string} [leftTab] 左边树形结构表 + * @param {string} [leftKey] 左边关联字段 + * @param {string} [leftPrimaryKey] 左边关联主表字段 + * @param {string} [leftName] 左边树Name + * @param {string} [bottomTab] 下表名称 + * @param {string} [bottomKey] 下表关联字段 + * @param {string} [bottomPrimaryKey] 下表关联主表字段 + * @param {string} [template] 模板 + * @param {string} [className] 类名 + * @param {string} [tablePrefix] 是否移除表前缀 + * @param {string} [configId] 库定位器名 + * @param {string} [dbName] 数据库名(保留字段) + * @param {string} [dbType] 数据库类型 + * @param {string} [connectionString] 数据库链接 + * @param {string} [treeName] 树控件名称 + * @param {string} [tableComment] 功能名(数据库表名称) + * @param {string} [menuApplication] 菜单应用分类(应用编码) + * @param {number} [menuPid] 菜单父级 + * @param {string} [menuIcon] 菜单图标 + * @param {string} [pagePath] 页面目录 + * @param {string} [printType] 支持打印类型 + * @param {string} [printName] 打印模版名称 + * @param {number} [page] 当前页码 + * @param {number} [pageSize] 页码容量 + * @param {string} [field] 排序字段 + * @param {string} [order] 排序方向 + * @param {string} [descStr] 降序排序 + * @param {Array} [searchFields] 字段名称集合 + * @param {string} [searchKeyword] 关键字 + * @param {string} [keyword] 模糊查询关键字 + * @param {FilterLogicEnum} [filterLogic] 过滤条件 + * @param {Array} [filterFilters] 筛选过滤条件子项 + * @param {string} [filterField] 字段名称 + * @param {FilterOperatorEnum} [filterOperator] 逻辑运算符 + * @param {any} [filterValue] 字段值 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenConfigColumnListGet(tableName: string, busName: string, nameSpace: string, authorName: string, generateType: string, generateMenu: boolean, isApiService?: boolean, codeGenTemplateIds?: Array, leftTab?: string, leftKey?: string, leftPrimaryKey?: string, leftName?: string, bottomTab?: string, bottomKey?: string, bottomPrimaryKey?: string, template?: string, className?: string, tablePrefix?: string, configId?: string, dbName?: string, dbType?: string, connectionString?: string, treeName?: string, tableComment?: string, menuApplication?: string, menuPid?: number, menuIcon?: string, pagePath?: string, printType?: string, printName?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigColumnListGet(tableName, busName, nameSpace, authorName, generateType, generateMenu, isApiService, codeGenTemplateIds, leftTab, leftKey, leftPrimaryKey, leftName, bottomTab, bottomKey, bottomPrimaryKey, template, className, tablePrefix, configId, dbName, dbType, connectionString, treeName, tableComment, menuApplication, menuPid, menuIcon, pagePath, printType, printName, page, pageSize, field, order, descStr, searchFields, searchKeyword, keyword, filterLogic, filterFilters, filterField, filterOperator, filterValue, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, /** * * @summary 获取代码生成配置详情 🔖 @@ -584,6 +1056,7 @@ export const SysCodeGenConfigApiFp = function(configuration?: Configuration) { * @param {string} [whetherRetract] 列表是否缩进(字典) * @param {string} [whetherRequired] 是否必填(字典) * @param {string} [whetherSortable] 是否可排序(字典) + * @param {string} [statistical] 是否是统计字段 * @param {string} [queryWhether] 是否是查询条件 * @param {string} [queryType] 查询方式 * @param {string} [whetherTable] 列表显示 @@ -605,8 +1078,22 @@ export const SysCodeGenConfigApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenConfigDetailGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigDetailGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options); + async apiSysCodeGenConfigDetailGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigDetailGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary 获取库表信息 + * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -636,6 +1123,7 @@ export const SysCodeGenConfigApiFp = function(configuration?: Configuration) { * @param {string} [whetherRetract] 列表是否缩进(字典) * @param {string} [whetherRequired] 是否必填(字典) * @param {string} [whetherSortable] 是否可排序(字典) + * @param {string} [statistical] 是否是统计字段 * @param {string} [queryWhether] 是否是查询条件 * @param {string} [queryType] 查询方式 * @param {string} [whetherTable] 列表显示 @@ -657,8 +1145,8 @@ export const SysCodeGenConfigApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenConfigListGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigListGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options); + async apiSysCodeGenConfigListGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigListGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -687,6 +1175,69 @@ export const SysCodeGenConfigApiFp = function(configuration?: Configuration) { */ export const SysCodeGenConfigApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { + /** + * + * @summary 获取数据表列(实体属性)集合 + * @param {string} entityName + * @param {string} configId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName: string, configId: string, options?: AxiosRequestConfig): Promise> { + return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName, configId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 获取数据表列(实体属性)集合 + * @param {string} tableName 数据库表名 + * @param {string} busName 业务名(业务代码包名称) + * @param {string} nameSpace 命名空间 + * @param {string} authorName 作者姓名 + * @param {string} generateType 生成方式 + * @param {boolean} generateMenu 是否生成菜单 + * @param {boolean} [isApiService] 是否使用 Api Service + * @param {Array} [codeGenTemplateIds] 模板Id集合 + * @param {string} [leftTab] 左边树形结构表 + * @param {string} [leftKey] 左边关联字段 + * @param {string} [leftPrimaryKey] 左边关联主表字段 + * @param {string} [leftName] 左边树Name + * @param {string} [bottomTab] 下表名称 + * @param {string} [bottomKey] 下表关联字段 + * @param {string} [bottomPrimaryKey] 下表关联主表字段 + * @param {string} [template] 模板 + * @param {string} [className] 类名 + * @param {string} [tablePrefix] 是否移除表前缀 + * @param {string} [configId] 库定位器名 + * @param {string} [dbName] 数据库名(保留字段) + * @param {string} [dbType] 数据库类型 + * @param {string} [connectionString] 数据库链接 + * @param {string} [treeName] 树控件名称 + * @param {string} [tableComment] 功能名(数据库表名称) + * @param {string} [menuApplication] 菜单应用分类(应用编码) + * @param {number} [menuPid] 菜单父级 + * @param {string} [menuIcon] 菜单图标 + * @param {string} [pagePath] 页面目录 + * @param {string} [printType] 支持打印类型 + * @param {string} [printName] 打印模版名称 + * @param {number} [page] 当前页码 + * @param {number} [pageSize] 页码容量 + * @param {string} [field] 排序字段 + * @param {string} [order] 排序方向 + * @param {string} [descStr] 降序排序 + * @param {Array} [searchFields] 字段名称集合 + * @param {string} [searchKeyword] 关键字 + * @param {string} [keyword] 模糊查询关键字 + * @param {FilterLogicEnum} [filterLogic] 过滤条件 + * @param {Array} [filterFilters] 筛选过滤条件子项 + * @param {string} [filterField] 字段名称 + * @param {FilterOperatorEnum} [filterOperator] 逻辑运算符 + * @param {any} [filterValue] 字段值 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenConfigColumnListGet(tableName: string, busName: string, nameSpace: string, authorName: string, generateType: string, generateMenu: boolean, isApiService?: boolean, codeGenTemplateIds?: Array, leftTab?: string, leftKey?: string, leftPrimaryKey?: string, leftName?: string, bottomTab?: string, bottomKey?: string, bottomPrimaryKey?: string, template?: string, className?: string, tablePrefix?: string, configId?: string, dbName?: string, dbType?: string, connectionString?: string, treeName?: string, tableComment?: string, menuApplication?: string, menuPid?: number, menuIcon?: string, pagePath?: string, printType?: string, printName?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options?: AxiosRequestConfig): Promise> { + return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigColumnListGet(tableName, busName, nameSpace, authorName, generateType, generateMenu, isApiService, codeGenTemplateIds, leftTab, leftKey, leftPrimaryKey, leftName, bottomTab, bottomKey, bottomPrimaryKey, template, className, tablePrefix, configId, dbName, dbType, connectionString, treeName, tableComment, menuApplication, menuPid, menuIcon, pagePath, printType, printName, page, pageSize, field, order, descStr, searchFields, searchKeyword, keyword, filterLogic, filterFilters, filterField, filterOperator, filterValue, options).then((request) => request(axios, basePath)); + }, /** * * @summary 获取代码生成配置详情 🔖 @@ -711,6 +1262,7 @@ export const SysCodeGenConfigApiFactory = function (configuration?: Configuratio * @param {string} [whetherRetract] 列表是否缩进(字典) * @param {string} [whetherRequired] 是否必填(字典) * @param {string} [whetherSortable] 是否可排序(字典) + * @param {string} [statistical] 是否是统计字段 * @param {string} [queryWhether] 是否是查询条件 * @param {string} [queryType] 查询方式 * @param {string} [whetherTable] 列表显示 @@ -732,8 +1284,18 @@ export const SysCodeGenConfigApiFactory = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenConfigDetailGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise> { - return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigDetailGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(axios, basePath)); + async apiSysCodeGenConfigDetailGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise> { + return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigDetailGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 获取库表信息 + * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable: boolean, options?: AxiosRequestConfig): Promise> { + return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable, options).then((request) => request(axios, basePath)); }, /** * @@ -759,6 +1321,7 @@ export const SysCodeGenConfigApiFactory = function (configuration?: Configuratio * @param {string} [whetherRetract] 列表是否缩进(字典) * @param {string} [whetherRequired] 是否必填(字典) * @param {string} [whetherSortable] 是否可排序(字典) + * @param {string} [statistical] 是否是统计字段 * @param {string} [queryWhether] 是否是查询条件 * @param {string} [queryType] 查询方式 * @param {string} [whetherTable] 列表显示 @@ -780,8 +1343,8 @@ export const SysCodeGenConfigApiFactory = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenConfigListGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise> { - return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigListGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(axios, basePath)); + async apiSysCodeGenConfigListGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise> { + return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigListGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(axios, basePath)); }, /** * @@ -803,6 +1366,71 @@ export const SysCodeGenConfigApiFactory = function (configuration?: Configuratio * @extends {BaseAPI} */ export class SysCodeGenConfigApi extends BaseAPI { + /** + * + * @summary 获取数据表列(实体属性)集合 + * @param {string} entityName + * @param {string} configId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenConfigApi + */ + public async apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName: string, configId: string, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName, configId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary 获取数据表列(实体属性)集合 + * @param {string} tableName 数据库表名 + * @param {string} busName 业务名(业务代码包名称) + * @param {string} nameSpace 命名空间 + * @param {string} authorName 作者姓名 + * @param {string} generateType 生成方式 + * @param {boolean} generateMenu 是否生成菜单 + * @param {boolean} [isApiService] 是否使用 Api Service + * @param {Array} [codeGenTemplateIds] 模板Id集合 + * @param {string} [leftTab] 左边树形结构表 + * @param {string} [leftKey] 左边关联字段 + * @param {string} [leftPrimaryKey] 左边关联主表字段 + * @param {string} [leftName] 左边树Name + * @param {string} [bottomTab] 下表名称 + * @param {string} [bottomKey] 下表关联字段 + * @param {string} [bottomPrimaryKey] 下表关联主表字段 + * @param {string} [template] 模板 + * @param {string} [className] 类名 + * @param {string} [tablePrefix] 是否移除表前缀 + * @param {string} [configId] 库定位器名 + * @param {string} [dbName] 数据库名(保留字段) + * @param {string} [dbType] 数据库类型 + * @param {string} [connectionString] 数据库链接 + * @param {string} [treeName] 树控件名称 + * @param {string} [tableComment] 功能名(数据库表名称) + * @param {string} [menuApplication] 菜单应用分类(应用编码) + * @param {number} [menuPid] 菜单父级 + * @param {string} [menuIcon] 菜单图标 + * @param {string} [pagePath] 页面目录 + * @param {string} [printType] 支持打印类型 + * @param {string} [printName] 打印模版名称 + * @param {number} [page] 当前页码 + * @param {number} [pageSize] 页码容量 + * @param {string} [field] 排序字段 + * @param {string} [order] 排序方向 + * @param {string} [descStr] 降序排序 + * @param {Array} [searchFields] 字段名称集合 + * @param {string} [searchKeyword] 关键字 + * @param {string} [keyword] 模糊查询关键字 + * @param {FilterLogicEnum} [filterLogic] 过滤条件 + * @param {Array} [filterFilters] 筛选过滤条件子项 + * @param {string} [filterField] 字段名称 + * @param {FilterOperatorEnum} [filterOperator] 逻辑运算符 + * @param {any} [filterValue] 字段值 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenConfigApi + */ + public async apiSysCodeGenConfigColumnListGet(tableName: string, busName: string, nameSpace: string, authorName: string, generateType: string, generateMenu: boolean, isApiService?: boolean, codeGenTemplateIds?: Array, leftTab?: string, leftKey?: string, leftPrimaryKey?: string, leftName?: string, bottomTab?: string, bottomKey?: string, bottomPrimaryKey?: string, template?: string, className?: string, tablePrefix?: string, configId?: string, dbName?: string, dbType?: string, connectionString?: string, treeName?: string, tableComment?: string, menuApplication?: string, menuPid?: number, menuIcon?: string, pagePath?: string, printType?: string, printName?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigColumnListGet(tableName, busName, nameSpace, authorName, generateType, generateMenu, isApiService, codeGenTemplateIds, leftTab, leftKey, leftPrimaryKey, leftName, bottomTab, bottomKey, bottomPrimaryKey, template, className, tablePrefix, configId, dbName, dbType, connectionString, treeName, tableComment, menuApplication, menuPid, menuIcon, pagePath, printType, printName, page, pageSize, field, order, descStr, searchFields, searchKeyword, keyword, filterLogic, filterFilters, filterField, filterOperator, filterValue, options).then((request) => request(this.axios, this.basePath)); + } /** * * @summary 获取代码生成配置详情 🔖 @@ -827,6 +1455,7 @@ export class SysCodeGenConfigApi extends BaseAPI { * @param {string} [whetherRetract] 列表是否缩进(字典) * @param {string} [whetherRequired] 是否必填(字典) * @param {string} [whetherSortable] 是否可排序(字典) + * @param {string} [statistical] 是否是统计字段 * @param {string} [queryWhether] 是否是查询条件 * @param {string} [queryType] 查询方式 * @param {string} [whetherTable] 列表显示 @@ -849,8 +1478,19 @@ export class SysCodeGenConfigApi extends BaseAPI { * @throws {RequiredError} * @memberof SysCodeGenConfigApi */ - public async apiSysCodeGenConfigDetailGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig) : Promise> { - return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigDetailGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(this.axios, this.basePath)); + public async apiSysCodeGenConfigDetailGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigDetailGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary 获取库表信息 + * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenConfigApi + */ + public async apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable: boolean, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable, options).then((request) => request(this.axios, this.basePath)); } /** * @@ -876,6 +1516,7 @@ export class SysCodeGenConfigApi extends BaseAPI { * @param {string} [whetherRetract] 列表是否缩进(字典) * @param {string} [whetherRequired] 是否必填(字典) * @param {string} [whetherSortable] 是否可排序(字典) + * @param {string} [statistical] 是否是统计字段 * @param {string} [queryWhether] 是否是查询条件 * @param {string} [queryType] 查询方式 * @param {string} [whetherTable] 列表显示 @@ -898,8 +1539,8 @@ export class SysCodeGenConfigApi extends BaseAPI { * @throws {RequiredError} * @memberof SysCodeGenConfigApi */ - public async apiSysCodeGenConfigListGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig) : Promise> { - return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigListGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(this.axios, this.basePath)); + public async apiSysCodeGenConfigListGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigListGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(this.axios, this.basePath)); } /** * diff --git a/Web/src/api-services/apis/sys-common-api.ts b/Web/src/api-services/apis/sys-common-api.ts index 2de9a014..00056587 100644 --- a/Web/src/api-services/apis/sys-common-api.ts +++ b/Web/src/api-services/apis/sys-common-api.ts @@ -174,6 +174,59 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura options: localVarRequestOptions, }; }, + /** + * + * @summary 生成所有移动端接口文件 🔖 + * @param {string} [groupName] + * @param {boolean} [isAppApi] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCommonGenerateAppApiGet: async (groupName?: string, isAppApi?: boolean, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysCommon/generateAppApi`; + // 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; + } + + if (groupName !== undefined) { + localVarQueryParameter['groupName'] = groupName; + } + + if (isAppApi !== undefined) { + localVarQueryParameter['isAppApi'] = isAppApi; + } + + 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 获取MD5加密字符串 🏆 @@ -512,6 +565,21 @@ export const SysCommonApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, + /** + * + * @summary 生成所有移动端接口文件 🔖 + * @param {string} [groupName] + * @param {boolean} [isAppApi] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCommonGenerateAppApiGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonGenerateAppApiGet(groupName, isAppApi, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, /** * * @summary 获取MD5加密字符串 🏆 @@ -634,6 +702,17 @@ export const SysCommonApiFactory = function (configuration?: Configuration, base async apiSysCommonDownloadErrorExcelTempPost(fileName?: string, options?: AxiosRequestConfig): Promise> { return SysCommonApiFp(configuration).apiSysCommonDownloadErrorExcelTempPost(fileName, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary 生成所有移动端接口文件 🔖 + * @param {string} [groupName] + * @param {boolean} [isAppApi] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCommonGenerateAppApiGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig): Promise> { + return SysCommonApiFp(configuration).apiSysCommonGenerateAppApiGet(groupName, isAppApi, options).then((request) => request(axios, basePath)); + }, /** * * @summary 获取MD5加密字符串 🏆 @@ -736,6 +815,18 @@ export class SysCommonApi extends BaseAPI { public async apiSysCommonDownloadErrorExcelTempPost(fileName?: string, options?: AxiosRequestConfig) : Promise> { return SysCommonApiFp(this.configuration).apiSysCommonDownloadErrorExcelTempPost(fileName, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary 生成所有移动端接口文件 🔖 + * @param {string} [groupName] + * @param {boolean} [isAppApi] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCommonApi + */ + public async apiSysCommonGenerateAppApiGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig) : Promise> { + return SysCommonApiFp(this.configuration).apiSysCommonGenerateAppApiGet(groupName, isAppApi, options).then((request) => request(this.axios, this.basePath)); + } /** * * @summary 获取MD5加密字符串 🏆 diff --git a/Web/src/api-services/apis/sys-database-api.ts b/Web/src/api-services/apis/sys-database-api.ts index 76b25281..08285136 100644 --- a/Web/src/api-services/apis/sys-database-api.ts +++ b/Web/src/api-services/apis/sys-database-api.ts @@ -20,6 +20,7 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr import { AdminNETResultListDbColumnOutput } from '../models'; import { AdminNETResultListDbTableInfo } from '../models'; import { AdminNETResultListString } from '../models'; +import { AdminNETResultString } from '../models'; import { AdminNETResultVisualDbTable } from '../models'; import { CreateEntityInput } from '../models'; import { CreateSeedDataInput } from '../models'; @@ -470,6 +471,121 @@ export const SysDatabaseApiAxiosParamCreator = function (configuration?: Configu options: localVarRequestOptions, }; }, + /** + * + * @summary 创建实体文件内容 + * @param {string} configId + * @param {string} tableName + * @param {string} position + * @param {string} baseClassName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost: async (configId: string, tableName: string, position: string, baseClassName: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'configId' is not null or undefined + if (configId === null || configId === undefined) { + throw new RequiredError('configId','Required parameter configId was null or undefined when calling apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost.'); + } + // verify required parameter 'tableName' is not null or undefined + if (tableName === null || tableName === undefined) { + throw new RequiredError('tableName','Required parameter tableName was null or undefined when calling apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost.'); + } + // verify required parameter 'position' is not null or undefined + if (position === null || position === undefined) { + throw new RequiredError('position','Required parameter position was null or undefined when calling apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost.'); + } + // verify required parameter 'baseClassName' is not null or undefined + if (baseClassName === null || baseClassName === undefined) { + throw new RequiredError('baseClassName','Required parameter baseClassName was null or undefined when calling apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost.'); + } + const localVarPath = `/api/sysDatabase/generateEntity/{configId}/{tableName}/{position}/{baseClassName}` + .replace(`{${"configId"}}`, encodeURIComponent(String(configId))) + .replace(`{${"tableName"}}`, encodeURIComponent(String(tableName))) + .replace(`{${"position"}}`, encodeURIComponent(String(position))) + .replace(`{${"baseClassName"}}`, encodeURIComponent(String(baseClassName))); + // 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: 'POST', ...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 创建实体文件内容 + * @param {CreateEntityInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysDatabaseGenerateEntityPost: async (body?: CreateEntityInput, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysDatabase/generateEntity`; + // 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: 'POST', ...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; + } + + localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; + + 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}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, /** * * @summary 获取库列表 🔖 @@ -836,6 +952,37 @@ export const SysDatabaseApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, + /** + * + * @summary 创建实体文件内容 + * @param {string} configId + * @param {string} tableName + * @param {string} position + * @param {string} baseClassName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost(configId: string, tableName: string, position: string, baseClassName: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysDatabaseApiAxiosParamCreator(configuration).apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost(configId, tableName, position, baseClassName, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary 创建实体文件内容 + * @param {CreateEntityInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysDatabaseGenerateEntityPost(body?: CreateEntityInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysDatabaseApiAxiosParamCreator(configuration).apiSysDatabaseGenerateEntityPost(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, /** * * @summary 获取库列表 🔖 @@ -1003,6 +1150,29 @@ export const SysDatabaseApiFactory = function (configuration?: Configuration, ba async apiSysDatabaseDeleteTablePost(body?: DeleteDbTableInput, options?: AxiosRequestConfig): Promise> { return SysDatabaseApiFp(configuration).apiSysDatabaseDeleteTablePost(body, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary 创建实体文件内容 + * @param {string} configId + * @param {string} tableName + * @param {string} position + * @param {string} baseClassName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost(configId: string, tableName: string, position: string, baseClassName: string, options?: AxiosRequestConfig): Promise> { + return SysDatabaseApiFp(configuration).apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost(configId, tableName, position, baseClassName, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 创建实体文件内容 + * @param {CreateEntityInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysDatabaseGenerateEntityPost(body?: CreateEntityInput, options?: AxiosRequestConfig): Promise> { + return SysDatabaseApiFp(configuration).apiSysDatabaseGenerateEntityPost(body, options).then((request) => request(axios, basePath)); + }, /** * * @summary 获取库列表 🔖 @@ -1160,6 +1330,31 @@ export class SysDatabaseApi extends BaseAPI { public async apiSysDatabaseDeleteTablePost(body?: DeleteDbTableInput, options?: AxiosRequestConfig) : Promise> { return SysDatabaseApiFp(this.configuration).apiSysDatabaseDeleteTablePost(body, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary 创建实体文件内容 + * @param {string} configId + * @param {string} tableName + * @param {string} position + * @param {string} baseClassName + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysDatabaseApi + */ + public async apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost(configId: string, tableName: string, position: string, baseClassName: string, options?: AxiosRequestConfig) : Promise> { + return SysDatabaseApiFp(this.configuration).apiSysDatabaseGenerateEntityConfigIdTableNamePositionBaseClassNamePost(configId, tableName, position, baseClassName, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary 创建实体文件内容 + * @param {CreateEntityInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysDatabaseApi + */ + public async apiSysDatabaseGenerateEntityPost(body?: CreateEntityInput, options?: AxiosRequestConfig) : Promise> { + return SysDatabaseApiFp(this.configuration).apiSysDatabaseGenerateEntityPost(body, options).then((request) => request(this.axios, this.basePath)); + } /** * * @summary 获取库列表 🔖 diff --git a/Web/src/api-services/apis/sys-tenant-api.ts b/Web/src/api-services/apis/sys-tenant-api.ts index 6fa1c32c..5555581a 100644 --- a/Web/src/api-services/apis/sys-tenant-api.ts +++ b/Web/src/api-services/apis/sys-tenant-api.ts @@ -24,6 +24,7 @@ import { AdminNETResultListSysUser } from '../models'; import { AdminNETResultObject } from '../models'; import { AdminNETResultSqlSugarPagedListTenantOutput } from '../models'; import { AdminNETResultString } from '../models'; +import { AdminNETResultSysFile } from '../models'; import { DeleteTenantInput } from '../models'; import { PageTenantInput } from '../models'; import { RoleMenuInput } from '../models'; @@ -658,6 +659,58 @@ export const SysTenantApiAxiosParamCreator = function (configuration?: Configura options: localVarRequestOptions, }; }, + /** + * + * @summary 上传轮播图单文件 🔖 + * @param {Blob} [file] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysTenantUploadCarouselFilePostForm: async (file?: Blob, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysTenant/uploadCarouselFile`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new FormData(); + + // 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; + } + + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + 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}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, /** * * @summary 获取租户下的用户列表 🔖 @@ -896,6 +949,20 @@ export const SysTenantApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, + /** + * + * @summary 上传轮播图单文件 🔖 + * @param {Blob} [file] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysTenantUploadCarouselFilePostForm(file?: Blob, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysTenantApiAxiosParamCreator(configuration).apiSysTenantUploadCarouselFilePostForm(file, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, /** * * @summary 获取租户下的用户列表 🔖 @@ -1048,6 +1115,16 @@ export const SysTenantApiFactory = function (configuration?: Configuration, base async apiSysTenantUpdatePost(body?: UpdateTenantInput, options?: AxiosRequestConfig): Promise> { return SysTenantApiFp(configuration).apiSysTenantUpdatePost(body, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary 上传轮播图单文件 🔖 + * @param {Blob} [file] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysTenantUploadCarouselFilePostForm(file?: Blob, options?: AxiosRequestConfig): Promise> { + return SysTenantApiFp(configuration).apiSysTenantUploadCarouselFilePostForm(file, options).then((request) => request(axios, basePath)); + }, /** * * @summary 获取租户下的用户列表 🔖 @@ -1210,6 +1287,17 @@ export class SysTenantApi extends BaseAPI { public async apiSysTenantUpdatePost(body?: UpdateTenantInput, options?: AxiosRequestConfig) : Promise> { return SysTenantApiFp(this.configuration).apiSysTenantUpdatePost(body, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary 上传轮播图单文件 🔖 + * @param {Blob} [file] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysTenantApi + */ + public async apiSysTenantUploadCarouselFilePostForm(file?: Blob, options?: AxiosRequestConfig) : Promise> { + return SysTenantApiFp(this.configuration).apiSysTenantUploadCarouselFilePostForm(file, options).then((request) => request(this.axios, this.basePath)); + } /** * * @summary 获取租户下的用户列表 🔖 diff --git a/Web/src/api-services/apis/sys-user-api.ts b/Web/src/api-services/apis/sys-user-api.ts index 0143f6b8..faf9857c 100644 --- a/Web/src/api-services/apis/sys-user-api.ts +++ b/Web/src/api-services/apis/sys-user-api.ts @@ -132,54 +132,6 @@ export const SysUserApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, - /** - * - * @summary 更新用户基本信息 🔖 - * @param {SysUser} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysUserBaseInfoPost: async (body?: SysUser, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysUser/baseInfo`; - // 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: 'POST', ...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; - } - - localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; - - 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}; - const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, /** * * @summary 修改用户密码 🔖 @@ -614,6 +566,54 @@ export const SysUserApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, + /** + * + * @summary 更新用户基本信息 🔖 + * @param {SysUser} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysUserUpdateBaseInfoPost: async (body?: SysUser, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysUser/updateBaseInfo`; + // 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: 'POST', ...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; + } + + localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; + + 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}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, /** * * @summary 更新用户 🔖 @@ -741,20 +741,6 @@ export const SysUserApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, - /** - * - * @summary 更新用户基本信息 🔖 - * @param {SysUser} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysUserBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysUserApiAxiosParamCreator(configuration).apiSysUserBaseInfoPost(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, /** * * @summary 修改用户密码 🔖 @@ -881,6 +867,20 @@ export const SysUserApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, + /** + * + * @summary 更新用户基本信息 🔖 + * @param {SysUser} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysUserUpdateBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysUserApiAxiosParamCreator(configuration).apiSysUserUpdateBaseInfoPost(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, /** * * @summary 更新用户 🔖 @@ -936,16 +936,6 @@ export const SysUserApiFactory = function (configuration?: Configuration, basePa async apiSysUserBaseInfoGet(options?: AxiosRequestConfig): Promise> { return SysUserApiFp(configuration).apiSysUserBaseInfoGet(options).then((request) => request(axios, basePath)); }, - /** - * - * @summary 更新用户基本信息 🔖 - * @param {SysUser} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysUserBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig): Promise> { - return SysUserApiFp(configuration).apiSysUserBaseInfoPost(body, options).then((request) => request(axios, basePath)); - }, /** * * @summary 修改用户密码 🔖 @@ -1036,6 +1026,16 @@ export const SysUserApiFactory = function (configuration?: Configuration, basePa async apiSysUserUnlockLoginPost(body?: UnlockLoginInput, options?: AxiosRequestConfig): Promise> { return SysUserApiFp(configuration).apiSysUserUnlockLoginPost(body, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary 更新用户基本信息 🔖 + * @param {SysUser} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysUserUpdateBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig): Promise> { + return SysUserApiFp(configuration).apiSysUserUpdateBaseInfoPost(body, options).then((request) => request(axios, basePath)); + }, /** * * @summary 更新用户 🔖 @@ -1086,17 +1086,6 @@ export class SysUserApi extends BaseAPI { public async apiSysUserBaseInfoGet(options?: AxiosRequestConfig) : Promise> { return SysUserApiFp(this.configuration).apiSysUserBaseInfoGet(options).then((request) => request(this.axios, this.basePath)); } - /** - * - * @summary 更新用户基本信息 🔖 - * @param {SysUser} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysUserApi - */ - public async apiSysUserBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig) : Promise> { - return SysUserApiFp(this.configuration).apiSysUserBaseInfoPost(body, options).then((request) => request(this.axios, this.basePath)); - } /** * * @summary 修改用户密码 🔖 @@ -1196,6 +1185,17 @@ export class SysUserApi extends BaseAPI { public async apiSysUserUnlockLoginPost(body?: UnlockLoginInput, options?: AxiosRequestConfig) : Promise> { return SysUserApiFp(this.configuration).apiSysUserUnlockLoginPost(body, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary 更新用户基本信息 🔖 + * @param {SysUser} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysUserApi + */ + public async apiSysUserUpdateBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig) : Promise> { + return SysUserApiFp(this.configuration).apiSysUserUpdateBaseInfoPost(body, options).then((request) => request(this.axios, this.basePath)); + } /** * * @summary 更新用户 🔖 diff --git a/Web/src/api-services/models/add-tenant-input.ts b/Web/src/api-services/models/add-tenant-input.ts index 15951efb..12949e05 100644 --- a/Web/src/api-services/models/add-tenant-input.ts +++ b/Web/src/api-services/models/add-tenant-input.ts @@ -287,7 +287,7 @@ export interface AddTenantInput { * @type {boolean} * @memberof AddTenantInput */ - captcha?: boolean; + captcha?: boolean | null; /** * 登录二次验证 @@ -295,7 +295,7 @@ export interface AddTenantInput { * @type {boolean} * @memberof AddTenantInput */ - secondVer?: boolean; + secondVer?: boolean | null; /** * 真实姓名 diff --git a/Web/src/api-services/models/admin-netresult-ienumerable-entity-info.ts b/Web/src/api-services/models/admin-netresult-ienumerable-entity-info.ts new file mode 100644 index 00000000..7a3f852e --- /dev/null +++ b/Web/src/api-services/models/admin-netresult-ienumerable-entity-info.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { EntityInfo } from './entity-info'; + /** + * 全局返回结果 + * + * @export + * @interface AdminNETResultIEnumerableEntityInfo + */ +export interface AdminNETResultIEnumerableEntityInfo { + + /** + * 状态码 + * + * @type {number} + * @memberof AdminNETResultIEnumerableEntityInfo + */ + code?: number; + + /** + * 类型success、warning、error + * + * @type {string} + * @memberof AdminNETResultIEnumerableEntityInfo + */ + type?: string | null; + + /** + * 错误信息 + * + * @type {string} + * @memberof AdminNETResultIEnumerableEntityInfo + */ + message?: string | null; + + /** + * 数据 + * + * @type {Array} + * @memberof AdminNETResultIEnumerableEntityInfo + */ + result?: Array | null; + + /** + * 附加数据 + * + * @type {any} + * @memberof AdminNETResultIEnumerableEntityInfo + */ + extras?: any | null; + + /** + * 时间 + * + * @type {Date} + * @memberof AdminNETResultIEnumerableEntityInfo + */ + time?: Date; +} diff --git a/Web/src/api-services/models/api-output.ts b/Web/src/api-services/models/api-output.ts index d482ed3a..99b33d84 100644 --- a/Web/src/api-services/models/api-output.ts +++ b/Web/src/api-services/models/api-output.ts @@ -45,6 +45,14 @@ export interface ApiOutput { */ route?: string | null; + /** + * 控制器名称 + * + * @type {string} + * @memberof ApiOutput + */ + action?: string | null; + /** * 请求方式 * diff --git a/Web/src/api-services/models/code-gen-config.ts b/Web/src/api-services/models/code-gen-config.ts index 5add74f6..dd17b1bf 100644 --- a/Web/src/api-services/models/code-gen-config.ts +++ b/Web/src/api-services/models/code-gen-config.ts @@ -189,6 +189,14 @@ export interface CodeGenConfig { */ whetherSortable?: string | null; + /** + * 是否是统计字段 + * + * @type {string} + * @memberof CodeGenConfig + */ + statistical?: string | null; + /** * 是否是查询条件 * diff --git a/Web/src/api-services/models/entity-column-info.ts b/Web/src/api-services/models/entity-column-info.ts new file mode 100644 index 00000000..60a1ff33 --- /dev/null +++ b/Web/src/api-services/models/entity-column-info.ts @@ -0,0 +1,271 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { Navigate } from './navigate'; +import { PropertyInfo } from './property-info'; +import { Type } from './type'; + /** + * + * + * @export + * @interface EntityColumnInfo + */ +export interface EntityColumnInfo { + + /** + * @type {PropertyInfo} + * @memberof EntityColumnInfo + */ + propertyInfo?: PropertyInfo; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + propertyName?: string | null; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + dbColumnName?: string | null; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + oldDbColumnName?: string | null; + + /** + * @type {number} + * @memberof EntityColumnInfo + */ + length?: number; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + columnDescription?: string | null; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + defaultValue?: string | null; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isNullable?: boolean; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isIdentity?: boolean; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isPrimarykey?: boolean; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isTreeKey?: boolean; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isEnableUpdateVersionValidation?: boolean; + + /** + * @type {any} + * @memberof EntityColumnInfo + */ + sqlParameterDbType?: any | null; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + entityName?: string | null; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + dbTableName?: string | null; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isIgnore?: boolean; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + dataType?: string | null; + + /** + * @type {number} + * @memberof EntityColumnInfo + */ + decimalDigits?: number; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + oracleSequenceName?: string | null; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isOnlyIgnoreInsert?: boolean; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isOnlyIgnoreUpdate?: boolean; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isTranscoding?: boolean; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + serializeDateTimeFormat?: string | null; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isJson?: boolean; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + noSerialize?: boolean; + + /** + * @type {Array} + * @memberof EntityColumnInfo + */ + indexGroupNameList?: Array | null; + + /** + * @type {Array} + * @memberof EntityColumnInfo + */ + uIndexGroupNameList?: Array | null; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isArray?: boolean; + + /** + * @type {Type} + * @memberof EntityColumnInfo + */ + underType?: Type; + + /** + * @type {Navigate} + * @memberof EntityColumnInfo + */ + navigat?: Navigate; + + /** + * @type {number} + * @memberof EntityColumnInfo + */ + createTableFieldSort?: number; + + /** + * @type {any} + * @memberof EntityColumnInfo + */ + sqlParameterSize?: any | null; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + insertSql?: string | null; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + insertServerTime?: boolean; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + updateServerTime?: boolean; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + updateSql?: string | null; + + /** + * @type {any} + * @memberof EntityColumnInfo + */ + extendedAttribute?: any | null; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isDisabledAlterColumn?: boolean; + + /** + * @type {string} + * @memberof EntityColumnInfo + */ + querySql?: string | null; + + /** + * @type {boolean} + * @memberof EntityColumnInfo + */ + isOwnsOne?: boolean; + + /** + * @type {PropertyInfo} + * @memberof EntityColumnInfo + */ + forOwnsOnePropertyInfo?: PropertyInfo; +} diff --git a/Web/src/api-services/models/entity-info.ts b/Web/src/api-services/models/entity-info.ts new file mode 100644 index 00000000..44b6bef6 --- /dev/null +++ b/Web/src/api-services/models/entity-info.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { EntityColumnInfo } from './entity-column-info'; +import { SugarIndexAttribute } from './sugar-index-attribute'; +import { Type } from './type'; + /** + * + * + * @export + * @interface EntityInfo + */ +export interface EntityInfo { + + /** + * @type {string} + * @memberof EntityInfo + */ + entityName?: string | null; + + /** + * @type {string} + * @memberof EntityInfo + */ + dbTableName?: string | null; + + /** + * @type {string} + * @memberof EntityInfo + */ + tableDescription?: string | null; + + /** + * @type {Type} + * @memberof EntityInfo + */ + type?: Type; + + /** + * @type {Array} + * @memberof EntityInfo + */ + columns?: Array | null; + + /** + * @type {boolean} + * @memberof EntityInfo + */ + isDisabledDelete?: boolean; + + /** + * @type {boolean} + * @memberof EntityInfo + */ + isDisabledUpdateAll?: boolean; + + /** + * @type {Array} + * @memberof EntityInfo + */ + indexs?: Array | null; + + /** + * @type {boolean} + * @memberof EntityInfo + */ + isCreateTableFiledSort?: boolean; + + /** + * @type {string} + * @memberof EntityInfo + */ + discrimator?: string | null; +} diff --git a/Web/src/api-services/models/index.ts b/Web/src/api-services/models/index.ts index de15bfcf..e3c806d4 100644 --- a/Web/src/api-services/models/index.ts +++ b/Web/src/api-services/models/index.ts @@ -32,6 +32,7 @@ export * from './admin-netresult-get-refund-domestic-refund-by-out-refund-number export * from './admin-netresult-grant-role-output'; export * from './admin-netresult-iaction-result'; export * from './admin-netresult-idisposable'; +export * from './admin-netresult-ienumerable-entity-info'; export * from './admin-netresult-int32'; export * from './admin-netresult-int64'; export * from './admin-netresult-jobject'; @@ -204,6 +205,8 @@ export * from './delete-user-input'; export * from './dict-data-input'; export * from './dict-type-input'; export * from './digit-shapes'; +export * from './entity-column-info'; +export * from './entity-info'; export * from './enum-entity'; export * from './enum-type-output'; export * from './event-attributes'; @@ -268,6 +271,7 @@ export * from './method-impl-attributes'; export * from './method-info'; export * from './module'; export * from './module-handle'; +export * from './navigate'; export * from './notice-input'; export * from './notice-status-enum'; export * from './notice-type-enum'; @@ -276,6 +280,7 @@ export * from './number-format-info'; export * from './oauth-user-input'; export * from './oauth-user-output'; export * from './open-access-output'; +export * from './order-by-type'; export * from './page-code-gen-input'; export * from './page-config-input'; export * from './page-dict-data-input'; @@ -367,6 +372,7 @@ export * from './status-enum'; export * from './stress-test-harness-result'; export * from './stress-test-input'; export * from './struct-layout-attribute'; +export * from './sugar-index-attribute'; export * from './swagger-submit-url-body'; export * from './sync-sys-ldap-input'; export * from './sys-code-gen'; @@ -403,6 +409,7 @@ export * from './sys-plugin'; export * from './sys-print'; export * from './sys-region'; export * from './sys-schedule'; +export * from './sys-tenant-upload-carousel-file-body'; export * from './sys-upgrade'; export * from './sys-user'; export * from './sys-user-ext-org'; diff --git a/Web/src/api-services/models/navigate.ts b/Web/src/api-services/models/navigate.ts new file mode 100644 index 00000000..4d975125 --- /dev/null +++ b/Web/src/api-services/models/navigate.ts @@ -0,0 +1,28 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface Navigate + */ +export interface Navigate { + + /** + * @type {any} + * @memberof Navigate + */ + typeId?: any | null; +} diff --git a/Web/src/api-services/models/order-by-type.ts b/Web/src/api-services/models/order-by-type.ts new file mode 100644 index 00000000..98076f7a --- /dev/null +++ b/Web/src/api-services/models/order-by-type.ts @@ -0,0 +1,24 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum OrderByType { + NUMBER_0 = 0, + NUMBER_1 = 1 +} + diff --git a/Web/src/api-services/models/sugar-index-attribute.ts b/Web/src/api-services/models/sugar-index-attribute.ts new file mode 100644 index 00000000..9519fcd5 --- /dev/null +++ b/Web/src/api-services/models/sugar-index-attribute.ts @@ -0,0 +1,47 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { OrderByType } from './order-by-type'; + /** + * + * + * @export + * @interface SugarIndexAttribute + */ +export interface SugarIndexAttribute { + + /** + * @type {any} + * @memberof SugarIndexAttribute + */ + typeId?: any | null; + + /** + * @type {string} + * @memberof SugarIndexAttribute + */ + indexName?: string | null; + + /** + * @type {{ [key: string]: OrderByType; }} + * @memberof SugarIndexAttribute + */ + indexFields?: { [key: string]: OrderByType; } | null; + + /** + * @type {boolean} + * @memberof SugarIndexAttribute + */ + isUnique?: boolean; +} diff --git a/Web/src/api-services/models/sys-code-gen-config.ts b/Web/src/api-services/models/sys-code-gen-config.ts index 8ce66943..aa476372 100644 --- a/Web/src/api-services/models/sys-code-gen-config.ts +++ b/Web/src/api-services/models/sys-code-gen-config.ts @@ -220,6 +220,14 @@ export interface SysCodeGenConfig { */ whetherSortable?: string | null; + /** + * 是否是统计字段 + * + * @type {string} + * @memberof SysCodeGenConfig + */ + statistical?: string | null; + /** * 是否是查询条件 * diff --git a/Web/src/api-services/models/sys-info-input.ts b/Web/src/api-services/models/sys-info-input.ts index 2642fb1f..26624763 100644 --- a/Web/src/api-services/models/sys-info-input.ts +++ b/Web/src/api-services/models/sys-info-input.ts @@ -147,4 +147,12 @@ export interface SysInfoInput { * @memberof SysInfoInput */ secondVer?: boolean; + + /** + * 轮播图 + * + * @type {Array} + * @memberof SysInfoInput + */ + carouselFiles?: Array | null; } diff --git a/Web/src/api-services/models/sys-tenant-upload-carousel-file-body.ts b/Web/src/api-services/models/sys-tenant-upload-carousel-file-body.ts new file mode 100644 index 00000000..402b1822 --- /dev/null +++ b/Web/src/api-services/models/sys-tenant-upload-carousel-file-body.ts @@ -0,0 +1,28 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface SysTenantUploadCarouselFileBody + */ +export interface SysTenantUploadCarouselFileBody { + + /** + * @type {Blob} + * @memberof SysTenantUploadCarouselFileBody + */ + file: Blob; +} diff --git a/Web/src/api-services/models/tenant-output.ts b/Web/src/api-services/models/tenant-output.ts index a5c166d7..dd198f8e 100644 --- a/Web/src/api-services/models/tenant-output.ts +++ b/Web/src/api-services/models/tenant-output.ts @@ -287,7 +287,7 @@ export interface TenantOutput { * @type {boolean} * @memberof TenantOutput */ - captcha?: boolean; + captcha?: boolean | null; /** * 登录二次验证 @@ -295,7 +295,7 @@ export interface TenantOutput { * @type {boolean} * @memberof TenantOutput */ - secondVer?: boolean; + secondVer?: boolean | null; /** * 租户名称 diff --git a/Web/src/api-services/models/update-tenant-input.ts b/Web/src/api-services/models/update-tenant-input.ts index 9679df2d..d687a54b 100644 --- a/Web/src/api-services/models/update-tenant-input.ts +++ b/Web/src/api-services/models/update-tenant-input.ts @@ -287,7 +287,7 @@ export interface UpdateTenantInput { * @type {boolean} * @memberof UpdateTenantInput */ - captcha?: boolean; + captcha?: boolean | null; /** * 登录二次验证 @@ -295,7 +295,7 @@ export interface UpdateTenantInput { * @type {boolean} * @memberof UpdateTenantInput */ - secondVer?: boolean; + secondVer?: boolean | null; /** * 真实姓名 diff --git a/Web/src/router/index.ts b/Web/src/router/index.ts index 240a2b78..21a176bf 100644 --- a/Web/src/router/index.ts +++ b/Web/src/router/index.ts @@ -6,7 +6,7 @@ import { storeToRefs } from 'pinia'; import { useKeepALiveNames } from '/@/stores/keepAliveNames'; import { useRoutesList } from '/@/stores/routesList'; import { useThemeConfig } from '/@/stores/themeConfig'; -import { Session } from '/@/utils/storage'; +import { Session, Local } from '/@/utils/storage'; import { staticRoutes, notFoundAndNoPower } from '/@/router/route'; import { initFrontEndControlRoutes } from '/@/router/frontEnd'; import { initBackEndControlRoutes } from '/@/router/backEnd'; @@ -102,7 +102,11 @@ router.beforeEach(async (to, from, next) => { NProgress.done(); } else { if (!token) { - next(`/login?redirect=${to.path}¶ms=${JSON.stringify(to.query ? to.query : to.params)}`); + var routeLocation = `/login?redirect=${to.path}¶ms=${JSON.stringify(to.query ? to.query : to.params)}`; + // 附加租户Id标识 + var tenantid = Number(Local.get('tid')); + if (!isNaN(tenantid) && tenantid > 99999) routeLocation += `&tid=${tenantid}`; + next(routeLocation); Session.clear(); NProgress.done(); } else if (token && to.path === '/login') { diff --git a/Web/src/stores/userInfo.ts b/Web/src/stores/userInfo.ts index a5757cdb..73ed9055 100644 --- a/Web/src/stores/userInfo.ts +++ b/Web/src/stores/userInfo.ts @@ -1,7 +1,5 @@ import { defineStore } from 'pinia'; -import { Local, Session } from '/@/utils/storage'; -import Watermark from '/@/utils/watermark'; -import { useThemeConfig } from '/@/stores/themeConfig'; +import { Session } from '/@/utils/storage'; import { i18n } from '/@/i18n'; import { getAPI } from '/@/utils/axios-utils'; @@ -92,15 +90,6 @@ export const useUserInfo = defineStore('userInfo', { // 增加了下面代码,引起当前会话的用户信息不会刷新,如:重新提交的头像不更新,需要新开一个页面才能正确显示 // Session.set('userInfo', userInfos); - // 用户水印 - const storesThemeConfig = useThemeConfig(); - storesThemeConfig.themeConfig.watermarkText = d.watermarkText ?? ''; - if (storesThemeConfig.themeConfig.isWatermark) Watermark.set(storesThemeConfig.themeConfig.watermarkText); - else Watermark.del(); - - Local.remove('themeConfig'); - Local.set('themeConfig', storesThemeConfig.themeConfig); - resolve(userInfos); }); }); diff --git a/Web/src/utils/storage.ts b/Web/src/utils/storage.ts index f96aeb1e..281dd9b0 100644 --- a/Web/src/utils/storage.ts +++ b/Web/src/utils/storage.ts @@ -28,7 +28,9 @@ export const Local = { }, // 移除全部永久缓存 clear() { + var tid = Local.get('tid'); window.localStorage.clear(); + Local.set('tid', tid); }, }; diff --git a/Web/src/views/login/index.vue b/Web/src/views/login/index.vue index c48687ad..96c14220 100644 --- a/Web/src/views/login/index.vue +++ b/Web/src/views/login/index.vue @@ -65,6 +65,7 @@ import loginIconTwo1 from '/@/assets/login-icon-two1.svg'; import loginIconTwo2 from '/@/assets/login-icon-two2.svg'; // 加载系统信息 import { loadSysInfo } from '/@/utils/sysInfo'; +import { Local } from '/@/utils/storage'; // 引入组件 const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue')); @@ -84,8 +85,14 @@ const getThemeConfig = computed(() => { }); // 页面加载时 onMounted(() => { - var tenantid = route.query.tenantid ?? 0; - loadSysInfo(Number(tenantid)); + // 获取租户Id标识 + var tenantid = Number(route.query.tid); + if (isNaN(tenantid)) { + tenantid = 0; + } else if (tenantid > 99999) { + Local.set('tid', tenantid); + } + loadSysInfo(tenantid); NextLoading.done(); }); diff --git a/Web/src/views/system/codeGen/component/genConfigDialog.vue b/Web/src/views/system/codeGen/component/genConfigDialog.vue index 35a294bf..b2f7a487 100644 --- a/Web/src/views/system/codeGen/component/genConfigDialog.vue +++ b/Web/src/views/system/codeGen/component/genConfigDialog.vue @@ -35,6 +35,9 @@ + @@ -83,6 +86,8 @@ const verifyDialogRef = ref(); const state = reactive({ isShowDialog: false, loading: false, + EntityName: '', + ConfigId: '', dbData: [] as any, effectTypeList: [] as any, dictTypeCodeList: [] as any, @@ -191,6 +196,15 @@ const options = reactive({ default: 'whetherSortable', }, }, + { + field: 'statistical', + title: '统计字段', + minWidth: 70, + slots: { + edit: 'statistical', + default: 'statistical', + }, + }, { field: 'queryWhether', title: '是否是查询', @@ -342,7 +356,8 @@ function effectTypeEnable(data: any) { // 打开弹窗 const openDialog = async (addRow: any) => { state.isShowDialog = true; - + state.ConfigId = addRow.configId; + state.EntityName = addRow.tableName; nextTick(async () => { await handleQuery(addRow); rowDrop(); diff --git a/Web/src/views/system/infoSetting/index.vue b/Web/src/views/system/infoSetting/index.vue index cad996d3..6d1ea6ea 100644 --- a/Web/src/views/system/infoSetting/index.vue +++ b/Web/src/views/system/infoSetting/index.vue @@ -152,7 +152,7 @@ - + @@ -191,16 +191,12 @@