Merge pull request 'main' (#2) from Admin.NET/Admin.NET.Pro:main into main

Reviewed-on: http://101.43.53.74:3000/shuerchoi/Admin.NET.Pro/pulls/2
This commit is contained in:
shuerchoi 2024-07-15 13:31:59 +08:00
commit 8566071d0c
173 changed files with 6932 additions and 3424 deletions

View File

@ -17,27 +17,27 @@
<PackageReference Include="AngleSharp" Version="1.1.2" /> <PackageReference Include="AngleSharp" Version="1.1.2" />
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" /> <PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" /> <PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.14.4" /> <PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.14.6" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.4.3" /> <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.4.5" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.4.3" /> <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.4.5" />
<PackageReference Include="Furion.Pure" Version="4.9.4.3" /> <PackageReference Include="Furion.Pure" Version="4.9.4.5" />
<PackageReference Include="IPTools.China" Version="1.6.0" /> <PackageReference Include="IPTools.China" Version="1.6.0" />
<PackageReference Include="IPTools.International" Version="1.6.0" /> <PackageReference Include="IPTools.International" Version="1.6.0" />
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.5.1" /> <PackageReference Include="Magicodes.IE.Excel" Version="2.7.5.1" />
<PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.1" /> <PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.1" />
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.1" /> <PackageReference Include="Magicodes.IE.Word" Version="2.7.5.1" />
<PackageReference Include="MailKit" Version="4.7.0" /> <PackageReference Include="MailKit" Version="4.7.1" />
<PackageReference Include="NewLife.Redis" Version="5.7.2024.701" /> <PackageReference Include="NewLife.Redis" Version="5.7.2024.709" />
<PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.6.0" /> <PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.6.0" />
<PackageReference Include="QRCoder" Version="1.6.0" /> <PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" /> <PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" /> <PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.3.0" /> <PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.3.0" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.6.0" /> <PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.6.0" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.160" /> <PackageReference Include="SqlSugarCore" Version="5.1.4.162" />
<PackageReference Include="SSH.NET" Version="2024.1.0" /> <PackageReference Include="SSH.NET" Version="2024.1.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.3" /> <PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.3" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1042" /> <PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1047" />
<PackageReference Include="UAParser" Version="3.1.47" /> <PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" /> <PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup> </ItemGroup>
@ -45,7 +45,7 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' "> <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="AspNet.Security.OAuth.Gitee" Version="6.0.15" /> <PackageReference Include="AspNet.Security.OAuth.Gitee" Version="6.0.15" />
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="6.0.15" /> <PackageReference Include="AspNet.Security.OAuth.Weixin" Version="6.0.15" />
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.6" /> <PackageReference Include="Lazy.Captcha.Core" Version="2.0.8" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.31" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.31" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="6.0.31" /> <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="6.0.31" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.31" /> <PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.31" />
@ -56,9 +56,9 @@
<PackageReference Include="AspNet.Security.OAuth.Gitee" Version="8.1.0" /> <PackageReference Include="AspNet.Security.OAuth.Gitee" Version="8.1.0" />
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="8.1.0" /> <PackageReference Include="AspNet.Security.OAuth.Weixin" Version="8.1.0" />
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.7" /> <PackageReference Include="Lazy.Captcha.Core" Version="2.0.7" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.6" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.6" /> <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.6" /> <PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.7" />
<PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.2.0" /> <PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.2.0" />
</ItemGroup> </ItemGroup>

View File

@ -0,0 +1,16 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 所属机构数据权限
/// </summary>
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
public class OwnerOrgAttribute : Attribute
{
}

View File

@ -0,0 +1,16 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 所属用户数据权限
/// </summary>
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
public class OwnerUserAttribute : Attribute
{
}

View File

@ -100,4 +100,9 @@ public class CacheConst
/// 系统字典缓存 /// 系统字典缓存
/// </summary> /// </summary>
public const string KeyDict = "sys_dict:"; public const string KeyDict = "sys_dict:";
/// <summary>
/// Excel临时文件缓存
/// </summary>
public const string KeyExcelTemp = "sys_excel_temp:";
} }

View File

@ -87,6 +87,11 @@ public class CommonConst
/// </summary> /// </summary>
public const string SysValidationLog = "sys_validation_log"; public const string SysValidationLog = "sys_validation_log";
/// <summary>
/// 行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级
/// </summary>
public const string SysRegionSyncLevel = "sys_region_sync_level";
/// <summary> /// <summary>
/// 日志保留天数 /// 日志保留天数
/// </summary> /// </summary>

View File

@ -0,0 +1,58 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 配置常量
/// </summary>
public class ConfigConst
{
/// <summary>
/// WebConfig 分组
/// </summary>
public const string SysWebConfigGroup = "WebConfig";
/// <summary>
/// 系统图标
/// </summary>
public const string SysWebLogo = "sys_web_logo";
/// <summary>
/// 系统主标题
/// </summary>
public const string SysWebTitle = "sys_web_title";
/// <summary>
/// 系统副标题
/// </summary>
public const string SysWebViceTitle = "sys_web_viceTitle";
/// <summary>
/// 系统描述
/// </summary>
public const string SysWebViceDesc = "sys_web_viceDesc";
/// <summary>
/// 水印内容
/// </summary>
public const string SysWebWatermark = "sys_web_watermark";
/// <summary>
/// 版权说明
/// </summary>
public const string SysWebCopyright = "sys_web_copyright";
/// <summary>
/// ICP备案号
/// </summary>
public const string SysWebIcp = "sys_web_icp";
/// <summary>
/// ICP地址
/// </summary>
public const string SysWebIcpUrl = "sys_web_icpUrl";
}

View File

@ -40,6 +40,7 @@ public abstract class EntityBase : EntityBaseId, IDeletedFilter
/// 创建者Id /// 创建者Id
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "创建者Id", IsOnlyIgnoreUpdate = true)] [SugarColumn(ColumnDescription = "创建者Id", IsOnlyIgnoreUpdate = true)]
[OwnerUser]
public virtual long? CreateUserId { get; set; } public virtual long? CreateUserId { get; set; }
///// <summary> ///// <summary>
@ -92,6 +93,7 @@ public abstract class EntityBaseData : EntityBase, IOrgIdFilter
/// 创建者部门Id /// 创建者部门Id
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "创建者部门Id", IsOnlyIgnoreUpdate = true)] [SugarColumn(ColumnDescription = "创建者部门Id", IsOnlyIgnoreUpdate = true)]
[OwnerOrg]
public virtual long? CreateOrgId { get; set; } public virtual long? CreateOrgId { get; set; }
/// <summary> /// <summary>

View File

@ -1,125 +1,131 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 // Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
// //
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 // 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
// //
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core; namespace Admin.NET.Core;
/// <summary> /// <summary>
/// 代码生成表 /// 代码生成表
/// </summary> /// </summary>
[SugarTable(null, "代码生成表")] [SugarTable(null, "代码生成表")]
[SysTable] [SysTable]
[SugarIndex("index_{table}_B", nameof(BusName), OrderByType.Asc)] [SugarIndex("index_{table}_B", nameof(BusName), OrderByType.Asc)]
[SugarIndex("index_{table}_T", nameof(TableName), OrderByType.Asc)] [SugarIndex("index_{table}_T", nameof(TableName), OrderByType.Asc)]
public partial class SysCodeGen : EntityBase public partial class SysCodeGen : EntityBase
{ {
/// <summary> /// <summary>
/// 作者姓名 /// 作者姓名
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "作者姓名", Length = 32)] [SugarColumn(ColumnDescription = "作者姓名", Length = 32)]
[MaxLength(32)] [MaxLength(32)]
public string? AuthorName { get; set; } public string? AuthorName { get; set; }
/// <summary> /// <summary>
/// 是否移除表前缀 /// 是否移除表前缀
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "是否移除表前缀", Length = 8)] [SugarColumn(ColumnDescription = "是否移除表前缀", Length = 8)]
[MaxLength(8)] [MaxLength(8)]
public string? TablePrefix { get; set; } public string? TablePrefix { get; set; }
/// <summary> /// <summary>
/// 生成方式 /// 生成方式
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "生成方式", Length = 32)] [SugarColumn(ColumnDescription = "生成方式", Length = 32)]
[MaxLength(32)] [MaxLength(32)]
public string? GenerateType { get; set; } public string? GenerateType { get; set; }
/// <summary> /// <summary>
/// 库定位器名 /// 库定位器名
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "库定位器名", Length = 64)] [SugarColumn(ColumnDescription = "库定位器名", Length = 64)]
[MaxLength(64)] [MaxLength(64)]
public string? ConfigId { get; set; } public string? ConfigId { get; set; }
/// <summary> /// <summary>
/// 数据库名(保留字段) /// 数据库名(保留字段)
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "数据库库名", Length = 64)] [SugarColumn(ColumnDescription = "数据库库名", Length = 64)]
[MaxLength(64)] [MaxLength(64)]
public string? DbName { get; set; } public string? DbName { get; set; }
/// <summary> /// <summary>
/// 数据库类型 /// 数据库类型
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "数据库类型", Length = 64)] [SugarColumn(ColumnDescription = "数据库类型", Length = 64)]
[MaxLength(64)] [MaxLength(64)]
public string? DbType { get; set; } public string? DbType { get; set; }
/// <summary> /// <summary>
/// 数据库链接 /// 数据库链接
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "数据库链接", Length = 256)] [SugarColumn(ColumnDescription = "数据库链接", Length = 256)]
[MaxLength(256)] [MaxLength(256)]
public string? ConnectionString { get; set; } public string? ConnectionString { get; set; }
/// <summary> /// <summary>
/// 数据库表名 /// 数据库表名
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "数据库表名", Length = 128)] [SugarColumn(ColumnDescription = "数据库表名", Length = 128)]
[MaxLength(128)] [MaxLength(128)]
public string? TableName { get; set; } public string? TableName { get; set; }
/// <summary> /// <summary>
/// 命名空间 /// 命名空间
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "命名空间", Length = 128)] [SugarColumn(ColumnDescription = "命名空间", Length = 128)]
[MaxLength(128)] [MaxLength(128)]
public string? NameSpace { get; set; } public string? NameSpace { get; set; }
/// <summary> /// <summary>
/// 业务名 /// 业务名
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "业务名", Length = 128)] [SugarColumn(ColumnDescription = "业务名", Length = 128)]
[MaxLength(128)] [MaxLength(128)]
public string? BusName { get; set; } public string? BusName { get; set; }
/// <summary> /// <summary>
/// 是否生成菜单 /// 是否生成菜单
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "是否生成菜单")] [SugarColumn(ColumnDescription = "是否生成菜单")]
public bool GenerateMenu { get; set; } = true; public bool GenerateMenu { get; set; } = true;
/// <summary> /// <summary>
/// 菜单图标 /// 菜单图标
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "菜单图标", Length = 32)] [SugarColumn(ColumnDescription = "菜单图标", Length = 32)]
public string? MenuIcon { get; set; } = "ele-Menu"; public string? MenuIcon { get; set; } = "ele-Menu";
/// <summary> /// <summary>
/// 菜单编码 /// 菜单编码
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "菜单编码")] [SugarColumn(ColumnDescription = "菜单编码")]
public long? MenuPid { get; set; } public long? MenuPid { get; set; }
/// <summary> /// <summary>
/// 页面目录 /// 页面目录
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "页面目录", Length = 32)] [SugarColumn(ColumnDescription = "页面目录", Length = 32)]
public string? PagePath { get; set; } public string? PagePath { get; set; }
/// <summary> /// <summary>
/// 支持打印类型 /// 支持打印类型
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "支持打印类型", Length = 32)] [SugarColumn(ColumnDescription = "支持打印类型", Length = 32)]
[MaxLength(32)] [MaxLength(32)]
public string? PrintType { get; set; } public string? PrintType { get; set; }
/// <summary> /// <summary>
/// 打印模版名称 /// 打印模版名称
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "打印模版名称", Length = 32)] [SugarColumn(ColumnDescription = "打印模版名称", Length = 32)]
[MaxLength(32)] [MaxLength(32)]
public string? PrintName { get; set; } public string? PrintName { get; set; }
/// <summary>
/// 是否使用 Api Service
/// </summary>
[SugarColumn(ColumnDescription = "是否使用 Api Service")]
public bool IsApiService { get; set; } = false;
} }

View File

@ -63,7 +63,7 @@ public class SysWechatRefund : EntityBase
/// 退款资金来源, 可不传,默认使用未结算资金退款(仅对老资金流商户适用) /// 退款资金来源, 可不传,默认使用未结算资金退款(仅对老资金流商户适用)
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "退款资金来源", Length = 32)] [SugarColumn(ColumnDescription = "退款资金来源", Length = 32)]
public string FundsAccount { get; set; } public string? FundsAccount { get; set; }
/// <summary> /// <summary>
/// 关联的商户订单号 /// 关联的商户订单号

View File

@ -679,6 +679,24 @@ public enum ErrorCodeEnum
[ErrorCodeItemMetadata("已有相同编码或名称")] [ErrorCodeItemMetadata("已有相同编码或名称")]
R2002, R2002,
/// <summary>
/// 行政区代码只能为6、9或12位
/// </summary>
[ErrorCodeItemMetadata("行政区代码只能为6、9或12位")]
R2003,
/// <summary>
/// 父节点不能为自己的子节点
/// </summary>
[ErrorCodeItemMetadata("父节点不能为自己的子节点")]
R2004,
/// <summary>
/// 同步国家统计局数据异常,请稍后重试
/// </summary>
[ErrorCodeItemMetadata("同步国家统计局数据异常,请稍后重试")]
R2005,
/// <summary> /// <summary>
/// 默认租户状态禁止修改 /// 默认租户状态禁止修改
/// </summary> /// </summary>

View File

@ -0,0 +1,32 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 过滤条件
/// </summary>
[Description("过滤条件")]
public enum FilterLogicEnum
{
/// <summary>
/// 并且
/// </summary>
[Description("并且")]
And,
/// <summary>
/// 或者
/// </summary>
[Description("或者")]
Or,
/// <summary>
/// 异或
/// </summary>
[Description("异或")]
Xor
}

View File

@ -0,0 +1,68 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 过滤逻辑运算符
/// </summary>
[Description("过滤逻辑运算符")]
public enum FilterOperatorEnum
{
/// <summary>
/// 等于(=)
/// </summary>
[Description("等于")]
EQ,
/// <summary>
/// 不等于(!=)
/// </summary>
[Description("不等于")]
NEQ,
/// <summary>
/// 小于(<)
/// </summary>
[Description("小于")]
LT,
/// <summary>
/// 小于等于(<=)
/// </summary>
[Description("小于等于")]
LTE,
/// <summary>
/// 大于(>)
/// </summary>
[Description("大于")]
GT,
/// <summary>
/// 大于等于(>=)
/// </summary>
[Description("大于等于")]
GTE,
/// <summary>
/// 开始包含
/// </summary>
[Description("开始包含")]
StartsWith,
/// <summary>
/// 末尾包含
/// </summary>
[Description("末尾包含")]
EndsWith,
/// <summary>
/// 包含
/// </summary>
[Description("包含")]
Contains
}

View File

@ -7,26 +7,32 @@
namespace Admin.NET.Core; namespace Admin.NET.Core;
/// <summary> /// <summary>
/// 性别枚举 /// 性别枚举GB/T 2261.1-2003
/// </summary> /// </summary>
[Description("性别枚举")] [Description("性别枚举")]
public enum GenderEnum public enum GenderEnum
{ {
/// <summary> /// <summary>
/// /// 未知的性别
/// </summary> /// </summary>
[Description("男")] [Description("未知的性别")]
Unknown = 0,
/// <summary>
/// 男性
/// </summary>
[Description("男性")]
Male = 1, Male = 1,
/// <summary> /// <summary>
/// 女 /// 女
/// </summary> /// </summary>
[Description("女")] [Description("女")]
Female = 2, Female = 2,
/// <summary> /// <summary>
/// 其他 /// 未说明的性别
/// </summary> /// </summary>
[Description("其他")] [Description("未说明的性别")]
Other = 3 Unspecified = 9
} }

View File

@ -42,7 +42,8 @@ public class AppEventSubscriber : IEventSubscriber, ISingleton, IDisposable
//var mailTemp = File.ReadAllText(mailTempPath); //var mailTemp = File.ReadAllText(mailTempPath);
//var mail = await _serviceScope.ServiceProvider.GetRequiredService<IViewEngine>().RunCompileFromCachedAsync(mailTemp, ); //var mail = await _serviceScope.ServiceProvider.GetRequiredService<IViewEngine>().RunCompileFromCachedAsync(mailTemp, );
var title = "Admin.NET 系统异常"; var webTitle = await _serviceScope.ServiceProvider.GetRequiredService<SysConfigService>().GetConfigValue<string>(ConfigConst.SysWebTitle);
var title = $"{webTitle} 系统异常";
await _serviceScope.ServiceProvider.GetRequiredService<SysEmailService>().SendEmail(JSON.Serialize(context.Source.Payload), title); await _serviceScope.ServiceProvider.GetRequiredService<SysEmailService>().SendEmail(JSON.Serialize(context.Source.Payload), title);
} }

View File

@ -0,0 +1,94 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
using Microsoft.AspNetCore.Authentication;
namespace Admin.NET.Core;
public static class HttpContextExtension
{
public static async Task<AuthenticationScheme[]> GetExternalProvidersAsync(this HttpContext context)
{
ArgumentNullException.ThrowIfNull(context);
var schemes = context.RequestServices.GetRequiredService<IAuthenticationSchemeProvider>();
return (from scheme in await schemes.GetAllSchemesAsync()
where !string.IsNullOrEmpty(scheme.DisplayName)
select scheme).ToArray();
}
public static async Task<bool> IsProviderSupportedAsync(this HttpContext context, string provider)
{
ArgumentNullException.ThrowIfNull(context);
return (from scheme in await context.GetExternalProvidersAsync()
where string.Equals(scheme.Name, provider, StringComparison.OrdinalIgnoreCase)
select scheme).Any();
}
/// <summary>
/// 获取设备信息
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public static string GetClientDeviceInfo(this HttpContext context)
{
ArgumentNullException.ThrowIfNull(context);
return CommonUtil.GetClientDeviceInfo(context.Request.Headers.UserAgent);
}
/// <summary>
/// 获取浏览器信息
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public static string GetClientBrowser(this HttpContext context)
{
ArgumentNullException.ThrowIfNull(context);
string userAgent = context.Request.Headers.UserAgent;
try
{
if (userAgent != null)
{
var client = Parser.GetDefault().Parse(userAgent);
if (client.Device.IsSpider)
return "爬虫";
return $"{client.UA.Family} {client.UA.Major}.{client.UA.Minor} / {client.Device.Family}";
}
}
catch
{ }
return "未知";
}
/// <summary>
/// 获取操作系统信息
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public static string GetClientOs(this HttpContext context)
{
ArgumentNullException.ThrowIfNull(context);
string userAgent = context.Request.Headers.UserAgent;
try
{
if (userAgent != null)
{
var client = Parser.GetDefault().Parse(userAgent);
if (client.Device.IsSpider)
return "爬虫";
return $"{client.OS.Family} {client.OS.Major} {client.OS.Minor}";
}
}
catch
{ }
return "未知";
}
}

View File

@ -0,0 +1,294 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
using System.Text.Json;
namespace Admin.NET.Core;
/// <summary>
/// Sqlsugar 动态查询扩展方法
/// </summary>
public static class SqlSugarExtension
{
public static ISugarQueryable<T> SearchBy<T>(this ISugarQueryable<T> queryable, BaseFilter filter)
{
return queryable.SearchByKeyword(filter.Keyword)
.AdvancedSearch(filter.Search)
.AdvancedFilter(filter.Filter);
}
public static ISugarQueryable<T> SearchByKeyword<T>(this ISugarQueryable<T> queryable, string keyword)
{
return queryable.AdvancedSearch(new Search { Keyword = keyword });
}
public static ISugarQueryable<T> AdvancedSearch<T>(this ISugarQueryable<T> queryable, Search search)
{
if (!string.IsNullOrWhiteSpace(search?.Keyword))
{
var paramExpr = Expression.Parameter(typeof(T));
Expression right = Expression.Constant(false);
if (search.Fields?.Any() is true)
{
foreach (string field in search.Fields)
{
MemberExpression propertyExpr = GetPropertyExpression(field, paramExpr);
var left = AddSearchPropertyByKeyword<T>(propertyExpr, search.Keyword);
right = Expression.Or(left, right);
}
}
else
{
var properties = typeof(T).GetProperties()
.Where(prop => Nullable.GetUnderlyingType(prop.PropertyType) == null
&& !prop.PropertyType.IsEnum
&& Type.GetTypeCode(prop.PropertyType) != TypeCode.Object);
foreach (var property in properties)
{
var propertyExpr = Expression.Property(paramExpr, property);
var left = AddSearchPropertyByKeyword<T>(propertyExpr, search.Keyword);
right = Expression.Or(left, right);
}
}
var lambda = Expression.Lambda<Func<T, bool>>(right, paramExpr);
return queryable.Where(lambda);
}
return queryable;
}
public static ISugarQueryable<T> AdvancedFilter<T>(this ISugarQueryable<T> queryable, Filter filter)
{
if (filter is not null)
{
var parameter = Expression.Parameter(typeof(T));
Expression binaryExpresioFilter;
if (filter.Logic.HasValue)
{
if (filter.Filters is null) throw new ArgumentException("The Filters attribute is required when declaring a logic");
binaryExpresioFilter = CreateFilterExpression(filter.Logic.Value, filter.Filters, parameter);
}
else
{
var filterValid = GetValidFilter(filter);
binaryExpresioFilter = CreateFilterExpression(filterValid.Field!, filterValid.Operator.Value, filterValid.Value, parameter);
}
var lambda = Expression.Lambda<Func<T, bool>>(binaryExpresioFilter, parameter);
return queryable.Where(lambda);
}
return queryable;
}
private static Expression CombineFilter(
FilterLogicEnum filterLogic,
Expression bExpresionBase,
Expression bExpresion)
{
return filterLogic switch
{
FilterLogicEnum.And => Expression.And(bExpresionBase, bExpresion),
FilterLogicEnum.Or => Expression.Or(bExpresionBase, bExpresion),
FilterLogicEnum.Xor => Expression.ExclusiveOr(bExpresionBase, bExpresion),
_ => throw new ArgumentException("FilterLogic is not valid.", nameof(filterLogic)),
};
}
private static Filter GetValidFilter(Filter filter)
{
if (string.IsNullOrEmpty(filter.Field)) throw new ArgumentException("The field attribute is required when declaring a filter");
if (filter.Operator.IsNullOrEmpty()) throw new ArgumentException("The Operator attribute is required when declaring a filter");
return filter;
}
private static Expression CreateFilterExpression(
FilterLogicEnum filterLogic,
IEnumerable<Filter> filters,
ParameterExpression parameter)
{
Expression filterExpression = default!;
foreach (var filter in filters)
{
Expression bExpresionFilter;
if (filter.Logic.HasValue)
{
if (filter.Filters is null) throw new ArgumentException("The Filters attribute is required when declaring a logic");
bExpresionFilter = CreateFilterExpression(filter.Logic.Value, filter.Filters, parameter);
}
else
{
var filterValid = GetValidFilter(filter);
bExpresionFilter = CreateFilterExpression(filterValid.Field!, filterValid.Operator.Value, filterValid.Value, parameter);
}
filterExpression = filterExpression is null ? bExpresionFilter : CombineFilter(filterLogic, filterExpression, bExpresionFilter);
}
return filterExpression;
}
private static Expression CreateFilterExpression(
string field,
FilterOperatorEnum filterOperator,
object? value,
ParameterExpression parameter)
{
var propertyExpresion = GetPropertyExpression(field, parameter);
var valueExpresion = GeValuetExpression(field, value, propertyExpresion.Type);
return CreateFilterExpression(propertyExpresion, valueExpresion, filterOperator);
}
private static Expression CreateFilterExpression(
MemberExpression memberExpression,
ConstantExpression constantExpression,
FilterOperatorEnum filterOperator)
{
return filterOperator switch
{
FilterOperatorEnum.EQ => Expression.Equal(memberExpression, constantExpression),
FilterOperatorEnum.NEQ => Expression.NotEqual(memberExpression, constantExpression),
FilterOperatorEnum.LT => Expression.LessThan(memberExpression, constantExpression),
FilterOperatorEnum.LTE => Expression.LessThanOrEqual(memberExpression, constantExpression),
FilterOperatorEnum.GT => Expression.GreaterThan(memberExpression, constantExpression),
FilterOperatorEnum.GTE => Expression.GreaterThanOrEqual(memberExpression, constantExpression),
FilterOperatorEnum.Contains => Expression.Call(memberExpression, nameof(FilterOperatorEnum.Contains), null, constantExpression),
FilterOperatorEnum.StartsWith => Expression.Call(memberExpression, nameof(FilterOperatorEnum.StartsWith), null, constantExpression),
FilterOperatorEnum.EndsWith => Expression.Call(memberExpression, nameof(FilterOperatorEnum.EndsWith), null, constantExpression),
_ => throw new ArgumentException("Filter Operator is not valid."),
};
}
private static string GetStringFromJsonElement(object value)
{
if (value is JsonElement) return ((JsonElement)value).GetString()!;
if (value is string) return (string)value;
return value?.ToString();
}
private static ConstantExpression GeValuetExpression(
string field,
object? value,
Type propertyType)
{
if (value == null) return Expression.Constant(null, propertyType);
if (propertyType.IsEnum)
{
string? stringEnum = GetStringFromJsonElement(value);
if (!Enum.TryParse(propertyType, stringEnum, true, out object? valueparsed)) throw new ArgumentException(string.Format("Value {0} is not valid for {1}", value, field));
return Expression.Constant(valueparsed, propertyType);
}
if (propertyType == typeof(long))
{
string? stringLong = GetStringFromJsonElement(value);
if (!long.TryParse(stringLong, out long valueparsed)) throw new ArgumentException(string.Format("Value {0} is not valid for {1}", value, field));
return Expression.Constant(valueparsed, propertyType);
}
if (propertyType == typeof(Guid))
{
string? stringGuid = GetStringFromJsonElement(value);
if (!Guid.TryParse(stringGuid, out Guid valueparsed)) throw new ArgumentException(string.Format("Value {0} is not valid for {1}", value, field));
return Expression.Constant(valueparsed, propertyType);
}
if (propertyType == typeof(string))
{
string? text = GetStringFromJsonElement(value);
return Expression.Constant(text, propertyType);
}
if (propertyType == typeof(DateTime) || propertyType == typeof(DateTime?))
{
string? text = GetStringFromJsonElement(value);
return Expression.Constant(ChangeType(text, propertyType), propertyType);
}
return Expression.Constant(ChangeType(((JsonElement)value).GetRawText(), propertyType), propertyType);
}
private static dynamic? ChangeType(object value, Type conversion)
{
var t = conversion;
if (t.IsGenericType && t.GetGenericTypeDefinition().Equals(typeof(Nullable<>)))
{
if (value == null)
{
return null;
}
t = Nullable.GetUnderlyingType(t);
}
return Convert.ChangeType(value, t!);
}
private static MemberExpression GetPropertyExpression(
string propertyName,
ParameterExpression parameter)
{
Expression propertyExpression = parameter;
foreach (string member in propertyName.Split('.'))
{
propertyExpression = Expression.PropertyOrField(propertyExpression, member);
}
return (MemberExpression)propertyExpression;
}
private static Expression AddSearchPropertyByKeyword<T>(
Expression propertyExpr,
string keyword,
FilterOperatorEnum operatorSearch = FilterOperatorEnum.Contains)
{
if (propertyExpr is not MemberExpression memberExpr || memberExpr.Member is not PropertyInfo property)
{
throw new ArgumentException("propertyExpr must be a property expression.", nameof(propertyExpr));
}
ConstantExpression constant = Expression.Constant(keyword);
MethodInfo method = operatorSearch switch
{
FilterOperatorEnum.Contains => typeof(string).GetMethod(nameof(FilterOperatorEnum.Contains), new Type[] { typeof(string) }),
FilterOperatorEnum.StartsWith => typeof(string).GetMethod(nameof(FilterOperatorEnum.StartsWith), new Type[] { typeof(string) }),
FilterOperatorEnum.EndsWith => typeof(string).GetMethod(nameof(FilterOperatorEnum.EndsWith), new Type[] { typeof(string) }),
_ => throw new ArgumentException("Filter Operator is not valid."),
};
Expression selectorExpr =
property.PropertyType == typeof(string)
? propertyExpr
: Expression.Condition(
Expression.Equal(Expression.Convert(propertyExpr, typeof(object)), Expression.Constant(null, typeof(object))),
Expression.Constant(null, typeof(string)),
Expression.Call(propertyExpr, "ToString", null, null));
return Expression.Call(selectorExpr, method, constant);
}
}

View File

@ -0,0 +1,55 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
public static class SqlSugarFilterExtension
{
/// <summary>
/// 根据指定Attribute获取属性
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="type"></param>
/// <returns></returns>
private static List<string> GetPropertyNames<T>(this Type type)
where T : Attribute
{
var allProperties = type.GetProperties();
var properties = allProperties.Where(x => x.CustomAttributes.Any(a => a.AttributeType == typeof(T)));
return properties.Select(x => x.Name).ToList();
}
/// <summary>
/// 获取过滤表达式
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="type"></param>
/// <param name="owners"></param>
/// <returns></returns>
public static LambdaExpression GetConditionExpression<T>(this Type type, List<long> owners)
where T : Attribute
{
var fieldNames = type.GetPropertyNames<T>();
ParameterExpression parameter = Expression.Parameter(type, "c");
Expression right = Expression.Constant(false);
fieldNames.ForEach(filedName =>
{
owners.ForEach(owner =>
{
Expression left = Expression.Equal(
Expression.Property(parameter, type.GetProperty(filedName)),
Expression.Constant(owner)
);
right = Expression.Or(left, right);
});
});
var finalExpression = Expression.Lambda(right, new ParameterExpression[] { parameter });
return finalExpression;
}
}

View File

@ -17,6 +17,7 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
{ {
private const string GROUP_ONLINE = "GROUP_ONLINE_"; // 租户分组前缀 private const string GROUP_ONLINE = "GROUP_ONLINE_"; // 租户分组前缀
private readonly UserManager _userManager;
private readonly SqlSugarRepository<SysOnlineUser> _sysOnlineUerRep; private readonly SqlSugarRepository<SysOnlineUser> _sysOnlineUerRep;
private readonly SysMessageService _sysMessageService; private readonly SysMessageService _sysMessageService;
private readonly IHubContext<OnlineUserHub, IOnlineUserHub> _onlineUserHubContext; private readonly IHubContext<OnlineUserHub, IOnlineUserHub> _onlineUserHubContext;
@ -27,13 +28,15 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
SysMessageService sysMessageService, SysMessageService sysMessageService,
IHubContext<OnlineUserHub, IOnlineUserHub> onlineUserHubContext, IHubContext<OnlineUserHub, IOnlineUserHub> onlineUserHubContext,
SysCacheService sysCacheService, SysCacheService sysCacheService,
SysConfigService sysConfigService) SysConfigService sysConfigService,
UserManager userManager)
{ {
_sysOnlineUerRep = sysOnlineUerRep; _sysOnlineUerRep = sysOnlineUerRep;
_sysMessageService = sysMessageService; _sysMessageService = sysMessageService;
_onlineUserHubContext = onlineUserHubContext; _onlineUserHubContext = onlineUserHubContext;
_sysCacheService = sysCacheService; _sysCacheService = sysCacheService;
_sysConfigService = sysConfigService; _sysConfigService = sysConfigService;
_userManager = userManager;
} }
/// <summary> /// <summary>
@ -43,23 +46,17 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
public override async Task OnConnectedAsync() public override async Task OnConnectedAsync()
{ {
var httpContext = Context.GetHttpContext(); var httpContext = Context.GetHttpContext();
var token = httpContext.Request.Query["access_token"];
var claims = JWTEncryption.ReadJwtToken(token)?.Claims;
var client = Parser.GetDefault().Parse(httpContext.Request.Headers["User-Agent"]);
var userId = claims?.FirstOrDefault(u => u.Type == ClaimConst.UserId)?.Value;
var tenantId = claims?.FirstOrDefault(u => u.Type == ClaimConst.TenantId)?.Value;
var user = new SysOnlineUser var user = new SysOnlineUser
{ {
ConnectionId = Context.ConnectionId, ConnectionId = Context.ConnectionId,
UserId = string.IsNullOrWhiteSpace(userId) ? 0 : long.Parse(userId), UserId = _userManager.UserId,
UserName = claims?.FirstOrDefault(u => u.Type == ClaimConst.Account)?.Value, UserName = _userManager.Account,
RealName = claims?.FirstOrDefault(u => u.Type == ClaimConst.RealName)?.Value, RealName = _userManager.RealName,
Time = DateTime.Now, Time = DateTime.Now,
Ip = httpContext.Connection.RemoteIpAddress.MapToIPv4().ToString(), Ip = httpContext.GetRemoteIpAddressToIPv4(true),
Browser = client.UA.Family + client.UA.Major, Browser = httpContext.GetClientBrowser(),
Os = client.OS.Family + client.OS.Major, Os = httpContext.GetClientOs(),
TenantId = string.IsNullOrWhiteSpace(tenantId) ? 0 : Convert.ToInt64(tenantId), TenantId = _userManager.TenantId,
}; };
await _sysOnlineUerRep.InsertAsync(user); await _sysOnlineUerRep.InsertAsync(user);
@ -70,7 +67,7 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
} }
else else
{ {
var device = (client.UA.Family + client.UA.Major + client.OS.Family + client.OS.Major).Trim(); var device = httpContext.GetClientDeviceInfo().Trim();
_sysCacheService.Set(CacheConst.KeyUserOnline + user.UserId + device, user); _sysCacheService.Set(CacheConst.KeyUserOnline + user.UserId + device, user);
} }
@ -98,7 +95,6 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
if (string.IsNullOrEmpty(Context.ConnectionId)) return; if (string.IsNullOrEmpty(Context.ConnectionId)) return;
var httpContext = Context.GetHttpContext(); var httpContext = Context.GetHttpContext();
var client = Parser.GetDefault().Parse(httpContext.Request.Headers["User-Agent"]);
var user = await _sysOnlineUerRep.AsQueryable().Filter("", true).FirstAsync(u => u.ConnectionId == Context.ConnectionId); var user = await _sysOnlineUerRep.AsQueryable().Filter("", true).FirstAsync(u => u.ConnectionId == Context.ConnectionId);
if (user == null) return; if (user == null) return;
@ -112,7 +108,7 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
} }
else else
{ {
var device = (client.UA.Family + client.UA.Major + client.OS.Family + client.OS.Major).Trim(); var device = httpContext.GetClientDeviceInfo().Trim();
_sysCacheService.Remove(CacheConst.KeyUserOnline + user.UserId + device); _sysCacheService.Remove(CacheConst.KeyUserOnline + user.UserId + device);
} }

View File

@ -70,7 +70,7 @@ public class EnumToDictJob : IJob
}); });
try try
{ {
db.Ado.BeginTran(); db.BeginTran();
if (uSysDictType.Count > 0) if (uSysDictType.Count > 0)
await db.Updateable(uSysDictType).ExecuteCommandAsync(stoppingToken); await db.Updateable(uSysDictType).ExecuteCommandAsync(stoppingToken);
@ -78,11 +78,11 @@ public class EnumToDictJob : IJob
if (uSysDictData.Count > 0) if (uSysDictData.Count > 0)
await db.Updateable(uSysDictData).ExecuteCommandAsync(stoppingToken); await db.Updateable(uSysDictData).ExecuteCommandAsync(stoppingToken);
db.Ado.CommitTran(); db.CommitTran();
} }
catch (Exception error) catch (Exception error)
{ {
db.Ado.RollbackTran(); db.RollbackTran();
Log.Error($"{context.Trigger.Description}更新枚举转换字典入库错误:" + _jsonSerializer.Serialize(error)); Log.Error($"{context.Trigger.Description}更新枚举转换字典入库错误:" + _jsonSerializer.Serialize(error));
throw new Exception($"{context.Trigger.Description}更新枚举转换字典入库错误"); throw new Exception($"{context.Trigger.Description}更新枚举转换字典入库错误");
} }
@ -123,7 +123,7 @@ public class EnumToDictJob : IJob
}); });
try try
{ {
db.Ado.BeginTran(); db.BeginTran();
if (iDictType.Count > 0) if (iDictType.Count > 0)
await db.Insertable(iDictType).ExecuteCommandAsync(stoppingToken); await db.Insertable(iDictType).ExecuteCommandAsync(stoppingToken);
@ -131,11 +131,11 @@ public class EnumToDictJob : IJob
if (iDictData.Count > 0) if (iDictData.Count > 0)
await db.Insertable(iDictData).ExecuteCommandAsync(stoppingToken); await db.Insertable(iDictData).ExecuteCommandAsync(stoppingToken);
db.Ado.CommitTran(); db.CommitTran();
} }
catch (Exception error) catch (Exception error)
{ {
db.Ado.RollbackTran(); db.RollbackTran();
Log.Error($"{context.Trigger.Description}新增枚举转换字典入库错误:" + _jsonSerializer.Serialize(error)); Log.Error($"{context.Trigger.Description}新增枚举转换字典入库错误:" + _jsonSerializer.Serialize(error));
throw new Exception($"{context.Trigger.Description}新增枚举转换字典入库错误"); throw new Exception($"{context.Trigger.Description}新增枚举转换字典入库错误");
} }

View File

@ -36,12 +36,13 @@ public class LogJob : IJob
await logOpRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除操作日志 await logOpRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除操作日志
await logDiffRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除差异日志 await logDiffRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除差异日志
string msg = $"【{DateTime.Now}】清理系统日志成功,删除 {daysAgo} 天前的日志数据!";
var originColor = Console.ForegroundColor; var originColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Yellow; Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine($"【{DateTime.Now}】清理系统日志({daysAgo}天前)"); Console.WriteLine(msg);
Console.ForegroundColor = originColor; Console.ForegroundColor = originColor;
// 自定义日志 // 自定义日志
_logger.LogInformation($"【{DateTime.Now}】清理系统日志..."); _logger.LogInformation(msg);
} }
} }

View File

@ -31,15 +31,16 @@ public class OnlineUserJob : IJob
var rep = serviceScope.ServiceProvider.GetRequiredService<SqlSugarRepository<SysOnlineUser>>(); var rep = serviceScope.ServiceProvider.GetRequiredService<SqlSugarRepository<SysOnlineUser>>();
await rep.CopyNew().AsDeleteable().ExecuteCommandAsync(stoppingToken); await rep.CopyNew().AsDeleteable().ExecuteCommandAsync(stoppingToken);
var originColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"【{DateTime.Now}】清空在线用户列表");
Console.ForegroundColor = originColor;
// 缓存租户列表 // 缓存租户列表
await serviceScope.ServiceProvider.GetRequiredService<SysTenantService>().CacheTenant(); await serviceScope.ServiceProvider.GetRequiredService<SysTenantService>().CacheTenant();
string msg = $"【{DateTime.Now}】清理在线用户成功!服务已重启...";
var originColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(msg);
Console.ForegroundColor = originColor;
// 自定义日志 // 自定义日志
_logger.LogInformation($"【{DateTime.Now}】服务已重启..."); _logger.LogInformation(msg);
} }
} }

View File

@ -19,33 +19,34 @@ public class SysBaseApiSeedData : ISqlSugarEntitySeedData<SysBaseApi>
{ {
return new[] return new[]
{ {
new SysBaseApi { Id = 1300000000001, Route = "sysAuth/login" }, new SysBaseApi { Id = 1300000000010, Route = "sysAuth/login" },
new SysBaseApi { Id = 1300000000002, Route = "sysAuth/unLockScreen" }, new SysBaseApi { Id = 1300000000020, Route = "sysAuth/unLockScreen" },
new SysBaseApi { Id = 1300000000003, Route = "sysAuth/userInfo" }, new SysBaseApi { Id = 1300000000030, Route = "sysAuth/userInfo" },
new SysBaseApi { Id = 1300000000004, Route = "sysAuth/refreshToken" }, new SysBaseApi { Id = 1300000000040, Route = "sysAuth/refreshToken" },
new SysBaseApi { Id = 1300000000005, Route = "sysAuth/loginConfig" }, new SysBaseApi { Id = 1300000000050, Route = "sysAuth/loginConfig" },
new SysBaseApi { Id = 1300000000006, Route = "sysAuth/watermarkConfig" }, new SysBaseApi { Id = 1300000000060, Route = "sysAuth/watermarkConfig" },
new SysBaseApi { Id = 1300000000007, Route = "sysAuth/captcha" }, new SysBaseApi { Id = 1300000000070, Route = "sysAuth/captcha" },
new SysBaseApi { Id = 1300000000008, Route = "sysMenu/loginMenuTree" }, new SysBaseApi { Id = 1300000000080, Route = "sysAuth/logout" },
new SysBaseApi { Id = 1300000000009, Route = "sysOAuth/signIn" }, new SysBaseApi { Id = 1300000000090, Route = "sysMenu/loginMenuTree" },
new SysBaseApi { Id = 1300000000010, Route = "sysOAuth/signInCallback" }, new SysBaseApi { Id = 1300000000100, Route = "sysOAuth/signIn" },
new SysBaseApi { Id = 1300000000011, Route = "sysOnlineUser/page" }, new SysBaseApi { Id = 1300000000110, Route = "sysOAuth/signInCallback" },
new SysBaseApi { Id = 1300000000012, Route = "sysOrg/list" }, new SysBaseApi { Id = 1300000000120, Route = "sysOnlineUser/page" },
new SysBaseApi { Id = 1300000000013, Route = "sysPos/list" }, new SysBaseApi { Id = 1300000000130, Route = "sysOrg/list" },
new SysBaseApi { Id = 1300000000014, Route = "sysRole/page" }, new SysBaseApi { Id = 1300000000140, Route = "sysPos/list" },
new SysBaseApi { Id = 1300000000015, Route = "sysRole/list" }, new SysBaseApi { Id = 1300000000150, Route = "sysRole/page" },
new SysBaseApi { Id = 1300000000016, Route = "sysFile/uploadAvatar" }, new SysBaseApi { Id = 1300000000160, Route = "sysRole/list" },
new SysBaseApi { Id = 1300000000017, Route = "sysFile/uploadSignature" }, new SysBaseApi { Id = 1300000000170, Route = "sysFile/uploadAvatar" },
new SysBaseApi { Id = 1300000000018, Route = "sysUser/baseInfo" }, new SysBaseApi { Id = 1300000000180, Route = "sysFile/uploadSignature" },
new SysBaseApi { Id = 1300000000019, Route = "sysUser/changePwd" }, new SysBaseApi { Id = 1300000000190, Route = "sysUser/baseInfo" },
new SysBaseApi { Id = 1300000000020, Route = "sysNotice/page" }, new SysBaseApi { Id = 1300000000200, Route = "sysUser/changePwd" },
new SysBaseApi { Id = 1300000000021, Route = "sysNotice/add" }, new SysBaseApi { Id = 1300000000210, Route = "sysNotice/page" },
new SysBaseApi { Id = 1300000000022, Route = "sysNotice/update" }, new SysBaseApi { Id = 1300000000220, Route = "sysNotice/add" },
new SysBaseApi { Id = 1300000000023, Route = "sysNotice/delete" }, new SysBaseApi { Id = 1300000000230, Route = "sysNotice/update" },
new SysBaseApi { Id = 1300000000024, Route = "sysNotice/public" }, new SysBaseApi { Id = 1300000000240, Route = "sysNotice/delete" },
new SysBaseApi { Id = 1300000000025, Route = "sysNotice/setRead" }, new SysBaseApi { Id = 1300000000250, Route = "sysNotice/public" },
new SysBaseApi { Id = 1300000000026, Route = "sysNotice/pageReceived" }, new SysBaseApi { Id = 1300000000260, Route = "sysNotice/setRead" },
new SysBaseApi { Id = 1300000000027, Route = "sysNotice/unReadList" }, new SysBaseApi { Id = 1300000000270, Route = "sysNotice/pageReceived" },
new SysBaseApi { Id = 1300000000280, Route = "sysNotice/unReadList" },
}; };
} }
} }

View File

@ -32,6 +32,7 @@ public class SysConfigSeedData : ISqlSugarEntitySeedData<SysConfig>
new SysConfig{ Id=1300000000201, Name="发送异常日志邮件", Code="sys_error_mail", Value="True", SysFlag=YesNoEnum.Y, Remark="是否发送异常日志邮件", OrderNo=110, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") }, new SysConfig{ Id=1300000000201, Name="发送异常日志邮件", Code="sys_error_mail", Value="True", SysFlag=YesNoEnum.Y, Remark="是否发送异常日志邮件", OrderNo=110, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysConfig{ Id=1300000000211, Name="开启域登录验证", Code="sys_domain_login", Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启域登录验证", OrderNo=120, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") }, new SysConfig{ Id=1300000000211, Name="开启域登录验证", Code="sys_domain_login", Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启域登录验证", OrderNo=120, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysConfig{ Id=1300000000221, Name="开启数据校验日志", Code="sys_validation_log", Value="True", SysFlag=YesNoEnum.Y, Remark="是否数据校验日志", OrderNo=130, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") }, new SysConfig{ Id=1300000000221, Name="开启数据校验日志", Code="sys_validation_log", Value="True", SysFlag=YesNoEnum.Y, Remark="是否数据校验日志", OrderNo=130, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysConfig{ Id=1300000000231, Name="行政区域同步层级", Code="sys_region_sync_level", Value="3", SysFlag=YesNoEnum.Y, Remark="行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级", OrderNo=140, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysConfig{ Id=1300000000301, Name="系统主标题", Code="sys_web_title", Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="系统主标题", OrderNo=300, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") }, new SysConfig{ Id=1300000000301, Name="系统主标题", Code="sys_web_title", Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="系统主标题", OrderNo=300, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysConfig{ Id=1300000000311, Name="系统副标题", Code="sys_web_viceTitle", Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="系统副标题", OrderNo=310, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") }, new SysConfig{ Id=1300000000311, Name="系统副标题", Code="sys_web_viceTitle", Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="系统副标题", OrderNo=310, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysConfig{ Id=1300000000321, Name="系统描述", Code="sys_web_viceDesc", Value="站在巨人肩膀上的 .NET 通用权限开发框架", SysFlag=YesNoEnum.Y, Remark="系统描述", OrderNo=320, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") }, new SysConfig{ Id=1300000000321, Name="系统描述", Code="sys_web_viceDesc", Value="站在巨人肩膀上的 .NET 通用权限开发框架", SysFlag=YesNoEnum.Y, Remark="系统描述", OrderNo=320, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },

View File

@ -9,7 +9,7 @@ namespace Admin.NET.Core.Service;
/// <summary> /// <summary>
/// 系统域登录信息配置输入参数 /// 系统域登录信息配置输入参数
/// </summary> /// </summary>
public class SysLdapInput : BasePageInput public class PageSysLdapInput : BasePageInput
{ {
/// <summary> /// <summary>
/// 关键字查询 /// 关键字查询

View File

@ -275,7 +275,7 @@ public class SysAuthService : IDynamicApiController, ITransient
var roleIds = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable() var roleIds = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable()
.Where(u => u.UserId == user.Id).Select(u => u.RoleId).ToListAsync(); .Where(u => u.UserId == user.Id).Select(u => u.RoleId).ToListAsync();
// 获取水印文字(若系统水印为空则全局为空) // 获取水印文字(若系统水印为空则全局为空)
var watermarkText = await _sysConfigService.GetConfigValue<string>("sys_web_watermark"); var watermarkText = await _sysConfigService.GetConfigValue<string>(ConfigConst.SysWebWatermark);
if (!string.IsNullOrWhiteSpace(watermarkText)) if (!string.IsNullOrWhiteSpace(watermarkText))
watermarkText += $"-{user.RealName}"; // $"-{user.RealName}-{_httpContextAccessor.HttpContext.GetRemoteIp()}-{DateTime.Now}"; watermarkText += $"-{user.RealName}"; // $"-{user.RealName}-{_httpContextAccessor.HttpContext.GetRemoteIp()}-{DateTime.Now}";

View File

@ -27,7 +27,7 @@ public class SysLdapService : IDynamicApiController, ITransient
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
[DisplayName("获取系统域登录配置分页列表")] [DisplayName("获取系统域登录配置分页列表")]
public async Task<SqlSugarPagedList<SysLdap>> Page(SysLdapInput input) public async Task<SqlSugarPagedList<SysLdap>> Page(PageSysLdapInput input)
{ {
return await _sysLdapRep.AsQueryable() return await _sysLdapRep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u => u.Host.Contains(input.SearchKey.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u => u.Host.Contains(input.SearchKey.Trim()))

View File

@ -62,6 +62,17 @@ public class SysCacheService : IDynamicApiController, ISingleton
return _cacheProvider.Cache.Set($"{_cacheOptions.Prefix}{key}", value, expire); return _cacheProvider.Cache.Set($"{_cacheOptions.Prefix}{key}", value, expire);
} }
/// <summary>
/// 获取缓存的剩余生存时间
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
[NonAction]
public TimeSpan GetExpire(string key)
{
return _cacheProvider.Cache.GetExpire(key);
}
/// <summary> /// <summary>
/// 获取缓存 /// 获取缓存
/// </summary> /// </summary>
@ -133,6 +144,10 @@ public class SysCacheService : IDynamicApiController, ISingleton
[DisplayName("获取缓存值")] [DisplayName("获取缓存值")]
public object GetValue(string key) public object GetValue(string key)
{ {
// 若Key经过URL编码则进行解码
if (Regex.IsMatch(key, @"%[0-9a-fA-F]{2}"))
key = HttpUtility.UrlDecode(key);
return _cacheProvider.Cache == Cache.Default return _cacheProvider.Cache == Cache.Default
? _cacheProvider.Cache.Get<object>($"{_cacheOptions.Prefix}{key}") ? _cacheProvider.Cache.Get<object>($"{_cacheOptions.Prefix}{key}")
: _cacheProvider.Cache.Get<string>($"{_cacheOptions.Prefix}{key}"); : _cacheProvider.Cache.Get<string>($"{_cacheOptions.Prefix}{key}");

View File

@ -1,100 +1,102 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 // Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
// //
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 // 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
// //
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core.Service; namespace Admin.NET.Core.Service;
public class CustomViewEngine : ViewEngineModel public class CustomViewEngine : ViewEngineModel
{ {
private readonly ISqlSugarClient _db; private readonly ISqlSugarClient _db;
public CustomViewEngine() public CustomViewEngine()
{ {
} }
public CustomViewEngine(ISqlSugarClient db) public CustomViewEngine(ISqlSugarClient db)
{ {
_db = db; _db = db;
} }
/// <summary> /// <summary>
/// 库定位器 /// 库定位器
/// </summary> /// </summary>
public string ConfigId { get; set; } = SqlSugarConst.MainConfigId; public string ConfigId { get; set; } = SqlSugarConst.MainConfigId;
public string AuthorName { get; set; } public string AuthorName { get; set; }
public string BusName { get; set; } public string BusName { get; set; }
public string NameSpace { get; set; } public string NameSpace { get; set; }
public string ClassName { get; set; } public string ClassName { get; set; }
public string ProjectLastName { get; set; } public string ProjectLastName { get; set; }
public string LowerClassName public string LowerClassName
{ {
get get
{ {
return ClassName[..1].ToLower() + ClassName[1..]; // 首字母小写 return ClassName[..1].ToLower() + ClassName[1..]; // 首字母小写
} }
} }
public string PagePath { get; set; } = "main"; public string PagePath { get; set; } = "main";
public bool IsJoinTable { get; set; } public bool IsJoinTable { get; set; }
public bool IsUpload { get; set; } public bool IsUpload { get; set; }
public string PrintType { get; set; } public string PrintType { get; set; }
public string PrintName { get; set; } public string PrintName { get; set; }
public List<CodeGenConfig> QueryWhetherList { get; set; } public bool IsApiService { get; set; }
public List<CodeGenConfig> TableField { get; set; } public List<CodeGenConfig> QueryWhetherList { get; set; }
private List<ColumnOuput> ColumnList { get; set; } public List<CodeGenConfig> TableField { get; set; }
public string GetColumnNetType(object tbName, object colName) private List<ColumnOuput> ColumnList { get; set; }
{
if (tbName == null || colName == null) return null; public string GetColumnNetType(object tbName, object colName)
{
var config = App.GetOptions<DbConnectionOptions>().ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == ConfigId); if (tbName == null || colName == null) return null;
ColumnList = GetColumnListByTableName(tbName.ToString());
var col = ColumnList.Where(c => (config.DbSettings.EnableUnderLine var config = App.GetOptions<DbConnectionOptions>().ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == ConfigId);
? CodeGenUtil.CamelColumnName(c.ColumnName, Array.Empty<string>()) ColumnList = GetColumnListByTableName(tbName.ToString());
: c.ColumnName) == colName.ToString()).FirstOrDefault(); var col = ColumnList.Where(c => (config.DbSettings.EnableUnderLine
return col.NetType; ? CodeGenUtil.CamelColumnName(c.ColumnName, Array.Empty<string>())
} : c.ColumnName) == colName.ToString()).FirstOrDefault();
return col.NetType;
public List<ColumnOuput> GetColumnListByTableName(string tableName) }
{
// 多库代码生成切换库 public List<ColumnOuput> GetColumnListByTableName(string tableName)
var provider = _db.AsTenant().GetConnectionScope(ConfigId != SqlSugarConst.MainConfigId ? ConfigId : SqlSugarConst.MainConfigId); {
// 多库代码生成切换库
// 获取实体类型属性 var provider = _db.AsTenant().GetConnectionScope(ConfigId != SqlSugarConst.MainConfigId ? ConfigId : SqlSugarConst.MainConfigId);
var entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName);
// 获取实体类型属性
// 因为ConfigId的表通常也会用到主库的表来做连接所以这里如果在ConfigId中找不到实体也尝试一下在主库中查找 var entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName);
if (ConfigId == SqlSugarConst.MainConfigId && entityType == null) return null;
if (ConfigId != SqlSugarConst.MainConfigId) // 因为ConfigId的表通常也会用到主库的表来做连接所以这里如果在ConfigId中找不到实体也尝试一下在主库中查找
{ if (ConfigId == SqlSugarConst.MainConfigId && entityType == null) return null;
provider = _db.AsTenant().GetConnectionScope(SqlSugarConst.MainConfigId); if (ConfigId != SqlSugarConst.MainConfigId)
entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName); {
if (entityType == null) return null; provider = _db.AsTenant().GetConnectionScope(SqlSugarConst.MainConfigId);
} entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName);
if (entityType == null) return null;
// 按原始类型的顺序获取所有实体类型属性不包含导航属性会返回null }
return provider.DbMaintenance.GetColumnInfosByTableName(entityType.Name).Select(u => new ColumnOuput
{ // 按原始类型的顺序获取所有实体类型属性不包含导航属性会返回null
ColumnName = u.DbColumnName, return provider.DbMaintenance.GetColumnInfosByTableName(entityType.Name).Select(u => new ColumnOuput
ColumnKey = u.IsPrimarykey.ToString(), {
DataType = u.DataType.ToString(), ColumnName = u.DbColumnName,
NetType = CodeGenUtil.ConvertDataType(u, provider.CurrentConnectionConfig.DbType), ColumnKey = u.IsPrimarykey.ToString(),
ColumnComment = u.ColumnDescription DataType = u.DataType.ToString(),
}).ToList(); NetType = CodeGenUtil.ConvertDataType(u, provider.CurrentConnectionConfig.DbType),
} ColumnComment = u.ColumnDescription
}).ToList();
}
} }

View File

@ -1,83 +1,88 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 // Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
// //
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 // 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
// //
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core.Service; namespace Admin.NET.Core.Service;
/// <summary> /// <summary>
/// 代码生成参数类 /// 代码生成参数类
/// </summary> /// </summary>
public class CodeGenOutput public class CodeGenOutput
{ {
/// <summary> /// <summary>
/// 代码生成器Id /// 代码生成器Id
/// </summary> /// </summary>
public long Id { get; set; } public long Id { get; set; }
/// <summary> /// <summary>
/// 作者姓名 /// 作者姓名
/// </summary> /// </summary>
public string AuthorName { get; set; } public string AuthorName { get; set; }
/// <summary> /// <summary>
/// 类名 /// 类名
/// </summary> /// </summary>
public string ClassName { get; set; } public string ClassName { get; set; }
/// <summary> /// <summary>
/// 是否移除表前缀 /// 是否移除表前缀
/// </summary> /// </summary>
public string TablePrefix { get; set; } public string TablePrefix { get; set; }
/// <summary> /// <summary>
/// 生成方式 /// 生成方式
/// </summary> /// </summary>
public string GenerateType { get; set; } public string GenerateType { get; set; }
/// <summary> /// <summary>
/// 数据库表名 /// 数据库表名
/// </summary> /// </summary>
public string TableName { get; set; } public string TableName { get; set; }
/// <summary> /// <summary>
/// 包名 /// 包名
/// </summary> /// </summary>
public string PackageName { get; set; } public string PackageName { get; set; }
/// <summary> /// <summary>
/// 业务名(业务代码包名称) /// 业务名(业务代码包名称)
/// </summary> /// </summary>
public string BusName { get; set; } public string BusName { get; set; }
/// <summary> /// <summary>
/// 功能名(数据库表名称) /// 功能名(数据库表名称)
/// </summary> /// </summary>
public string TableComment { get; set; } public string TableComment { get; set; }
/// <summary> /// <summary>
/// 菜单应用分类(应用编码) /// 菜单应用分类(应用编码)
/// </summary> /// </summary>
public string MenuApplication { get; set; } public string MenuApplication { get; set; }
/// <summary> /// <summary>
/// 是否生成菜单 /// 是否生成菜单
/// </summary> /// </summary>
public bool GenerateMenu { get; set; } public bool GenerateMenu { get; set; }
/// <summary> /// <summary>
/// 菜单父级 /// 菜单父级
/// </summary> /// </summary>
public long? MenuPid { get; set; } public long? MenuPid { get; set; }
/// <summary> /// <summary>
/// 支持打印类型 /// 支持打印类型
/// </summary> /// </summary>
public string PrintType { get; set; } public string PrintType { get; set; }
/// <summary> /// <summary>
/// 打印模版名称 /// 打印模版名称
/// </summary> /// </summary>
public string PrintName { get; set; } public string PrintName { get; set; }
/// <summary>
/// 是否使用 Api Service
/// </summary>
public bool IsApiService { get; set; }
} }

View File

@ -9,7 +9,7 @@ namespace Admin.NET.Core.Service;
/// <summary> /// <summary>
/// 代码生成参数类 /// 代码生成参数类
/// </summary> /// </summary>
public class CodeGenInput : BasePageInput public class PageCodeGenInput : BasePageInput
{ {
/// <summary> /// <summary>
/// 作者姓名 /// 作者姓名
@ -100,9 +100,14 @@ public class CodeGenInput : BasePageInput
/// 打印模版名称 /// 打印模版名称
/// </summary> /// </summary>
public virtual string PrintName { get; set; } public virtual string PrintName { get; set; }
/// <summary>
/// 是否使用 Api Service
/// </summary>
public virtual bool IsApiService { get; set; }
} }
public class AddCodeGenInput : CodeGenInput public class AddCodeGenInput : PageCodeGenInput
{ {
/// <summary> /// <summary>
/// 数据库表名 /// 数据库表名
@ -157,6 +162,11 @@ public class AddCodeGenInput : CodeGenInput
/// </summary> /// </summary>
[Required(ErrorMessage = "是否生成菜单不能为空")] [Required(ErrorMessage = "是否生成菜单不能为空")]
public override bool GenerateMenu { get; set; } public override bool GenerateMenu { get; set; }
/// <summary>
/// 是否使用 Api Service
/// </summary>
public override bool IsApiService { get; set; }
} }
public class DeleteCodeGenInput public class DeleteCodeGenInput
@ -168,7 +178,7 @@ public class DeleteCodeGenInput
public long Id { get; set; } public long Id { get; set; }
} }
public class UpdateCodeGenInput : CodeGenInput public class UpdateCodeGenInput : PageCodeGenInput
{ {
/// <summary> /// <summary>
/// 代码生成器Id /// 代码生成器Id

File diff suppressed because it is too large Load Diff

View File

@ -121,4 +121,23 @@ public class SysCommonService : IDynamicApiController, ITransient
} }
return apiList; return apiList;
} }
/// <summary>
/// 下载标记错误的临时 Excel全局
/// </summary>
/// <returns></returns>
[DisplayName("下载标记错误的临时 Excel")]
public async Task<IActionResult> DownloadErrorExcelTemp([FromQuery] string fileName = null)
{
var userId = App.User?.FindFirst(ClaimConst.UserId)?.Value;
var resultStream = App.GetRequiredService<SysCacheService>().Get<MemoryStream>(CacheConst.KeyExcelTemp + userId);
if (resultStream == null)
throw Oops.Oh("错误标记文件已过期。");
return await Task.FromResult(new FileStreamResult(resultStream, "application/octet-stream")
{
FileDownloadName = $"{(string.IsNullOrEmpty(fileName) ? "_" + DateTime.Now.ToString("yyyyMMddhhmmss") : fileName)}.xlsx"
});
}
} }

View File

@ -16,6 +16,11 @@ public class InfoSaveInput
/// </summary> /// </summary>
public string SysLogoBase64 { get; set; } public string SysLogoBase64 { get; set; }
/// <summary>
/// 系统图标文件名
/// </summary>
public string SysLogoFileName { get; set; }
/// <summary> /// <summary>
/// 系统主标题 /// 系统主标题
/// </summary> /// </summary>

View File

@ -31,7 +31,7 @@ public class SysConfigService : IDynamicApiController, ITransient
public async Task<SqlSugarPagedList<SysConfig>> Page(PageConfigInput input) public async Task<SqlSugarPagedList<SysConfig>> Page(PageConfigInput input)
{ {
return await _sysConfigRep.AsQueryable() return await _sysConfigRep.AsQueryable()
.Where(u => u.GroupCode != "WebConfig") // 不显示 WebConfig 分组 .Where(u => u.GroupCode != ConfigConst.SysWebConfigGroup) // 不显示 WebConfig 分组
.WhereIF(!string.IsNullOrWhiteSpace(input.Name?.Trim()), u => u.Name.Contains(input.Name)) .WhereIF(!string.IsNullOrWhiteSpace(input.Name?.Trim()), u => u.Name.Contains(input.Name))
.WhereIF(!string.IsNullOrWhiteSpace(input.Code?.Trim()), u => u.Code.Contains(input.Code)) .WhereIF(!string.IsNullOrWhiteSpace(input.Code?.Trim()), u => u.Code.Contains(input.Code))
.WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode)) .WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode))
@ -183,7 +183,7 @@ public class SysConfigService : IDynamicApiController, ITransient
public async Task<List<string>> GetGroupList() public async Task<List<string>> GetGroupList()
{ {
return await _sysConfigRep.AsQueryable() return await _sysConfigRep.AsQueryable()
.Where(u => u.GroupCode != "WebConfig") // 不显示 WebConfig 分组 .Where(u => u.GroupCode != ConfigConst.SysWebConfigGroup) // 不显示 WebConfig 分组
.GroupBy(u => u.GroupCode) .GroupBy(u => u.GroupCode)
.Select(u => u.GroupCode).ToListAsync(); .Select(u => u.GroupCode).ToListAsync();
} }
@ -237,14 +237,14 @@ public class SysConfigService : IDynamicApiController, ITransient
[DisplayName("获取系统信息")] [DisplayName("获取系统信息")]
public async Task<dynamic> GetSysInfo() public async Task<dynamic> GetSysInfo()
{ {
var sysLogo = await GetConfigValue<string>("sys_web_logo"); var sysLogo = await GetConfigValue<string>(ConfigConst.SysWebLogo);
var sysTitle = await GetConfigValue<string>("sys_web_title"); var sysTitle = await GetConfigValue<string>(ConfigConst.SysWebTitle);
var sysViceTitle = await GetConfigValue<string>("sys_web_viceTitle"); var sysViceTitle = await GetConfigValue<string>(ConfigConst.SysWebViceTitle);
var sysViceDesc = await GetConfigValue<string>("sys_web_viceDesc"); var sysViceDesc = await GetConfigValue<string>(ConfigConst.SysWebViceDesc);
var sysWatermark = await GetConfigValue<string>("sys_web_watermark"); var sysWatermark = await GetConfigValue<string>(ConfigConst.SysWebWatermark);
var sysCopyright = await GetConfigValue<string>("sys_web_copyright"); var sysCopyright = await GetConfigValue<string>(ConfigConst.SysWebCopyright);
var sysIcp = await GetConfigValue<string>("sys_web_icp"); var sysIcp = await GetConfigValue<string>(ConfigConst.SysWebIcp);
var sysIcpUrl = await GetConfigValue<string>("sys_web_icpUrl"); var sysIcpUrl = await GetConfigValue<string>(ConfigConst.SysWebIcpUrl);
return new return new
{ {
@ -263,6 +263,7 @@ public class SysConfigService : IDynamicApiController, ITransient
/// 保存系统信息 🔖 /// 保存系统信息 🔖
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[UnitOfWork]
[DisplayName("保存系统信息")] [DisplayName("保存系统信息")]
public async Task SaveSysInfo(InfoSaveInput input) public async Task SaveSysInfo(InfoSaveInput input)
{ {
@ -270,17 +271,18 @@ public class SysConfigService : IDynamicApiController, ITransient
if (!string.IsNullOrEmpty(input.SysLogoBase64)) if (!string.IsNullOrEmpty(input.SysLogoBase64))
{ {
// 旧图标文件相对路径 // 旧图标文件相对路径
var oldSysLogoRelativeFilePath = await GetConfigValue<string>("sys_web_logo") ?? ""; var oldSysLogoRelativeFilePath = await GetConfigValue<string>(ConfigConst.SysWebLogo) ?? "";
var oldSysLogoAbsoluteFilePath = Path.Combine(App.WebHostEnvironment.WebRootPath, oldSysLogoRelativeFilePath.TrimStart('/')); var oldSysLogoAbsoluteFilePath = Path.Combine(App.WebHostEnvironment.WebRootPath, oldSysLogoRelativeFilePath.TrimStart('/'));
var groups = Regex.Match(input.SysLogoBase64, @"data:image/(?<type>.+?);base64,(?<data>.+)").Groups; var groups = Regex.Match(input.SysLogoBase64, @"data:image/(?<type>.+?);base64,(?<data>.+)").Groups;
var type = groups["type"].Value; //var type = groups["type"].Value;
var base64Data = groups["data"].Value; var base64Data = groups["data"].Value;
var binData = Convert.FromBase64String(base64Data); var binData = Convert.FromBase64String(base64Data);
// 根据文件名取扩展名
var ext = string.IsNullOrWhiteSpace(input.SysLogoFileName) ? ".png" : Path.GetExtension(input.SysLogoFileName);
// 本地图标保存路径 // 本地图标保存路径
var path = "Upload"; var path = "Upload";
var absoluteFilePath = Path.Combine(App.WebHostEnvironment.WebRootPath, path, $"logo.{type}"); var absoluteFilePath = Path.Combine(App.WebHostEnvironment.WebRootPath, path, $"logo{ext}");
// 删除已存在文件 // 删除已存在文件
if (File.Exists(oldSysLogoAbsoluteFilePath)) if (File.Exists(oldSysLogoAbsoluteFilePath))
@ -295,16 +297,16 @@ public class SysConfigService : IDynamicApiController, ITransient
await File.WriteAllBytesAsync(absoluteFilePath, binData); await File.WriteAllBytesAsync(absoluteFilePath, binData);
// 保存图标配置 // 保存图标配置
var relativeUrl = $"/{path}/logo.{type}"; var relativeUrl = $"/{path}/logo{ext}";
await UpdateConfigValue("sys_web_logo", relativeUrl); await UpdateConfigValue(ConfigConst.SysWebLogo, relativeUrl);
} }
await UpdateConfigValue("sys_web_title", input.SysTitle); await UpdateConfigValue(ConfigConst.SysWebTitle, input.SysTitle);
await UpdateConfigValue("sys_web_viceTitle", input.SysViceTitle); await UpdateConfigValue(ConfigConst.SysWebViceTitle, input.SysViceTitle);
await UpdateConfigValue("sys_web_viceDesc", input.SysViceDesc); await UpdateConfigValue(ConfigConst.SysWebViceDesc, input.SysViceDesc);
await UpdateConfigValue("sys_web_watermark", input.SysWatermark); await UpdateConfigValue(ConfigConst.SysWebWatermark, input.SysWatermark);
await UpdateConfigValue("sys_web_copyright", input.SysCopyright); await UpdateConfigValue(ConfigConst.SysWebCopyright, input.SysCopyright);
await UpdateConfigValue("sys_web_icp", input.SysIcp); await UpdateConfigValue(ConfigConst.SysWebIcp, input.SysIcp);
await UpdateConfigValue("sys_web_icpUrl", input.SysIcpUrl); await UpdateConfigValue(ConfigConst.SysWebIcpUrl, input.SysIcpUrl);
} }
} }

View File

@ -11,6 +11,7 @@ public class DictDataInput : BaseIdInput
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>
[Dict("StatusEnum")]
public StatusEnum Status { get; set; } public StatusEnum Status { get; set; }
} }

View File

@ -11,6 +11,7 @@ public class DictTypeInput : BaseIdInput
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>
[Dict("StatusEnum")]
public StatusEnum Status { get; set; } public StatusEnum Status { get; set; }
} }

View File

@ -1,4 +1,4 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 // Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
// //
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 // 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
// //
@ -13,8 +13,8 @@ namespace Admin.NET.Core.Service;
[AllowAnonymous] [AllowAnonymous]
public class SysDictDataService : IDynamicApiController, ITransient public class SysDictDataService : IDynamicApiController, ITransient
{ {
private readonly SysCacheService _sysCacheService;
private readonly SqlSugarRepository<SysDictData> _sysDictDataRep; private readonly SqlSugarRepository<SysDictData> _sysDictDataRep;
private readonly SysCacheService _sysCacheService;
public SysDictDataService(SqlSugarRepository<SysDictData> sysDictDataRep, public SysDictDataService(SqlSugarRepository<SysDictData> sysDictDataRep,
SysCacheService sysCacheService) SysCacheService sysCacheService)
@ -60,8 +60,10 @@ public class SysDictDataService : IDynamicApiController, ITransient
public async Task AddDictData(AddDictDataInput input) public async Task AddDictData(AddDictDataInput input)
{ {
var isExist = await _sysDictDataRep.IsAnyAsync(u => u.Code == input.Code && u.DictTypeId == input.DictTypeId); var isExist = await _sysDictDataRep.IsAnyAsync(u => u.Code == input.Code && u.DictTypeId == input.DictTypeId);
if (isExist) if (isExist) throw Oops.Oh(ErrorCodeEnum.D3003);
throw Oops.Oh(ErrorCodeEnum.D3003);
var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == input.DictTypeId).Select(u => u.DictType.Code).FirstAsync();
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}");
await _sysDictDataRep.InsertAsync(input.Adapt<SysDictData>()); await _sysDictDataRep.InsertAsync(input.Adapt<SysDictData>());
} }
@ -98,9 +100,7 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("删除字典值")] [DisplayName("删除字典值")]
public async Task DeleteDictData(DeleteDictDataInput input) public async Task DeleteDictData(DeleteDictDataInput input)
{ {
var dictData = await _sysDictDataRep.GetFirstAsync(u => u.Id == input.Id); var dictData = await _sysDictDataRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
if (dictData == null)
throw Oops.Oh(ErrorCodeEnum.D3004);
var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == dictData.Id).Select(u => u.DictType.Code).FirstAsync(); var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == dictData.Id).Select(u => u.DictType.Code).FirstAsync();
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}"); _sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}");
@ -128,18 +128,13 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("修改字典值状态")] [DisplayName("修改字典值状态")]
public async Task SetStatus(DictDataInput input) public async Task SetStatus(DictDataInput input)
{ {
var dictData = await _sysDictDataRep.GetFirstAsync(u => u.Id == input.Id); var dictData = await _sysDictDataRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
if (dictData == null)
throw Oops.Oh(ErrorCodeEnum.D3004);
if (!Enum.IsDefined(typeof(StatusEnum), input.Status))
throw Oops.Oh(ErrorCodeEnum.D3005);
var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == dictData.Id).Select(u => u.DictType.Code).FirstAsync(); var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == dictData.Id).Select(u => u.DictType.Code).FirstAsync();
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}"); _sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}");
dictData.Status = input.Status; dictData.Status = input.Status;
await _sysDictDataRep.UpdateAsync(dictData); await _sysDictDataRep.AsUpdateable(dictData).UpdateColumns(u => new { u.Status }, true).ExecuteCommandAsync();
} }
/// <summary> /// <summary>
@ -156,13 +151,9 @@ public class SysDictDataService : IDynamicApiController, ITransient
if (dictDataList == null) if (dictDataList == null)
{ {
dictDataList = await _sysDictDataRep.AsQueryable() dictDataList = await _sysDictDataRep.AsQueryable()
.Where(u => u.DictTypeId == dictTypeId) .Where(u => u.DictTypeId == dictTypeId).OrderBy(u => new { u.OrderNo, u.Code }).ToListAsync();
.OrderBy(u => new { u.OrderNo, u.Code })
.ToListAsync();
_sysCacheService.Set($"{CacheConst.KeyDict}{dictType.Code}", dictDataList); _sysCacheService.Set($"{CacheConst.KeyDict}{dictType.Code}", dictDataList);
} }
return dictDataList; return dictDataList;
} }

View File

@ -60,10 +60,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
[DisplayName("获取字典类型-值列表")] [DisplayName("获取字典类型-值列表")]
public async Task<List<SysDictData>> GetDataList([FromQuery] GetDataDictTypeInput input) public async Task<List<SysDictData>> GetDataList([FromQuery] GetDataDictTypeInput input)
{ {
var dictType = await _sysDictTypeRep.GetFirstAsync(u => u.Code == input.Code); var dictType = await _sysDictTypeRep.GetFirstAsync(u => u.Code == input.Code) ?? throw Oops.Oh(ErrorCodeEnum.D3000);
if (dictType == null)
throw Oops.Oh(ErrorCodeEnum.D3000);
return await _sysDictDataService.GetDictDataListByDictTypeId(dictType.Id); return await _sysDictDataService.GetDictDataListByDictTypeId(dictType.Id);
} }
@ -77,8 +74,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
public async Task AddDictType(AddDictTypeInput input) public async Task AddDictType(AddDictTypeInput input)
{ {
var isExist = await _sysDictTypeRep.IsAnyAsync(u => u.Code == input.Code); var isExist = await _sysDictTypeRep.IsAnyAsync(u => u.Code == input.Code);
if (isExist) if (isExist) throw Oops.Oh(ErrorCodeEnum.D3001);
throw Oops.Oh(ErrorCodeEnum.D3001);
await _sysDictTypeRep.InsertAsync(input.Adapt<SysDictType>()); await _sysDictTypeRep.InsertAsync(input.Adapt<SysDictType>());
} }
@ -94,12 +90,10 @@ public class SysDictTypeService : IDynamicApiController, ITransient
public async Task UpdateDictType(UpdateDictTypeInput input) public async Task UpdateDictType(UpdateDictTypeInput input)
{ {
var isExist = await _sysDictTypeRep.IsAnyAsync(u => u.Id == input.Id); var isExist = await _sysDictTypeRep.IsAnyAsync(u => u.Id == input.Id);
if (!isExist) if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
throw Oops.Oh(ErrorCodeEnum.D3000);
isExist = await _sysDictTypeRep.IsAnyAsync(u => u.Code == input.Code && u.Id != input.Id); isExist = await _sysDictTypeRep.IsAnyAsync(u => u.Code == input.Code && u.Id != input.Id);
if (isExist) if (isExist) throw Oops.Oh(ErrorCodeEnum.D3001);
throw Oops.Oh(ErrorCodeEnum.D3001);
_sysCacheService.Remove($"{CacheConst.KeyDict}{input.Code}"); _sysCacheService.Remove($"{CacheConst.KeyDict}{input.Code}");
await _sysDictTypeRep.UpdateAsync(input.Adapt<SysDictType>()); await _sysDictTypeRep.UpdateAsync(input.Adapt<SysDictType>());
@ -115,9 +109,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
[DisplayName("删除字典类型")] [DisplayName("删除字典类型")]
public async Task DeleteDictType(DeleteDictTypeInput input) public async Task DeleteDictType(DeleteDictTypeInput input)
{ {
var dictType = await _sysDictTypeRep.GetFirstAsync(u => u.Id == input.Id); var dictType = await _sysDictTypeRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3000);
if (dictType == null)
throw Oops.Oh(ErrorCodeEnum.D3000);
// 删除字典值 // 删除字典值
await _sysDictTypeRep.DeleteAsync(dictType); await _sysDictTypeRep.DeleteAsync(dictType);
@ -144,17 +136,12 @@ public class SysDictTypeService : IDynamicApiController, ITransient
[DisplayName("修改字典类型状态")] [DisplayName("修改字典类型状态")]
public async Task SetStatus(DictTypeInput input) public async Task SetStatus(DictTypeInput input)
{ {
var dictType = await _sysDictTypeRep.GetFirstAsync(u => u.Id == input.Id); var dictType = await _sysDictTypeRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3000);
if (dictType == null)
throw Oops.Oh(ErrorCodeEnum.D3000);
if (!Enum.IsDefined(typeof(StatusEnum), input.Status))
throw Oops.Oh(ErrorCodeEnum.D3005);
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictType.Code}"); _sysCacheService.Remove($"{CacheConst.KeyDict}{dictType.Code}");
dictType.Status = input.Status; dictType.Status = input.Status;
await _sysDictTypeRep.UpdateAsync(dictType); await _sysDictTypeRep.AsUpdateable(dictType).UpdateColumns(u => new { u.Status }, true).ExecuteCommandAsync();
} }
/// <summary> /// <summary>

View File

@ -49,7 +49,7 @@ public class SysEnumService : IDynamicApiController, ITransient
{ {
string description = type.Name; string description = type.Name;
var attrs = type.GetCustomAttributes(typeof(DescriptionAttribute), false); var attrs = type.GetCustomAttributes(typeof(DescriptionAttribute), false);
if (attrs.Any()) if (attrs.Length != 0)
{ {
var att = ((DescriptionAttribute[])attrs)[0]; var att = ((DescriptionAttribute[])attrs)[0];
description = att.Description; description = att.Description;

View File

@ -42,14 +42,14 @@ public class DbJobPersistence : IJobPersistence
var jobBuilder = schedulerBuilder.GetJobBuilder(); var jobBuilder = schedulerBuilder.GetJobBuilder();
// 加载数据库数据 // 加载数据库数据
var dbDetail = await db.Queryable<SysJobDetail>().FirstAsync(u => u.JobId == jobBuilder.JobId); var dbDetail = await db.Queryable<SysJobDetail>().FirstAsync(u => u.JobId == jobBuilder.JobId, stoppingToken);
if (dbDetail == null) continue; if (dbDetail == null) continue;
// 同步数据库数据 // 同步数据库数据
jobBuilder.LoadFrom(dbDetail); jobBuilder.LoadFrom(dbDetail);
// 获取作业的所有数据库的触发器 // 获取作业的所有数据库的触发器
var dbTriggers = await db.Queryable<SysJobTrigger>().Where(u => u.JobId == jobBuilder.JobId).ToListAsync(); var dbTriggers = await db.Queryable<SysJobTrigger>().Where(u => u.JobId == jobBuilder.JobId).ToListAsync(stoppingToken);
// 遍历所有作业触发器 // 遍历所有作业触发器
foreach (var (_, triggerBuilder) in schedulerBuilder.GetEnumerable()) foreach (var (_, triggerBuilder) in schedulerBuilder.GetEnumerable())
{ {
@ -73,24 +73,16 @@ public class DbJobPersistence : IJobPersistence
} }
// 获取数据库所有通过脚本创建的作业 // 获取数据库所有通过脚本创建的作业
var allDbScriptJobs = await db.Queryable<SysJobDetail>().Where(u => u.CreateType != JobCreateTypeEnum.BuiltIn).ToListAsync(); var allDbScriptJobs = await db.Queryable<SysJobDetail>().Where(u => u.CreateType != JobCreateTypeEnum.BuiltIn).ToListAsync(stoppingToken);
foreach (var dbDetail in allDbScriptJobs) foreach (var dbDetail in allDbScriptJobs)
{ {
// 动态创建作业 // 动态创建作业
Type jobType; Type jobType = dbDetail.CreateType switch
switch (dbDetail.CreateType)
{ {
case JobCreateTypeEnum.Script: JobCreateTypeEnum.Script => dynamicJobCompiler.BuildJob(dbDetail.ScriptCode),
jobType = dynamicJobCompiler.BuildJob(dbDetail.ScriptCode); JobCreateTypeEnum.Http => typeof(HttpJob),
break; _ => throw new NotSupportedException(),
};
case JobCreateTypeEnum.Http:
jobType = typeof(HttpJob);
break;
default:
throw new NotSupportedException();
}
// 动态构建的 jobType 的程序集名称为随机名称,需重新设置 // 动态构建的 jobType 的程序集名称为随机名称,需重新设置
dbDetail.AssemblyName = jobType.Assembly.FullName!.Split(',')[0]; dbDetail.AssemblyName = jobType.Assembly.FullName!.Split(',')[0];
@ -131,25 +123,23 @@ public class DbJobPersistence : IJobPersistence
/// <returns></returns> /// <returns></returns>
public async Task OnChangedAsync(PersistenceContext context) public async Task OnChangedAsync(PersistenceContext context)
{ {
using (var scope = _serviceScopeFactory.CreateScope()) using var scope = _serviceScopeFactory.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<ISqlSugarClient>().CopyNew();
var jobDetail = context.JobDetail.Adapt<SysJobDetail>();
switch (context.Behavior)
{ {
var db = scope.ServiceProvider.GetRequiredService<ISqlSugarClient>().CopyNew(); case PersistenceBehavior.Appended:
await db.Insertable(jobDetail).ExecuteCommandAsync();
break;
var jobDetail = context.JobDetail.Adapt<SysJobDetail>(); case PersistenceBehavior.Updated:
switch (context.Behavior) await db.Updateable(jobDetail).WhereColumns(u => new { u.JobId }).IgnoreColumns(u => new { u.Id, u.CreateType, u.ScriptCode }).ExecuteCommandAsync();
{ break;
case PersistenceBehavior.Appended:
await db.Insertable(jobDetail).ExecuteCommandAsync();
break;
case PersistenceBehavior.Updated: case PersistenceBehavior.Removed:
await db.Updateable(jobDetail).WhereColumns(u => new { u.JobId }).IgnoreColumns(u => new { u.Id, u.CreateType, u.ScriptCode }).ExecuteCommandAsync(); await db.Deleteable<SysJobDetail>().Where(u => u.JobId == jobDetail.JobId).ExecuteCommandAsync();
break; break;
case PersistenceBehavior.Removed:
await db.Deleteable<SysJobDetail>().Where(u => u.JobId == jobDetail.JobId).ExecuteCommandAsync();
break;
}
} }
} }
@ -160,25 +150,23 @@ public class DbJobPersistence : IJobPersistence
/// <returns></returns> /// <returns></returns>
public async Task OnTriggerChangedAsync(PersistenceTriggerContext context) public async Task OnTriggerChangedAsync(PersistenceTriggerContext context)
{ {
using (var scope = _serviceScopeFactory.CreateScope()) using var scope = _serviceScopeFactory.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<ISqlSugarClient>().CopyNew();
var jobTrigger = context.Trigger.Adapt<SysJobTrigger>();
switch (context.Behavior)
{ {
var db = scope.ServiceProvider.GetRequiredService<ISqlSugarClient>().CopyNew(); case PersistenceBehavior.Appended:
await db.Insertable(jobTrigger).ExecuteCommandAsync();
break;
var jobTrigger = context.Trigger.Adapt<SysJobTrigger>(); case PersistenceBehavior.Updated:
switch (context.Behavior) await db.Updateable(jobTrigger).WhereColumns(u => new { u.TriggerId, u.JobId }).IgnoreColumns(u => new { u.Id }).ExecuteCommandAsync();
{ break;
case PersistenceBehavior.Appended:
await db.Insertable(jobTrigger).ExecuteCommandAsync();
break;
case PersistenceBehavior.Updated: case PersistenceBehavior.Removed:
await db.Updateable(jobTrigger).WhereColumns(u => new { u.TriggerId, u.JobId }).IgnoreColumns(u => new { u.Id }).ExecuteCommandAsync(); await db.Deleteable<SysJobTrigger>().Where(u => u.TriggerId == jobTrigger.TriggerId && u.JobId == jobTrigger.JobId).ExecuteCommandAsync();
break; break;
case PersistenceBehavior.Removed:
await db.Deleteable<SysJobTrigger>().Where(u => u.TriggerId == jobTrigger.TriggerId && u.JobId == jobTrigger.JobId).ExecuteCommandAsync();
break;
}
} }
} }
@ -189,12 +177,10 @@ public class DbJobPersistence : IJobPersistence
/// <returns></returns> /// <returns></returns>
public async Task OnExecutionRecordAsync(PersistenceExecutionRecordContext context) public async Task OnExecutionRecordAsync(PersistenceExecutionRecordContext context)
{ {
using (var scope = _serviceScopeFactory.CreateScope()) using var scope = _serviceScopeFactory.CreateScope();
{ var db = scope.ServiceProvider.GetRequiredService<ISqlSugarClient>().CopyNew();
var db = scope.ServiceProvider.GetRequiredService<ISqlSugarClient>().CopyNew();
var jobTriggerRecord = context.Timeline.Adapt<SysJobTriggerRecord>(); var jobTriggerRecord = context.Timeline.Adapt<SysJobTriggerRecord>();
await db.Insertable(jobTriggerRecord).ExecuteCommandAsync(); await db.Insertable(jobTriggerRecord).ExecuteCommandAsync();
}
} }
} }

View File

@ -1,4 +1,4 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 // Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
// //
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 // 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
// //

View File

@ -33,7 +33,7 @@ public class JobMonitor : IJobMonitor
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysErrorMail) && context.Exception != null) if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysErrorMail) && context.Exception != null)
{ {
var errorInfo = $"【{context.Trigger.Description}】定时任务错误:{context.Exception}"; var errorInfo = $"【{context.Trigger.Description}】定时任务错误:{context.Exception}";
await _eventPublisher.PublishAsync(CommonConst.SendErrorMail, errorInfo); await _eventPublisher.PublishAsync(CommonConst.SendErrorMail, errorInfo, stoppingToken);
} }
} }
} }

View File

@ -59,7 +59,7 @@ public class SysMenuService : IDynamicApiController, ITransient
/// <summary> /// <summary>
/// 删除登录菜单树里面的按钮 /// 删除登录菜单树里面的按钮
/// </summary> /// </summary>
private void DeleteBtnFromMenuTree(List<SysMenu> menuList) private static void DeleteBtnFromMenuTree(List<SysMenu> menuList)
{ {
if (menuList == null) return; if (menuList == null) return;
for (var i = menuList.Count - 1; i >= 0; i--) for (var i = menuList.Count - 1; i >= 0; i--)

View File

@ -16,10 +16,12 @@ namespace Admin.NET.Core.Service;
public class SysEmailService : IDynamicApiController, ITransient public class SysEmailService : IDynamicApiController, ITransient
{ {
private readonly EmailOptions _emailOptions; private readonly EmailOptions _emailOptions;
private readonly SysConfigService _sysConfigService;
public SysEmailService(IOptions<EmailOptions> emailOptions) public SysEmailService(IOptions<EmailOptions> emailOptions, SysConfigService sysConfigService)
{ {
_emailOptions = emailOptions.Value; _emailOptions = emailOptions.Value;
_sysConfigService = sysConfigService;
} }
/// <summary> /// <summary>
@ -29,8 +31,10 @@ public class SysEmailService : IDynamicApiController, ITransient
/// <param name="title"></param> /// <param name="title"></param>
/// <returns></returns> /// <returns></returns>
[DisplayName("发送邮件")] [DisplayName("发送邮件")]
public async Task SendEmail([Required] string content, string title = "Admin.NET 系统邮件") public async Task SendEmail([Required] string content, string title = "")
{ {
var webTitle = await _sysConfigService.GetConfigValue<string>(ConfigConst.SysWebTitle);
title = string.IsNullOrWhiteSpace(title) ? $"{webTitle} 系统邮件" : title;
var message = new MimeMessage(); var message = new MimeMessage();
message.From.Add(new MailboxAddress(_emailOptions.DefaultFromEmail, _emailOptions.DefaultFromEmail)); message.From.Add(new MailboxAddress(_emailOptions.DefaultFromEmail, _emailOptions.DefaultFromEmail));
message.To.Add(new MailboxAddress(_emailOptions.DefaultToEmail, _emailOptions.DefaultToEmail)); message.To.Add(new MailboxAddress(_emailOptions.DefaultToEmail, _emailOptions.DefaultToEmail));

View File

@ -1,32 +0,0 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
using Microsoft.AspNetCore.Authentication;
namespace Admin.NET.Core.Service;
public static class HttpContextExtension
{
public static async Task<AuthenticationScheme[]> GetExternalProvidersAsync(this HttpContext context)
{
ArgumentNullException.ThrowIfNull(context);
var schemes = context.RequestServices.GetRequiredService<IAuthenticationSchemeProvider>();
return (from scheme in await schemes.GetAllSchemesAsync()
where !string.IsNullOrEmpty(scheme.DisplayName)
select scheme).ToArray();
}
public static async Task<bool> IsProviderSupportedAsync(this HttpContext context, string provider)
{
ArgumentNullException.ThrowIfNull(context);
return (from scheme in await context.GetExternalProvidersAsync()
where string.Equals(scheme.Name, provider, StringComparison.OrdinalIgnoreCase)
select scheme).Any();
}
}

View File

@ -9,7 +9,7 @@ namespace Admin.NET.Core.Service;
/// <summary> /// <summary>
/// 开放接口身份输入参数 /// 开放接口身份输入参数
/// </summary> /// </summary>
public class OpenAccessInput : BasePageInput public class PageOpenAccessInput : BasePageInput
{ {
/// <summary> /// <summary>
/// 身份标识 /// 身份标识

View File

@ -54,7 +54,7 @@ public class SysOpenAccessService : IDynamicApiController, ITransient
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
[DisplayName("获取开放接口身份分页列表")] [DisplayName("获取开放接口身份分页列表")]
public async Task<SqlSugarPagedList<OpenAccessOutput>> Page(OpenAccessInput input) public async Task<SqlSugarPagedList<OpenAccessOutput>> Page(PageOpenAccessInput input)
{ {
return await _sysOpenAccessRep.AsQueryable() return await _sysOpenAccessRep.AsQueryable()
.LeftJoin<SysUser>((u, a) => u.BindUserId == a.Id) .LeftJoin<SysUser>((u, a) => u.BindUserId == a.Id)

View File

@ -4,6 +4,9 @@
// //
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
using AngleSharp;
using AngleSharp.Html.Dom;
namespace Admin.NET.Core.Service; namespace Admin.NET.Core.Service;
/// <summary> /// <summary>
@ -13,13 +16,15 @@ namespace Admin.NET.Core.Service;
public class SysRegionService : IDynamicApiController, ITransient public class SysRegionService : IDynamicApiController, ITransient
{ {
private readonly SqlSugarRepository<SysRegion> _sysRegionRep; private readonly SqlSugarRepository<SysRegion> _sysRegionRep;
private readonly SysConfigService _sysConfigService;
//// Url地址-国家统计局行政区域2023年 // Url地址-国家统计局行政区域2023年
//private readonly string _url = "http://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/2023/index.html"; private readonly string _url = "http://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/2023/index.html";
public SysRegionService(SqlSugarRepository<SysRegion> sysRegionRep) public SysRegionService(SqlSugarRepository<SysRegion> sysRegionRep, SysConfigService sysConfigService)
{ {
_sysRegionRep = sysRegionRep; _sysRegionRep = sysRegionRep;
_sysConfigService = sysConfigService;
} }
/// <summary> /// <summary>
@ -59,7 +64,7 @@ public class SysRegionService : IDynamicApiController, ITransient
{ {
input.Code = input.Code.Trim(); input.Code = input.Code.Trim();
if (input.Code.Length != 12 && input.Code.Length != 9 && input.Code.Length != 6) if (input.Code.Length != 12 && input.Code.Length != 9 && input.Code.Length != 6)
throw Oops.Oh("行政区代码只能为6、9或12位"); throw Oops.Oh(ErrorCodeEnum.R2003);
if (input.Pid != 0) if (input.Pid != 0)
{ {
@ -90,7 +95,7 @@ public class SysRegionService : IDynamicApiController, ITransient
{ {
input.Code = input.Code.Trim(); input.Code = input.Code.Trim();
if (input.Code.Length != 12 && input.Code.Length != 9 && input.Code.Length != 6) if (input.Code.Length != 12 && input.Code.Length != 9 && input.Code.Length != 6)
throw Oops.Oh("行政区代码只能为6、9或12位"); throw Oops.Oh(ErrorCodeEnum.R2003);
if (input.Pid != input.Pid && input.Pid != 0) if (input.Pid != input.Pid && input.Pid != 0)
{ {
@ -103,7 +108,7 @@ public class SysRegionService : IDynamicApiController, ITransient
var regionTreeList = await _sysRegionRep.AsQueryable().ToChildListAsync(u => u.Pid, input.Id, true); var regionTreeList = await _sysRegionRep.AsQueryable().ToChildListAsync(u => u.Pid, input.Id, true);
var childIdList = regionTreeList.Select(u => u.Id).ToList(); var childIdList = regionTreeList.Select(u => u.Id).ToList();
if (childIdList.Contains(input.Pid)) if (childIdList.Contains(input.Pid))
throw Oops.Oh("父节点不能为自己的子节点"); throw Oops.Oh(ErrorCodeEnum.R2004);
} }
if (input.Id == input.Pid) if (input.Id == input.Pid)
@ -144,93 +149,117 @@ public class SysRegionService : IDynamicApiController, ITransient
[DisplayName("同步行政区域")] [DisplayName("同步行政区域")]
public async Task Sync() public async Task Sync()
{ {
var syncLevel = await _sysConfigService.GetConfigValue<int>(CommonConst.SysRegionSyncLevel);
if (syncLevel < 1 || syncLevel > 5)
syncLevel = 3;//默认区县级
var context = BrowsingContext.New(AngleSharp.Configuration.Default.WithDefaultLoader());
var dom = await context.OpenAsync(_url);
// 省级
var itemList = dom.QuerySelectorAll("table.provincetable tr.provincetr td a");
if (itemList.Length == 0)
throw Oops.Oh(ErrorCodeEnum.R2005);
await _sysRegionRep.DeleteAsync(u => u.Id > 0); await _sysRegionRep.DeleteAsync(u => u.Id > 0);
//var context = BrowsingContext.New(AngleSharp.Configuration.Default.WithDefaultLoader()); foreach (IHtmlAnchorElement item in itemList)
//var dom = await context.OpenAsync(_url); {
var list = new List<SysRegion>();
//// 省级 var region = new SysRegion
//var itemList = dom.QuerySelectorAll("table.provincetable tr.provincetr td a"); {
//foreach (IHtmlAnchorElement item in itemList) Id = YitIdHelper.NextId(),
//{ Pid = 0,
// var region = await _sysRegionRep.InsertReturnEntityAsync(new SysRegion Name = item.TextContent,
// { Remark = item.Href,
// Pid = 0, Level = 1,
// Name = item.TextContent, };
// Remark = item.Href, list.Add(region);
// Level = 1,
// });
// // 市级 // 市级
// if (string.IsNullOrEmpty(item.Href)) if (!string.IsNullOrEmpty(item.Href) && syncLevel > 1)
// continue; {
// var dom1 = await context.OpenAsync(item.Href); var dom1 = await context.OpenAsync(item.Href);
// var itemList1 = dom1.QuerySelectorAll("table.citytable tr.citytr td a"); var itemList1 = dom1.QuerySelectorAll("table.citytable tr.citytr td a");
// for (var i1 = 0; i1 < itemList1.Length; i1 += 2) for (var i1 = 0; i1 < itemList1.Length; i1 += 2)
// { {
// var item1 = (IHtmlAnchorElement)itemList1[i1 + 1]; var item1 = (IHtmlAnchorElement)itemList1[i1 + 1];
// var region1 = await _sysRegionRep.InsertReturnEntityAsync(new SysRegion var region1 = new SysRegion
// { {
// Pid = region.Id, Id = YitIdHelper.NextId(),
// Name = item1.TextContent, Pid = region.Id,
// Code = itemList1[i1].TextContent, Name = item1.TextContent,
// Remark = item1.Href, Code = itemList1[i1].TextContent,
// Level = 2, Remark = item1.Href,
// }); Level = 2,
};
list.Add(region1);
// // 区县级 // 区县级
// if (string.IsNullOrEmpty(item1.Href)) if (!string.IsNullOrEmpty(item1.Href) && syncLevel > 2)
// continue; {
// var dom2 = await context.OpenAsync(item1.Href); var dom2 = await context.OpenAsync(item1.Href);
// var itemList2 = dom2.QuerySelectorAll("table.countytable tr.countytr td a"); var itemList2 = dom2.QuerySelectorAll("table.countytable tr.countytr td a");
// for (var i2 = 0; i2 < itemList2.Length; i2 += 2) for (var i2 = 0; i2 < itemList2.Length; i2 += 2)
// { {
// var item2 = (IHtmlAnchorElement)itemList2[i2 + 1]; var item2 = (IHtmlAnchorElement)itemList2[i2 + 1];
// var region2 = await _sysRegionRep.InsertReturnEntityAsync(new SysRegion var region2 = new SysRegion
// { {
// Pid = region1.Id, Id = YitIdHelper.NextId(),
// Name = item2.TextContent, Pid = region1.Id,
// Code = itemList2[i2].TextContent, Name = item2.TextContent,
// Remark = item2.Href, Code = itemList2[i2].TextContent,
// Level = 3, Remark = item2.Href,
// }); Level = 3,
};
list.Add(region2);
// // 街道级 // 街道级
// if (string.IsNullOrEmpty(item2.Href)) if (!string.IsNullOrEmpty(item2.Href) && syncLevel > 3)
// continue; {
// var dom3 = await context.OpenAsync(item2.Href); var dom3 = await context.OpenAsync(item2.Href);
// var itemList3 = dom3.QuerySelectorAll("table.towntable tr.towntr td a"); var itemList3 = dom3.QuerySelectorAll("table.towntable tr.towntr td a");
// for (var i3 = 0; i3 < itemList3.Length; i3 += 2) for (var i3 = 0; i3 < itemList3.Length; i3 += 2)
// { {
// var item3 = (IHtmlAnchorElement)itemList3[i3 + 1]; var item3 = (IHtmlAnchorElement)itemList3[i3 + 1];
// var region3 = await _sysRegionRep.InsertReturnEntityAsync(new SysRegion var region3 = new SysRegion
// { {
// Pid = region2.Id, Id = YitIdHelper.NextId(),
// Name = item3.TextContent, Pid = region2.Id,
// Code = itemList3[i3].TextContent, Name = item3.TextContent,
// Remark = item3.Href, Code = itemList3[i3].TextContent,
// Level = 4, Remark = item3.Href,
// }); Level = 4,
};
list.Add(region3);
// // 村级 // 村级
// if (string.IsNullOrEmpty(item3.Href)) if (!string.IsNullOrEmpty(item3.Href) && syncLevel > 4)
// continue; {
// var dom4 = await context.OpenAsync(item3.Href); var dom4 = await context.OpenAsync(item3.Href);
// var itemList4 = dom4.QuerySelectorAll("table.villagetable tr.villagetr td"); var itemList4 = dom4.QuerySelectorAll("table.villagetable tr.villagetr td");
// for (var i4 = 0; i4 < itemList4.Length; i4 += 3) for (var i4 = 0; i4 < itemList4.Length; i4 += 3)
// { {
// await _sysRegionRep.InsertAsync(new SysRegion list.Add(new SysRegion
// { {
// Pid = region3.Id, Id = YitIdHelper.NextId(),
// Name = itemList4[i4 + 2].TextContent, Pid = region3.Id,
// Code = itemList4[i4].TextContent, Name = itemList4[i4 + 2].TextContent,
// CityCode = itemList4[i4 + 1].TextContent, Code = itemList4[i4].TextContent,
// Level = 5, CityCode = itemList4[i4 + 1].TextContent,
// }); Level = 5,
// } });
// } }
// } }
// } }
//} }
}
}
}
}
//按省份同步快速写入提升同步效率,全部一次性写入容易出现从统计局获取数据失败
_sysRegionRep.Context.Fastest<SysRegion>().BulkCopy(list);
}
} }
} }

View File

@ -27,7 +27,7 @@ public class SysRoleApiService : ITransient
{ {
await _sysRoleApiRep.DeleteAsync(u => u.RoleId == input.Id); await _sysRoleApiRep.DeleteAsync(u => u.RoleId == input.Id);
var roleApis = input.ApiList.Select(u => new SysRoleApi var roleApis = input.ApiList.Where(u => !string.IsNullOrWhiteSpace(u)).Select(u => new SysRoleApi
{ {
RoleId = input.Id, RoleId = input.Id,
Route = u Route = u

View File

@ -115,4 +115,30 @@ public class AddSubscribeMessageTemplateInput
/// </summary> /// </summary>
[Required(ErrorMessage = "服务场景描述不能为空")] [Required(ErrorMessage = "服务场景描述不能为空")]
public string SceneDescription { get; set; } public string SceneDescription { get; set; }
}
/// <summary>
/// 验证签名
/// </summary>
public class VerifySignatureInput
{
/// <summary>
/// 签名
/// </summary>
public string signature { get; set; }
/// <summary>
/// 时间戳
/// </summary>
public string timestamp { get; set; }
/// <summary>
/// 随机数
/// </summary>
public string nonce { get; set; }
/// <summary>
/// 随机字符串
/// </summary>
public string echostr { get; set; }
} }

View File

@ -114,6 +114,24 @@ public class SysWxOpenService : IDynamicApiController, ITransient
}; };
} }
/// <summary>
/// 验证签名 🔖
/// </summary>
[AllowAnonymous]
[NonUnify]
[ApiDescriptionSettings(Name = "VerifySignature"), HttpGet]
[DisplayName("验证签名")]
public string VerifySignature([FromQuery] VerifySignatureInput input)
{
bool valid = _wechatApiClient.VerifyEventSignatureForEcho(input.timestamp, input.nonce, input.signature);
if (!valid)
{
return "fail";
}
return input.echostr;
}
/// <summary> /// <summary>
/// 获取订阅消息模板列表 🔖 /// 获取订阅消息模板列表 🔖
/// </summary> /// </summary>

View File

@ -68,8 +68,10 @@ public static class SqlSugarFilter
if ((tAtt != null && db.CurrentConnectionConfig.ConfigId.ToString() != tAtt.configId.ToString())) if ((tAtt != null && db.CurrentConnectionConfig.ConfigId.ToString() != tAtt.configId.ToString()))
continue; continue;
var lambda = DynamicExpressionParser.ParseLambda(new[] { //var lambda = DynamicExpressionParser.ParseLambda(new[] {
Expression.Parameter(entityType, "u") }, typeof(bool), $"@0.Contains(u.{nameof(EntityBaseData.CreateOrgId)}??{default(long)})", orgIds); // Expression.Parameter(entityType, "u") }, typeof(bool), $"@0.Contains(u.{nameof(EntityBaseData.CreateOrgId)}??{default(long)})", orgIds);
var lambda = entityType.GetConditionExpression<OwnerOrgAttribute>(orgIds);
db.QueryFilter.AddTableFilter(entityType, lambda); db.QueryFilter.AddTableFilter(entityType, lambda);
orgFilter.TryAdd(entityType, lambda); orgFilter.TryAdd(entityType, lambda);
} }
@ -114,8 +116,10 @@ public static class SqlSugarFilter
if ((tAtt != null && db.CurrentConnectionConfig.ConfigId.ToString() != tAtt.configId.ToString())) if ((tAtt != null && db.CurrentConnectionConfig.ConfigId.ToString() != tAtt.configId.ToString()))
continue; continue;
var lambda = DynamicExpressionParser.ParseLambda(new[] { //var lambda = DynamicExpressionParser.ParseLambda(new[] {
Expression.Parameter(entityType, "u") }, typeof(bool), $"u.{nameof(EntityBaseData.CreateUserId)}=@0", userId); // Expression.Parameter(entityType, "u") }, typeof(bool), $"u.{nameof(EntityBaseData.CreateUserId)}=@0", userId);
var lambda = entityType.GetConditionExpression<OwnerUserAttribute>(new List<long> { long.Parse(userId) });
db.QueryFilter.AddTableFilter(entityType, lambda); db.QueryFilter.AddTableFilter(entityType, lambda);
dataScopeFilter.TryAdd(entityType, lambda); dataScopeFilter.TryAdd(entityType, lambda);
} }

View File

@ -0,0 +1,75 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 模糊查询条件
/// </summary>
public class Search
{
/// <summary>
/// 字段名称集合
/// </summary>
public List<string> Fields { get; set; }
/// <summary>
/// 关键字
/// </summary>
public string? Keyword { get; set; }
}
/// <summary>
/// 筛选过滤条件
/// </summary>
public class Filter
{
/// <summary>
/// 过滤条件
/// </summary>
public FilterLogicEnum? Logic { get; set; }
/// <summary>
/// 筛选过滤条件子项
/// </summary>
public IEnumerable<Filter>? Filters { get; set; }
/// <summary>
/// 字段名称
/// </summary>
public string? Field { get; set; }
/// <summary>
/// 逻辑运算符
/// </summary>
public FilterOperatorEnum? Operator { get; set; }
/// <summary>
/// 字段值
/// </summary>
public object? Value { get; set; }
}
/// <summary>
/// 过滤条件基类
/// </summary>
public abstract class BaseFilter
{
/// <summary>
/// 模糊查询条件
/// </summary>
public Search? Search { get; set; }
/// <summary>
/// 模糊查询关键字
/// </summary>
public string? Keyword { get; set; }
/// <summary>
/// 筛选过滤条件
/// </summary>
public Filter? Filter { get; set; }
}

View File

@ -9,7 +9,7 @@ namespace Admin.NET.Core;
/// <summary> /// <summary>
/// 全局分页查询输入参数 /// 全局分页查询输入参数
/// </summary> /// </summary>
public class BasePageInput public class BasePageInput : BaseFilter
{ {
/// <summary> /// <summary>
/// 当前页码 /// 当前页码

View File

@ -49,12 +49,12 @@ public static class CommonUtil
// 代理模式:获取真正的本机地址 // 代理模式:获取真正的本机地址
// X-Original-Host=原始请求 // X-Original-Host=原始请求
// X-Forwarded-Server=从哪里转发过来 // X-Forwarded-Server=从哪里转发过来
if (App.HttpContext.Request.Headers.ContainsKey("Origin")) // 配置成完整的路径如(结尾不要带"/",比如 https://www.abc.com if (App.HttpContext.Request.Headers.TryGetValue("Origin", out Microsoft.Extensions.Primitives.StringValues value1)) // 配置成完整的路径如(结尾不要带"/",比如 https://www.abc.com
result = $"{App.HttpContext.Request.Headers["Origin"]}"; result = $"{value1}";
else if (App.HttpContext.Request.Headers.ContainsKey("X-Original")) // 配置成完整的路径如(结尾不要带"/",比如 https://www.abc.com else if (App.HttpContext.Request.Headers.TryGetValue("X-Original", out Microsoft.Extensions.Primitives.StringValues value2)) // 配置成完整的路径如(结尾不要带"/",比如 https://www.abc.com
result = $"{App.HttpContext.Request.Headers["X-Original"]}"; result = $"{value2}";
else if (App.HttpContext.Request.Headers.ContainsKey("X-Original-Host")) else if (App.HttpContext.Request.Headers.TryGetValue("X-Original-Host", out Microsoft.Extensions.Primitives.StringValues value3))
result = $"{App.HttpContext.Request.Scheme}://{App.HttpContext.Request.Headers["X-Original-Host"]}"; result = $"{App.HttpContext.Request.Scheme}://{value3}";
return result; return result;
} }
@ -107,7 +107,7 @@ public static class CommonUtil
/// <returns></returns> /// <returns></returns>
public static async Task<IActionResult> ExportExcelTemplate<T>(string fileName = null) where T : class, new() public static async Task<IActionResult> ExportExcelTemplate<T>(string fileName = null) where T : class, new()
{ {
IImporter importer = new ExcelImporter(); var importer = new ExcelImporter();
var res = await importer.GenerateTemplateBytes<T>(); var res = await importer.GenerateTemplateBytes<T>();
return new FileContentResult(res, "application/octet-stream") { FileDownloadName = $"{(string.IsNullOrEmpty(fileName) ? typeof(T).Name : fileName)}.xlsx" }; return new FileContentResult(res, "application/octet-stream") { FileDownloadName = $"{(string.IsNullOrEmpty(fileName) ? typeof(T).Name : fileName)}.xlsx" };
@ -152,9 +152,9 @@ public static class CommonUtil
} }
var map = dict.Value.Item1; var map = dict.Value.Item1;
if (map != null && map.ContainsKey(sourceVal)) if (map != null && map.TryGetValue(sourceVal, out string value))
{ {
var newVal = map[sourceVal]; var newVal = value;
targeProp.SetValue(newData, newVal); targeProp.SetValue(newData, newVal);
} }
else else
@ -190,7 +190,7 @@ public static class CommonUtil
/// <returns></returns> /// <returns></returns>
public static async Task<ICollection<T>> ImportExcelData<T>([Required] IFormFile file) where T : class, new() public static async Task<ICollection<T>> ImportExcelData<T>([Required] IFormFile file) where T : class, new()
{ {
IImporter importer = new ExcelImporter(); var importer = new ExcelImporter();
var res = await importer.Import<T>(file.OpenReadStream()); var res = await importer.Import<T>(file.OpenReadStream());
var message = string.Empty; var message = string.Empty;
if (res.HasError) if (res.HasError)
@ -203,7 +203,46 @@ public static class CommonUtil
foreach (var item in drErrorInfo.FieldErrors) foreach (var item in drErrorInfo.FieldErrors)
message += $"\r\n{item.Key}{item.Value}(文件第{drErrorInfo.RowIndex}行)"; message += $"\r\n{item.Key}{item.Value}(文件第{drErrorInfo.RowIndex}行)";
} }
message += "字段缺失:" + string.Join("", res.TemplateErrors.Select(m => m.RequireColumnName).ToList()); message += "\r\n字段缺失" + string.Join("", res.TemplateErrors.Select(m => m.RequireColumnName).ToList());
throw Oops.Oh("导入异常:" + message);
}
return res.Data;
}
/// <summary>
/// 导入Excel数据并错误标记
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="file"></param>
/// <param name="importResultCallback"></param>
/// <returns></returns>
public static async Task<ICollection<T>> ImportExcelData<T>([Required] IFormFile file, Func<ImportResult<T>, ImportResult<T>> importResultCallback = null) where T : class, new()
{
var importer = new ExcelImporter();
var resultStream = new MemoryStream();
var res = await importer.Import<T>(file.OpenReadStream(), resultStream, importResultCallback);
resultStream.Seek(0, SeekOrigin.Begin);
var userId = App.User?.FindFirst(ClaimConst.UserId)?.Value;
App.GetRequiredService<SysCacheService>().Remove(CacheConst.KeyExcelTemp + userId);
App.GetRequiredService<SysCacheService>().Set(CacheConst.KeyExcelTemp + userId, resultStream, TimeSpan.FromMinutes(5));
var message = string.Empty;
if (res.HasError)
{
if (res.Exception != null)
message += $"\r\n{res.Exception.Message}";
foreach (DataRowErrorInfo drErrorInfo in res.RowErrors)
{
int rowNum = drErrorInfo.RowIndex;
foreach (var item in drErrorInfo.FieldErrors)
message += $"\r\n{item.Key}{item.Value}(文件第{drErrorInfo.RowIndex}行)";
}
if (res.TemplateErrors.Count > 0)
message += "\r\n字段缺失" + string.Join("", res.TemplateErrors.Select(m => m.RequireColumnName).ToList());
if (message.Length > 200)
message = string.Concat(message.AsSpan(0, 200), "...\r\n异常过多建议下载错误标记文件查看详细错误信息并重新导入。");
throw Oops.Oh("导入异常:" + message); throw Oops.Oh("导入异常:" + message);
} }
return res.Data; return res.Data;
@ -300,7 +339,7 @@ public static class CommonUtil
else else
{ {
propMappings.Add(propertyInfo.Name, new Tuple<Dictionary<string, object>, PropertyInfo, PropertyInfo>( propMappings.Add(propertyInfo.Name, new Tuple<Dictionary<string, object>, PropertyInfo, PropertyInfo>(
null, propertyInfo, tTargetProps.ContainsKey(propertyInfo.Name) ? tTargetProps[propertyInfo.Name] : null)); null, propertyInfo, tTargetProps.TryGetValue(propertyInfo.Name, out PropertyInfo value) ? value : null));
} }
} }
@ -342,34 +381,34 @@ public static class CommonUtil
else else
{ {
propMappings.Add(propertyInfo.Name, new Tuple<Dictionary<object, string>, PropertyInfo, PropertyInfo>( propMappings.Add(propertyInfo.Name, new Tuple<Dictionary<object, string>, PropertyInfo, PropertyInfo>(
null, sourceProps.ContainsKey(propertyInfo.Name) ? sourceProps[propertyInfo.Name] : null, propertyInfo)); null, sourceProps.TryGetValue(propertyInfo.Name, out PropertyInfo value) ? value : null, propertyInfo));
} }
} }
return propMappings; return propMappings;
} }
/// <summary> ///// <summary>
/// 获取属性映射 ///// 获取属性映射
/// </summary> ///// </summary>
/// <typeparam name="TTarget"></typeparam> ///// <typeparam name="TTarget"></typeparam>
/// <returns>整理导入对象的 属性名称, 字典数据,原属性信息,目标属性信息 </returns> ///// <returns>整理导入对象的 属性名称, 字典数据,原属性信息,目标属性信息 </returns>
private static Dictionary<string, Tuple<string, string>> GetExportDicttMap<TTarget>() where TTarget : new() //private static Dictionary<string, Tuple<string, string>> GetExportDicttMap<TTarget>() where TTarget : new()
{ //{
// 整理导入对象的属性名称目标属性名字典Code // // 整理导入对象的属性名称目标属性名字典Code
var propMappings = new Dictionary<string, Tuple<string, string>>(); // var propMappings = new Dictionary<string, Tuple<string, string>>();
var tTargetProps = typeof(TTarget).GetProperties(); // var tTargetProps = typeof(TTarget).GetProperties();
foreach (var propertyInfo in tTargetProps) // foreach (var propertyInfo in tTargetProps)
{ // {
var attrs = propertyInfo.GetCustomAttribute<ImportDictAttribute>(); // var attrs = propertyInfo.GetCustomAttribute<ImportDictAttribute>();
if (attrs != null && !string.IsNullOrWhiteSpace(attrs.TypeCode)) // if (attrs != null && !string.IsNullOrWhiteSpace(attrs.TypeCode))
{ // {
propMappings.Add(propertyInfo.Name, new Tuple<string, string>(attrs.TargetPropName, attrs.TypeCode)); // propMappings.Add(propertyInfo.Name, new Tuple<string, string>(attrs.TargetPropName, attrs.TypeCode));
} // }
} // }
return propMappings; // return propMappings;
} //}
/// <summary> /// <summary>
/// 解析IP地址 /// 解析IP地址

View File

@ -169,16 +169,24 @@
import { ref,onMounted, reactive } from "vue"; import { ref,onMounted, reactive } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import type { FormRules } from "element-plus"; import type { FormRules } from "element-plus";
@if (@Model.IsApiService) {
// 接口函数 // 接口函数
import { getAPI } from '/@@/utils/axios-utils'; @:import { getAPI } from '/@@/utils/axios-utils';
// 接口 // 接口
import { @(@Model.ClassName)Api } from '/@@/api-services/api'; @:import { @(@Model.ClassName)Api } from '/@@/api-services/api';
// 模型 // 模型
import { Update@(@Model.ClassName)Input } from '/@@/api-services/models'; @:import { Update@(@Model.ClassName)Input } from '/@@/api-services/models';
} else {
@:import { add@(@Model.ClassName), update@(@Model.ClassName), detail@(@Model.ClassName) } from "/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)";
if(@Model.TableField.Any(x=>x.EffectType == "Upload")){
@:import { Plus } from "@@element-plus/icons-vue";
@:import { UploadRequestOptions } from "element-plus";
@:import {@string.Join(",",Model.TableField.Where(x=>x.EffectType == "Upload").Select(x=>"upload"+x.PropertyName).ToList())} from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
}
}
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){ @if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
@:import { getConstType } from "/@@/utils/constHelper"; @:import { getConstType } from "/@@/utils/constHelper";
@ -244,8 +252,11 @@
// 改用detail获取最新数据来编辑 // 改用detail获取最新数据来编辑
let rowData = JSON.parse(JSON.stringify(row)); let rowData = JSON.parse(JSON.stringify(row));
if (rowData.id) if (rowData.id)
//state.ruleForm = (await detail@(@Model.ClassName)(rowData.id)).data.result; @if (@Model.IsApiService) {
state.ruleForm = (await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DetailGet(rowData.id)).data.result; @:state.ruleForm = (await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DetailGet(rowData.id)).data.result;
} else {
@:state.ruleForm = (await detail@(@Model.ClassName)(rowData.id)).data.result;
}
else else
state.ruleForm = rowData; state.ruleForm = rowData;
state.isShowDialog = true; state.isShowDialog = true;
@ -268,11 +279,17 @@
if (isValid) { if (isValid) {
let values = state.ruleForm; let values = state.ruleForm;
if (state.ruleForm.@(@pkFieldName) == undefined || state.ruleForm.@(@pkFieldName) == null || state.ruleForm.@(@pkFieldName) == "" || state.ruleForm.@(@pkFieldName) == 0) { if (state.ruleForm.@(@pkFieldName) == undefined || state.ruleForm.@(@pkFieldName) == null || state.ruleForm.@(@pkFieldName) == "" || state.ruleForm.@(@pkFieldName) == 0) {
//await add@(@Model.ClassName)(values); @if (@Model.IsApiService) {
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)AddPost(state.ruleForm); @:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)AddPost(state.ruleForm);
} else {
@:await add@(@Model.ClassName)(values);
}
} else { } else {
//await update@(@Model.ClassName)(values); @if (@Model.IsApiService) {
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)UpdatePost(state.ruleForm); @:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)UpdatePost(state.ruleForm);
} else {
@:await update@(@Model.ClassName)(values);
}
} }
closeDialog(); closeDialog();
} else { } else {
@ -324,7 +341,11 @@
if(column.WhetherAddUpdate=="N") continue; if(column.WhetherAddUpdate=="N") continue;
if(@column.EffectType == "Upload"){ if(@column.EffectType == "Upload"){
@:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => { @:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => {
@if (@Model.IsApiService) {
@:let list = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.FkEntityName)PostForm(options); @:let list = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.FkEntityName)PostForm(options);
} else {
@:let list = await upload@(@column.PropertyName)(options);
}
@:state.ruleForm.@(column.LowerPropertyName) = res.data.result?.url; @:state.ruleForm.@(column.LowerPropertyName) = res.data.result?.url;
@:}; @:};
} }

View File

@ -19,25 +19,30 @@
} }
<template> <template>
<div class="@(@Model.LowerClassName)-container" v-loading="options.loading"> <div class="@(@Model.LowerClassName)-container" v-loading="options.loading">
<el-card shadow="hover" :body-style="{ padding: '20px 20px 16px 0px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }"> <el-card shadow="hover" :body-style="{ padding: '20px 20px 16px 10px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%"> <el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%" @@submit.prevent="handleQuery" >
<el-row :gutter="10"> <el-row :gutter="10">
@if(Model.QueryWhetherList.Count > 0){ @if(Model.QueryWhetherList.Count > 0){
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
<el-form-item label="关键字" prop="searchKey">
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
foreach (var column in Model.QueryWhetherList) { foreach (var column in Model.QueryWhetherList) {
if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") { if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6"> <el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)"> <el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
<el-input v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="@column.ColumnComment" clearable @@keyup.enter.native="handleQuery(true)" /> <el-input v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="@column.ColumnComment" clearable @@keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
} else if(@column.EffectType == "InputNumber") { } else if(@column.EffectType == "InputNumber") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6"> <el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-form-item label="@column.ColumnComment"> <el-form-item label="@column.ColumnComment">
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" /> <el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
} else if(@column.EffectType == "fk") { } else if(@column.EffectType == "fk") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6"> <el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-form-item label="@column.ColumnComment"> <el-form-item label="@column.ColumnComment">
<el-select filterable="" v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请选择@(@column.ColumnComment)" clearable> <el-select filterable="" v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请选择@(@column.ColumnComment)" clearable>
<el-option v-for="(item,index) in @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList" :key="index" :value="item.value" :label="item.label" /> <el-option v-for="(item,index) in @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList" :key="index" :value="item.value" :label="item.label" />
@ -45,23 +50,23 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
} else if(@column.EffectType == "Select") { } else if(@column.EffectType == "Select") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6"> <el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)"> <el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" > <el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" >
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.code" :label="`${item.name} [${item.code}] ${item.value}`" /> <el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.code" :label="`${item.name} [${item.code}] ${item.value}`" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
} else if(@column.EffectType == "EnumSelector") { } else if(@column.EffectType == "EnumSelector") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6"> <el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)"> <el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" > <el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" >
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`${item.name} [${item.code}] ${item.value}`" /> <el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`${item.name} [${item.code}] ${item.value}`" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
} else if(@column.EffectType == "DatePicker") { } else if(@column.EffectType == "DatePicker") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6"> <el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)"> <el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
@if(@column.QueryType == "~"){ @if(@column.QueryType == "~"){
@:<el-date-picker type="daterange" v-model="state.queryParams.@(@column.LowerPropertyName)Range" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" /> @:<el-date-picker type="daterange" v-model="state.queryParams.@(@column.LowerPropertyName)Range" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" />
@ -81,15 +86,17 @@
<el-row> <el-row>
<el-col> <el-col>
<el-button-group> <el-button-group>
<el-button type="primary" icon="ele-Search" @@click="handleQuery(true)" v-auth="'@(@Model.LowerClassName):page'" :loading="options.loading"> 查询 </el-button> <el-button type="primary" icon="ele-Search" @@click="handleQuery" v-auth="'@(@Model.LowerClassName):page'" :loading="options.loading"> 查询 </el-button>
<el-button icon="ele-Refresh" @@click="resetQuery" :loading="options.loading"> 重置 </el-button> <el-button icon="ele-Refresh" @@click="resetQuery" :loading="options.loading"> 重置 </el-button>
<el-button icon="ele-ZoomIn" @@click="changeAdvanceQueryUI" v-if="!state.showAdvanceQueryUI" style="margin-left: 5px"> 高级查询 </el-button>
<el-button icon="ele-ZoomOut" @@click="changeAdvanceQueryUI" v-if="state.showAdvanceQueryUI" style="margin-left: 5px"> 隐藏 </el-button>
</el-button-group> </el-button-group>
</el-col> </el-col>
</el-row> </el-row>
</el-card> </el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px"> <el-card class="full-table" shadow="hover" style="margin-top: 5px">
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @@sort-change="sortChange"> <vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
<template #toolbar_buttons> <template #toolbar_buttons>
<el-button type="primary" icon="ele-Plus" @@click="handleAdd" v-auth="'@(@Model.LowerClassName):add'"> 新增 </el-button> <el-button type="primary" icon="ele-Plus" @@click="handleAdd" v-auth="'@(@Model.LowerClassName):add'"> 新增 </el-button>
</template> </template>
@ -147,11 +154,7 @@
@:<template #row_@(@column.LowerPropertyName)="{ row }"> @:<template #row_@(@column.LowerPropertyName)="{ row }">
@:<el-tag :type="dv('@(@column.DictTypeCode)', row.@(@column.LowerPropertyName))?.tagType"> {{dv('@(@column.DictTypeCode)', row.@column.LowerPropertyName)?.name}}</el-tag> @:<el-tag :type="dv('@(@column.DictTypeCode)', row.@(@column.LowerPropertyName))?.tagType"> {{dv('@(@column.DictTypeCode)', row.@column.LowerPropertyName)?.name}}</el-tag>
@:</template> @:</template>
} else if(@column.EffectType == "DatePicker") { }
@:<template #row_@(@column.LowerPropertyName)="{ row }">
@:<span>{{ formatDate(new Date(row.@(@column.LowerPropertyName)), 'YYYY-mm-dd') }}</span>
@:</template>
}
} }
} }
<template #row_record="{ row }"> <template #row_record="{ row }">
@ -170,15 +173,6 @@
<el-button icon="ele-Delete" size="small" text type="danger" @@click="handleDelete(row)" v-auth="'@(@Model.LowerClassName):delete'" :disabled="row.status === 1" /> <el-button icon="ele-Delete" size="small" text type="danger" @@click="handleDelete(row)" v-auth="'@(@Model.LowerClassName):delete'" :disabled="row.status === 1" />
</el-tooltip> </el-tooltip>
</template> </template>
<template #pager>
<vxe-pager
:loading="options.loading"
v-model:current-page="state.tableParams.page"
v-model:page-size="state.tableParams.pageSize"
:total="state.tableParams.total"
@@page-change="pageChange"
/>
</template>
</vxe-grid> </vxe-grid>
</el-card> </el-card>
@ -191,8 +185,10 @@
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage } from "element-plus";
import { auth } from '/@@/utils/authFunction'; import { auth } from '/@@/utils/authFunction';
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
import { useVxeTable } from '/@@/hooks/vxeTableOptionsHook'; import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
import { useVxeTable } from '/@@/hooks/useVxeTableOptionsHook';
import { Local } from '/@@/utils/storage';
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){ @if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
@:import { codeToName, getConstType } from "/@@/utils/constHelper"; @:import { codeToName, getConstType } from "/@@/utils/constHelper";
@ -218,14 +214,24 @@ import PrintDialog from '/@@/views/system/print/component/hiprint/preview.vue';
import EditDialog from '/@@/views/@(@Model.PagePath)/@(@Model.LowerClassName)/component/editDialog.vue'; import EditDialog from '/@@/views/@(@Model.PagePath)/@(@Model.LowerClassName)/component/editDialog.vue';
import ModifyRecord from '/@@/components/table/modifyRecord.vue'; import ModifyRecord from '/@@/components/table/modifyRecord.vue';
@if (@Model.IsApiService) {
// 接口函数 // 接口函数
import { getAPI } from '/@@/utils/axios-utils'; @:import { getAPI } from '/@@/utils/axios-utils';
// 接口 // 接口
import { @(@Model.ClassName)Api } from '/@@/api-services/api'; @:import { @(@Model.ClassName)Api } from '/@@/api-services/api';
// 模型 // 模型
import { @(@Model.ClassName), @(@Model.ClassName)Input, @(@Model.ClassName)Output } from '/@@/api-services/models'; @:import { @(@Model.ClassName), @(@Model.ClassName)Input, @(@Model.ClassName)Output } from '/@@/api-services/models';
} else {
@:import { page@(@Model.ClassName), delete@(@Model.ClassName) } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
foreach (var column in Model.QueryWhetherList){
if(@column.EffectType == "fk"){
@:import { get@(@column.FkEntityName)@(@column.PropertyName)Dropdown } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
}
}
}
// 子窗口对象 // 子窗口对象
const xGrid = ref<VxeGridInstance>(); const xGrid = ref<VxeGridInstance>();
@ -234,108 +240,112 @@ const editDialogRef = ref<InstanceType<typeof EditDialog>>();
// 变量 // 变量
const state = reactive({ const state = reactive({
showAdvanceQueryUI: false,
queryParams: { queryParams: {
searchKey: undefined,
@if(Model.QueryWhetherList.Count > 0) { @if(Model.QueryWhetherList.Count > 0) {
@foreach (var column in Model.QueryWhetherList) { @foreach (var column in Model.QueryWhetherList) {
@:@(@column.LowerPropertyName): undefined, @:@(@column.LowerPropertyName): undefined,
} }
} }
}, },
tableParams: { localPageParam: {
page: 1, pageSize: 50 as number,
pageSize: 50, defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' },
field: 'id', // 默认的排序字段
order: 'aes', // 排序方向
descStr: 'desc', // 降序排序的关键字符
total: 0 as any,
}, },
visible: false, visible: false,
title: '', title: '',
}); });
// 本地存储参数
const localPageParamKey = 'localPageParam:@(@Model.LowerClassName)';
// 改变高级查询的控件显示状态
const changeAdvanceQueryUI = () => {
state.showAdvanceQueryUI = !state.showAdvanceQueryUI;
};
// 表格参数配置 // 表格参数配置
const options = useVxeTable<@(@Model.ClassName)>({ const options = useVxeTable<@(@Model.ClassName)>(
id: '@(@Model.ClassName)', {
name: '@(@Model.BusName)', id: '@(@Model.ClassName)',
columns: [ name: '@(@Model.BusName)',
{ type: 'seq', title: '序号', width: 60, fixed: 'left' }, columns: [
@foreach (var column in Model.TableField) { { type: 'seq', title: '序号', width: 60, fixed: 'left' },
var whethersortable =column.WhetherSortable == "Y" ? "sortable: true" : "sortable: false"; @foreach (var column in Model.TableField) {
if(@column.WhetherTable == "Y") { var whethersortable =column.WhetherSortable == "Y" ? "sortable: true" : "sortable: false";
if(@column.EffectType == "Upload" || @column.EffectType == "fk" || @column.EffectType == "ApiTreeSelect" || @column.EffectType == "Switch" || @column.EffectType == "ConstSelector") { if(@column.WhetherTable == "Y") {
if(@column.EffectType == "Upload") { if(@column.EffectType == "Upload" || @column.EffectType == "fk" || @column.EffectType == "ApiTreeSelect" || @column.EffectType == "Switch" || @column.EffectType == "ConstSelector") {
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable }, if(@column.EffectType == "Upload") {
} else if(@column.EffectType == "fk") { @:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable }, } else if(@column.EffectType == "fk") {
} else if(@column.EffectType == "ApiTreeSelect") { @:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable }, } else if(@column.EffectType == "ApiTreeSelect") {
} else if(@column.EffectType == "Switch") { @:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable }, } else if(@column.EffectType == "Switch") {
} else if(@column.EffectType == "ConstSelector") { @:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable }, } else if(@column.EffectType == "ConstSelector") {
} @:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
} else if(@column.EffectType == "Select") { }
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable }, } else if(@column.EffectType == "Select") {
} else if(@column.EffectType == "EnumSelector") { @:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable }, } else if(@column.EffectType == "EnumSelector") {
} else if(@column.EffectType == "DatePicker") { @:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable }, } else if(@column.EffectType == "DatePicker") {
} else { @:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', formatter: ({ cellValue }) => formatDate(new Date(cellValue), 'YYYY-mm-dd HH:MM:SS'), @whethersortable },
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', @whethersortable}, } else {
} @:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', @whethersortable},
} }
} }
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } }, }
{ title: '操作', fixed: 'right', width: 180, showOverflow: true, slots: { default: 'row_buttons' } }, { field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
], { title: '操作', fixed: 'right', width: 180, showOverflow: true, slots: { default: 'row_buttons' } },
enableExport: auth('@(@Model.LowerClassName):export'), ],
searchCallback: () => handleQuery(), },
queryAllCallback: () => fetchData({ pageSize: 99999 }), // vxeGrid配置参数(此处可覆写任何参数)参考vxe-table官方文档
}); {
// 代理配置
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
// 排序配置
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
// 分页配置
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
// 工具栏配置
toolbarConfig: { export: false },
// 行设置
rowConfig: { height: 80 },
}
);
// 页面初始化 // 页面初始化
onMounted(async () => { onMounted(async () => {
await handleQuery(); await handleQuery();
}); });
// 查询操作 // 查询api
const handleQuery = async (reset = false) => { const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
options.loading = true; const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as @(@Model.ClassName)Input;
if (reset) state.tableParams.page = 1; @if (@Model.IsApiService) {
var res = await fetchData(null); @:return getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)PagePost(params);
xGrid.value?.loadData(res.data.result?.items ?? []); } else {
state.tableParams.total = res.data.result?.total; @:return page@(@Model.ClassName)(params);
options.loading = false; }
}; };
// 获取数据 // 查询操作
const fetchData = async (tableParams: any) => { const handleQuery = async (reset = false) => {
let params = Object.assign(state.queryParams, state.tableParams, tableParams); await xGrid.value?.commitProxy('query');
return getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)PagePost(params);
}; };
// 重置操作 // 重置操作
const resetQuery = () => { const resetQuery = async () => {
state.queryParams.searchKey = undefined,
@if(Model.QueryWhetherList.Count > 0) { @if(Model.QueryWhetherList.Count > 0) {
@foreach (var column in Model.QueryWhetherList) { @foreach (var column in Model.QueryWhetherList) {
@:state.queryParams.@(@column.LowerPropertyName) = undefined, @:state.queryParams.@(@column.LowerPropertyName) = undefined,
} }
} }
handleQuery(true); await xGrid.value?.commitProxy('reload');
};
// 改变页码序号或页面容量
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
state.tableParams.page = currentPage;
state.tableParams.pageSize = pageSize;
handleQuery();
};
// 列排序
const sortChange = (options: any) => {
state.tableParams.field = options.field;
state.tableParams.order = options.order;
handleQuery();
}; };
// 打开新增页面 // 打开新增页面
@ -354,7 +364,11 @@ const handleEdit = (row: any) => {
const handlePrint = async (row: any) => { const handlePrint = async (row: any) => {
state.title = '打印@(@Model.BusName)'; state.title = '打印@(@Model.BusName)';
@if(@Model.PrintType == "custom"){ @if(@Model.PrintType == "custom"){
if (@Model.IsApiService) {
@:var res = await getAPI(SysPrintApi).apiSysPrintPrintNameGet('@Model.PrintName'); @:var res = await getAPI(SysPrintApi).apiSysPrintPrintNameGet('@Model.PrintName');
} else {
@:var res = await getPrint@(@Model.ClassName)(row);
}
@:var printTemplate = res.data.result as SysPrint; @:var printTemplate = res.data.result as SysPrint;
@:var template = JSON.parse(printTemplate.template); @:var template = JSON.parse(printTemplate.template);
@:var width = template.panels[0].width; @:var width = template.panels[0].width;
@ -375,13 +389,31 @@ const handleDelete = (row: any) => {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(async () => { }).then(async () => {
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DeletePost({ id: row.id }); @if (@Model.IsApiService) {
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DeletePost({ id: row.id });
} else {
@:await delete@(@Model.ClassName)(row);
}
handleQuery(); handleQuery();
ElMessage.success('删除成功'); ElMessage.success('删除成功');
}) })
.catch(() => {}); .catch(() => {});
}; };
// 表格事件
const gridEvents: VxeGridListeners<@(@Model.ClassName)> = {
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
async pageChange({ pageSize }) {
state.localPageParam.pageSize = pageSize;
Local.set(localPageParamKey, state.localPageParam);
},
// 当排序条件发生变化时会触发该事件
async sortChange({ field, order }) {
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
Local.set(localPageParamKey, state.localPageParam);
},
};
@foreach (var column in Model.QueryWhetherList) { @foreach (var column in Model.QueryWhetherList) {
@if(@column.EffectType == "fk") { @if(@column.EffectType == "fk") {
@:const @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList = ref<any>([]); @:const @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList = ref<any>([]);

View File

@ -36,10 +36,12 @@ public class DingTalkConst
/// 主部门Id /// 主部门Id
/// </summary> /// </summary>
public const string DeptId = "sys00-mainDeptId"; public const string DeptId = "sys00-mainDeptId";
/// <summary> /// <summary>
/// 主部门 /// 主部门
/// </summary> /// </summary>
public const string Dept = "sys00-mainDept"; public const string Dept = "sys00-mainDept";
/// <summary> /// <summary>
/// 职位 /// 职位
/// </summary> /// </summary>

View File

@ -73,23 +73,25 @@ public class DingTalkUser : EntityBase
[SugarColumn(ColumnDescription = "工号", Length = 16)] [SugarColumn(ColumnDescription = "工号", Length = 16)]
[MaxLength(16)] [MaxLength(16)]
public string? JobNumber { get; set; } public string? JobNumber { get; set; }
/// <summary> /// <summary>
/// 主部门Id /// 主部门Id
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "主部门Id", Length = 16)] [SugarColumn(ColumnDescription = "主部门Id", Length = 16)]
[MaxLength(16)] [MaxLength(16)]
public string? DeptId { get; set; } public string? DeptId { get; set; }
/// <summary> /// <summary>
/// 主部门 /// 主部门
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "主部门", Length = 16)] [SugarColumn(ColumnDescription = "主部门", Length = 16)]
[MaxLength(16)] [MaxLength(16)]
public string? Dept { get; set; } public string? Dept { get; set; }
/// <summary> /// <summary>
/// 职位 /// 职位
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "职位", Length = 16)] [SugarColumn(ColumnDescription = "职位", Length = 16)]
[MaxLength(16)] [MaxLength(16)]
public string? Position { get; set; } public string? Position { get; set; }
} }

View File

@ -43,7 +43,7 @@ public class DingTalkService : IDynamicApiController, IScoped
/// <param name="access_token"></param> /// <param name="access_token"></param>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
[DisplayName("获取在职员工列表")] [HttpPost, DisplayName("获取在职员工列表")]
public async Task<DingTalkBaseResponse<GetDingTalkCurrentEmployeesListOutput>> GetDingTalkCurrentEmployeesList(string access_token, [Required] GetDingTalkCurrentEmployeesListInput input) public async Task<DingTalkBaseResponse<GetDingTalkCurrentEmployeesListOutput>> GetDingTalkCurrentEmployeesList(string access_token, [Required] GetDingTalkCurrentEmployeesListInput input)
{ {
return await _dingTalkApi.GetDingTalkCurrentEmployeesList(access_token, input); return await _dingTalkApi.GetDingTalkCurrentEmployeesList(access_token, input);
@ -55,7 +55,7 @@ public class DingTalkService : IDynamicApiController, IScoped
/// <param name="access_token"></param> /// <param name="access_token"></param>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
[DisplayName("获取员工花名册字段信息")] [HttpPost, DisplayName("获取员工花名册字段信息")]
public async Task<DingTalkBaseResponse<List<DingTalkEmpRosterFieldVo>>> GetDingTalkCurrentEmployeesRosterList(string access_token, [Required] GetDingTalkCurrentEmployeesRosterListInput input) public async Task<DingTalkBaseResponse<List<DingTalkEmpRosterFieldVo>>> GetDingTalkCurrentEmployeesRosterList(string access_token, [Required] GetDingTalkCurrentEmployeesRosterListInput input)
{ {
return await _dingTalkApi.GetDingTalkCurrentEmployeesRosterList(access_token, input); return await _dingTalkApi.GetDingTalkCurrentEmployeesRosterList(access_token, input);

View File

@ -1,4 +1,4 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 // Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
// //
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 // 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
// //
@ -10,6 +10,7 @@ namespace Admin.NET.Plugin.GoView;
/// GoView 项目表 /// GoView 项目表
/// </summary> /// </summary>
[SugarTable(null, "GoView 项目表")] [SugarTable(null, "GoView 项目表")]
[SysTable]
public class GoViewPro : EntityTenant public class GoViewPro : EntityTenant
{ {
/// <summary> /// <summary>

View File

@ -10,6 +10,7 @@ namespace Admin.NET.Plugin.GoView;
/// GoView 项目数据表 /// GoView 项目数据表
/// </summary> /// </summary>
[SugarTable(null, "GoView 项目数据表")] [SugarTable(null, "GoView 项目数据表")]
[SysTable]
public class GoViewProData : EntityTenant public class GoViewProData : EntityTenant
{ {
/// <summary> /// <summary>

View File

@ -24,7 +24,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Rezero.Api" Version="1.7.8" /> <PackageReference Include="Rezero.Api" Version="1.7.9" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -12,7 +12,7 @@ if exist %apiServicesPath% (
echo ================================ 开始生成 api-services ================================ echo ================================ 开始生成 api-services ================================
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%%20Groups/swagger.json -l typescript-axios -o %apiServicesPath% java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/Default/swagger.json -l typescript-axios -o %apiServicesPath%
@rem 删除不必要的文件和文件夹 @rem 删除不必要的文件和文件夹
rd /s /q %apiServicesPath%.swagger-codegen rd /s /q %apiServicesPath%.swagger-codegen

View File

@ -14,7 +14,7 @@ fi
echo "================================ 开始生成 api-services ================================" echo "================================ 开始生成 api-services ================================"
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}" java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/Default/swagger.json -l typescript-axios -o "${apiServicesPath}"
rm -rf "${apiServicesPath}".swagger-codegen rm -rf "${apiServicesPath}".swagger-codegen
rm -f "${apiServicesPath}".gitignore rm -f "${apiServicesPath}".gitignore

View File

@ -0,0 +1,27 @@
@echo off
CHCP 65001
set dir=%~dp0
set apiServicesPath=%dir%..\src\api-services\
if exist %apiServicesPath% (
echo ================================ 删除目录 api-services ================================
rd /s /q %apiServicesPath%
)
echo ================================ 开始生成 api-services ================================
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o %apiServicesPath%
@rem 删除不必要的文件和文件夹
rd /s /q %apiServicesPath%.swagger-codegen
del /q %apiServicesPath%.gitignore
del /q %apiServicesPath%.npmignore
del /q %apiServicesPath%.swagger-codegen-ignore
del /q %apiServicesPath%git_push.sh
del /q %apiServicesPath%package.json
del /q %apiServicesPath%README.md
del /q %apiServicesPath%tsconfig.json
echo ================================ 生成结束 ================================

View File

@ -0,0 +1,28 @@
#!/bin/sh
currPath=$(pwd)
parentPath=$(dirname "$currPath")
apiServicesPath=${parentPath}/src/api-services/
echo "================================ 生成目录 ${apiServicesPath} ================================"
# 判断目录是否存在
if test -d "$apiServicesPath"; then
echo "================================ 删除目录 api-services ================================"
rm -rf "${apiServicesPath}"
fi
echo "================================ 开始生成 api-services ================================"
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
rm -rf "${apiServicesPath}".swagger-codegen
rm -f "${apiServicesPath}".gitignore
rm -f "${apiServicesPath}".npmignore
rm -f "${apiServicesPath}".swagger-codegen-ignore
rm -f "${apiServicesPath}"git_push.sh
rm -f "${apiServicesPath}"package.json
rm -f "${apiServicesPath}"README.md
rm -f "${apiServicesPath}"tsconfig.json
echo "================================ 生成结束 ================================"

View File

@ -0,0 +1,27 @@
@echo off
CHCP 65001
set dir=%~dp0
set apiServicesPath=%dir%..\src\api-services\_approvalFlow
if exist %apiServicesPath% (
echo ================================ 删除目录 api-services ================================
rd /s /q %apiServicesPath%
)
echo ================================ 开始生成 api-services ================================
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/ApprovalFlow/swagger.json -l typescript-axios -o %apiServicesPath%
@rem 删除不必要的文件和文件夹
rd /s /q %apiServicesPath%.swagger-codegen
del /q %apiServicesPath%.gitignore
del /q %apiServicesPath%.npmignore
del /q %apiServicesPath%.swagger-codegen-ignore
del /q %apiServicesPath%git_push.sh
del /q %apiServicesPath%package.json
del /q %apiServicesPath%README.md
del /q %apiServicesPath%tsconfig.json
echo ================================ 生成结束 ================================

View File

@ -0,0 +1,28 @@
#!/bin/sh
currPath=$(pwd)
parentPath=$(dirname "$currPath")
apiServicesPath=${parentPath}/src/api-services/_approvalFlow
echo "================================ 生成目录 ${apiServicesPath} ================================"
# 判断目录是否存在
if test -d "$apiServicesPath"; then
echo "================================ 删除目录 api-services ================================"
rm -rf "${apiServicesPath}"
fi
echo "================================ 开始生成 api-services ================================"
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/ApprovalFlow/swagger.json -l typescript-axios -o "${apiServicesPath}"
rm -rf "${apiServicesPath}".swagger-codegen
rm -f "${apiServicesPath}".gitignore
rm -f "${apiServicesPath}".npmignore
rm -f "${apiServicesPath}".swagger-codegen-ignore
rm -f "${apiServicesPath}"git_push.sh
rm -f "${apiServicesPath}"package.json
rm -f "${apiServicesPath}"README.md
rm -f "${apiServicesPath}"tsconfig.json
echo "================================ 生成结束 ================================"

View File

@ -0,0 +1,27 @@
@echo off
CHCP 65001
set dir=%~dp0
set apiServicesPath=%dir%..\src\api-services\_goView
if exist %apiServicesPath% (
echo ================================ 删除目录 api-services ================================
rd /s /q %apiServicesPath%
)
echo ================================ 开始生成 api-services ================================
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/GoView/swagger.json -l typescript-axios -o %apiServicesPath%
@rem 删除不必要的文件和文件夹
rd /s /q %apiServicesPath%.swagger-codegen
del /q %apiServicesPath%.gitignore
del /q %apiServicesPath%.npmignore
del /q %apiServicesPath%.swagger-codegen-ignore
del /q %apiServicesPath%git_push.sh
del /q %apiServicesPath%package.json
del /q %apiServicesPath%README.md
del /q %apiServicesPath%tsconfig.json
echo ================================ 生成结束 ================================

View File

@ -0,0 +1,28 @@
#!/bin/sh
currPath=$(pwd)
parentPath=$(dirname "$currPath")
apiServicesPath=${parentPath}/src/api-services/_goView
echo "================================ 生成目录 ${apiServicesPath} ================================"
# 判断目录是否存在
if test -d "$apiServicesPath"; then
echo "================================ 删除目录 api-services ================================"
rm -rf "${apiServicesPath}"
fi
echo "================================ 开始生成 api-services ================================"
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
rm -rf "${apiServicesPath}".swagger-codegen
rm -f "${apiServicesPath}".gitignore
rm -f "${apiServicesPath}".npmignore
rm -f "${apiServicesPath}".swagger-codegen-ignore
rm -f "${apiServicesPath}"git_push.sh
rm -f "${apiServicesPath}"package.json
rm -f "${apiServicesPath}"README.md
rm -f "${apiServicesPath}"tsconfig.json
echo "================================ 生成结束 ================================"

View File

@ -0,0 +1,27 @@
@echo off
CHCP 65001
set dir=%~dp0
set apiServicesPath=%dir%..\src\api-services\_goView
if exist %apiServicesPath% (
echo ================================ 删除目录 api-services ================================
rd /s /q %apiServicesPath%
)
echo ================================ 开始生成 api-services ================================
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/GoView/swagger.json -l typescript-axios -o %apiServicesPath%
@rem 删除不必要的文件和文件夹
rd /s /q %apiServicesPath%.swagger-codegen
del /q %apiServicesPath%.gitignore
del /q %apiServicesPath%.npmignore
del /q %apiServicesPath%.swagger-codegen-ignore
del /q %apiServicesPath%git_push.sh
del /q %apiServicesPath%package.json
del /q %apiServicesPath%README.md
del /q %apiServicesPath%tsconfig.json
echo ================================ 生成结束 ================================

View File

@ -0,0 +1,28 @@
#!/bin/sh
currPath=$(pwd)
parentPath=$(dirname "$currPath")
apiServicesPath=${parentPath}/src/api-services/_dingTalk
echo "================================ 生成目录 ${apiServicesPath} ================================"
# 判断目录是否存在
if test -d "$apiServicesPath"; then
echo "================================ 删除目录 api-services ================================"
rm -rf "${apiServicesPath}"
fi
echo "================================ 开始生成 api-services ================================"
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/DingTalk/swagger.json -l typescript-axios -o "${apiServicesPath}"
rm -rf "${apiServicesPath}".swagger-codegen
rm -f "${apiServicesPath}".gitignore
rm -f "${apiServicesPath}".npmignore
rm -f "${apiServicesPath}".swagger-codegen-ignore
rm -f "${apiServicesPath}"git_push.sh
rm -f "${apiServicesPath}"package.json
rm -f "${apiServicesPath}"README.md
rm -f "${apiServicesPath}"tsconfig.json
echo "================================ 生成结束 ================================"

View File

@ -2,7 +2,7 @@
"name": "admin.net.pro", "name": "admin.net.pro",
"type": "module", "type": "module",
"version": "2.4.33", "version": "2.4.33",
"lastBuildTime": "2024.07.09", "lastBuildTime": "2024.07.14",
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架", "description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
"author": "zuohuaijun", "author": "zuohuaijun",
"license": "MIT", "license": "MIT",
@ -16,7 +16,7 @@
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
"@logicflow/core": "^1.2.27", "@logicflow/core": "^1.2.27",
"@logicflow/extension": "^1.2.27", "@logicflow/extension": "^1.2.27",
"@microsoft/signalr": "^8.0.0", "@microsoft/signalr": "^8.0.7",
"@vue-office/docx": "^1.6.2", "@vue-office/docx": "^1.6.2",
"@vue-office/excel": "^1.7.8", "@vue-office/excel": "^1.7.8",
"@vue-office/pdf": "^2.0.2", "@vue-office/pdf": "^2.0.2",
@ -31,7 +31,7 @@
"echarts": "^5.5.1", "echarts": "^5.5.1",
"echarts-gl": "^2.0.9", "echarts-gl": "^2.0.9",
"echarts-wordcloud": "^2.1.0", "echarts-wordcloud": "^2.1.0",
"element-plus": "^2.7.6", "element-plus": "^2.7.7",
"exceljs": "^4.4.0", "exceljs": "^4.4.0",
"ezuikit": "^1.0.0", "ezuikit": "^1.0.0",
"ezuikit-js": "^8.0.5", "ezuikit-js": "^8.0.5",
@ -49,10 +49,10 @@
"print-js": "^1.6.0", "print-js": "^1.6.0",
"push.js": "^1.0.12", "push.js": "^1.0.12",
"qrcodejs2-fixes": "^0.0.2", "qrcodejs2-fixes": "^0.0.2",
"qs": "^6.12.2", "qs": "^6.12.3",
"relation-graph": "^2.2.2", "relation-graph": "^2.2.2",
"screenfull": "^6.0.2", "screenfull": "^6.0.2",
"sm-crypto-v2": "^1.9.0", "sm-crypto-v2": "^1.9.1",
"sortablejs": "^1.15.2", "sortablejs": "^1.15.2",
"splitpanes": "^3.1.5", "splitpanes": "^3.1.5",
"vcrontab-3": "^3.3.22", "vcrontab-3": "^3.3.22",
@ -68,8 +68,8 @@
"vue-signature-pad": "^3.0.2", "vue-signature-pad": "^3.0.2",
"vue3-tree-org": "^4.2.2", "vue3-tree-org": "^4.2.2",
"vuedraggable": "4.0.3", "vuedraggable": "4.0.3",
"vxe-pc-ui": "^4.0.51", "vxe-pc-ui": "^4.0.67",
"vxe-table": "^4.7.45", "vxe-table": "^4.7.50",
"vxe-table-plugin-element": "^4.0.4", "vxe-table-plugin-element": "^4.0.4",
"vxe-table-plugin-export-xlsx": "^4.0.5", "vxe-table-plugin-export-xlsx": "^4.0.5",
"xe-utils": "^3.5.28", "xe-utils": "^3.5.28",
@ -88,13 +88,13 @@
"@vitejs/plugin-vue-jsx": "^4.0.0", "@vitejs/plugin-vue-jsx": "^4.0.0",
"@vue/compiler-sfc": "^3.4.31", "@vue/compiler-sfc": "^3.4.31",
"code-inspector-plugin": "^0.14.2", "code-inspector-plugin": "^0.14.2",
"eslint": "^9.6.0", "eslint": "^9.7.0",
"eslint-plugin-vue": "^9.27.0", "eslint-plugin-vue": "^9.27.0",
"less": "^4.2.0", "less": "^4.2.0",
"prettier": "^3.3.2", "prettier": "^3.3.3",
"rollup-plugin-visualizer": "^5.12.0", "rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.77.6", "sass": "^1.77.8",
"terser": "^5.31.1", "terser": "^5.31.2",
"typescript": "^5.5.3", "typescript": "^5.5.3",
"vite": "^5.3.3", "vite": "^5.3.3",
"vite-plugin-cdn-import": "^1.0.1", "vite-plugin-cdn-import": "^1.0.1",

View File

@ -26,8 +26,8 @@ import { AdminResultListTableOutput } from '../models';
import { AdminResultObject } from '../models'; import { AdminResultObject } from '../models';
import { AdminResultSqlSugarPagedListSysCodeGen } from '../models'; import { AdminResultSqlSugarPagedListSysCodeGen } from '../models';
import { AdminResultSysCodeGen } from '../models'; import { AdminResultSysCodeGen } from '../models';
import { CodeGenInput } from '../models';
import { DeleteCodeGenInput } from '../models'; import { DeleteCodeGenInput } from '../models';
import { PageCodeGenInput } from '../models';
import { SysCodeGen } from '../models'; import { SysCodeGen } from '../models';
import { UpdateCodeGenInput } from '../models'; import { UpdateCodeGenInput } from '../models';
/** /**
@ -328,11 +328,11 @@ export const SysCodeGenApiAxiosParamCreator = function (configuration?: Configur
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {CodeGenInput} [body] * @param {PageCodeGenInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
apiSysCodeGenPagePost: async (body?: CodeGenInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { apiSysCodeGenPagePost: async (body?: PageCodeGenInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysCodeGen/page`; const localVarPath = `/api/sysCodeGen/page`;
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com'); const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@ -661,11 +661,11 @@ export const SysCodeGenApiFp = function(configuration?: Configuration) {
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {CodeGenInput} [body] * @param {PageCodeGenInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysCodeGenPagePost(body?: CodeGenInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>>> { async apiSysCodeGenPagePost(body?: PageCodeGenInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>>> {
const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenPagePost(body, options); const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenPagePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@ -799,11 +799,11 @@ export const SysCodeGenApiFactory = function (configuration?: Configuration, bas
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {CodeGenInput} [body] * @param {PageCodeGenInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysCodeGenPagePost(body?: CodeGenInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>> { async apiSysCodeGenPagePost(body?: PageCodeGenInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>> {
return SysCodeGenApiFp(configuration).apiSysCodeGenPagePost(body, options).then((request) => request(axios, basePath)); return SysCodeGenApiFp(configuration).apiSysCodeGenPagePost(body, options).then((request) => request(axios, basePath));
}, },
/** /**
@ -924,12 +924,12 @@ export class SysCodeGenApi extends BaseAPI {
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {CodeGenInput} [body] * @param {PageCodeGenInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
* @memberof SysCodeGenApi * @memberof SysCodeGenApi
*/ */
public async apiSysCodeGenPagePost(body?: CodeGenInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>> { public async apiSysCodeGenPagePost(body?: PageCodeGenInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>> {
return SysCodeGenApiFp(this.configuration).apiSysCodeGenPagePost(body, options).then((request) => request(this.axios, this.basePath)); return SysCodeGenApiFp(this.configuration).apiSysCodeGenPagePost(body, options).then((request) => request(this.axios, this.basePath));
} }
/** /**

View File

@ -17,6 +17,7 @@ import { Configuration } from '../configuration';
// Some imports not used depending on template conditions // Some imports not used depending on template conditions
// @ts-ignore // @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { AdminResultIActionResult } from '../models';
import { AdminResultListApiOutput } from '../models'; import { AdminResultListApiOutput } from '../models';
import { AdminResultSmKeyPairOutput } from '../models'; import { AdminResultSmKeyPairOutput } from '../models';
import { AdminResultString } from '../models'; import { AdminResultString } from '../models';
@ -74,6 +75,54 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura
options: localVarRequestOptions, options: localVarRequestOptions,
}; };
}, },
/**
*
* @summary Excel
* @param {string} [fileName]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysCommonDownloadErrorExcelTempPost: async (fileName?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysCommon/downloadErrorExcelTemp`;
// 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;
}
if (fileName !== undefined) {
localVarQueryParameter['fileName'] = fileName;
}
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加密字符串 🏆 * @summary MD5加密字符串 🏆
@ -195,6 +244,20 @@ export const SysCommonApiFp = function(configuration?: Configuration) {
return axios.request(axiosRequestArgs); return axios.request(axiosRequestArgs);
}; };
}, },
/**
*
* @summary Excel
* @param {string} [fileName]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysCommonDownloadErrorExcelTempPost(fileName?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultIActionResult>>> {
const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonDownloadErrorExcelTempPost(fileName, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/** /**
* *
* @summary MD5加密字符串 🏆 * @summary MD5加密字符串 🏆
@ -242,6 +305,16 @@ export const SysCommonApiFactory = function (configuration?: Configuration, base
async apiSysCommonApiListGet(groupName?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListApiOutput>> { async apiSysCommonApiListGet(groupName?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListApiOutput>> {
return SysCommonApiFp(configuration).apiSysCommonApiListGet(groupName, options).then((request) => request(axios, basePath)); return SysCommonApiFp(configuration).apiSysCommonApiListGet(groupName, options).then((request) => request(axios, basePath));
}, },
/**
*
* @summary Excel
* @param {string} [fileName]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysCommonDownloadErrorExcelTempPost(fileName?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultIActionResult>> {
return SysCommonApiFp(configuration).apiSysCommonDownloadErrorExcelTempPost(fileName, options).then((request) => request(axios, basePath));
},
/** /**
* *
* @summary MD5加密字符串 🏆 * @summary MD5加密字符串 🏆
@ -283,6 +356,17 @@ export class SysCommonApi extends BaseAPI {
public async apiSysCommonApiListGet(groupName?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListApiOutput>> { public async apiSysCommonApiListGet(groupName?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListApiOutput>> {
return SysCommonApiFp(this.configuration).apiSysCommonApiListGet(groupName, options).then((request) => request(this.axios, this.basePath)); return SysCommonApiFp(this.configuration).apiSysCommonApiListGet(groupName, options).then((request) => request(this.axios, this.basePath));
} }
/**
*
* @summary Excel
* @param {string} [fileName]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysCommonApi
*/
public async apiSysCommonDownloadErrorExcelTempPost(fileName?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultIActionResult>> {
return SysCommonApiFp(this.configuration).apiSysCommonDownloadErrorExcelTempPost(fileName, options).then((request) => request(this.axios, this.basePath));
}
/** /**
* *
* @summary MD5加密字符串 🏆 * @summary MD5加密字符串 🏆

View File

@ -23,8 +23,8 @@ import { AdminResultListSysLdap } from '../models';
import { AdminResultSqlSugarPagedListSysLdap } from '../models'; import { AdminResultSqlSugarPagedListSysLdap } from '../models';
import { AdminResultSysLdap } from '../models'; import { AdminResultSysLdap } from '../models';
import { DeleteSysLdapInput } from '../models'; import { DeleteSysLdapInput } from '../models';
import { PageSysLdapInput } from '../models';
import { SyncSysLdapInput } from '../models'; import { SyncSysLdapInput } from '../models';
import { SysLdapInput } from '../models';
import { UpdateSysLdapInput } from '../models'; import { UpdateSysLdapInput } from '../models';
/** /**
* SysLdapApi - axios parameter creator * SysLdapApi - axios parameter creator
@ -226,11 +226,11 @@ export const SysLdapApiAxiosParamCreator = function (configuration?: Configurati
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {SysLdapInput} [body] * @param {PageSysLdapInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
apiSysLdapPagePost: async (body?: SysLdapInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { apiSysLdapPagePost: async (body?: PageSysLdapInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysLdap/page`; const localVarPath = `/api/sysLdap/page`;
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com'); const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@ -482,11 +482,11 @@ export const SysLdapApiFp = function(configuration?: Configuration) {
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {SysLdapInput} [body] * @param {PageSysLdapInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysLdapPagePost(body?: SysLdapInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>>> { async apiSysLdapPagePost(body?: PageSysLdapInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>>> {
const localVarAxiosArgs = await SysLdapApiAxiosParamCreator(configuration).apiSysLdapPagePost(body, options); const localVarAxiosArgs = await SysLdapApiAxiosParamCreator(configuration).apiSysLdapPagePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@ -586,11 +586,11 @@ export const SysLdapApiFactory = function (configuration?: Configuration, basePa
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {SysLdapInput} [body] * @param {PageSysLdapInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysLdapPagePost(body?: SysLdapInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>> { async apiSysLdapPagePost(body?: PageSysLdapInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>> {
return SysLdapApiFp(configuration).apiSysLdapPagePost(body, options).then((request) => request(axios, basePath)); return SysLdapApiFp(configuration).apiSysLdapPagePost(body, options).then((request) => request(axios, basePath));
}, },
/** /**
@ -679,12 +679,12 @@ export class SysLdapApi extends BaseAPI {
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {SysLdapInput} [body] * @param {PageSysLdapInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
* @memberof SysLdapApi * @memberof SysLdapApi
*/ */
public async apiSysLdapPagePost(body?: SysLdapInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>> { public async apiSysLdapPagePost(body?: PageSysLdapInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>> {
return SysLdapApiFp(this.configuration).apiSysLdapPagePost(body, options).then((request) => request(this.axios, this.basePath)); return SysLdapApiFp(this.configuration).apiSysLdapPagePost(body, options).then((request) => request(this.axios, this.basePath));
} }
/** /**

View File

@ -22,6 +22,9 @@ import { AdminResultListSysNotice } from '../models';
import { AdminResultSqlSugarPagedListSysNotice } from '../models'; import { AdminResultSqlSugarPagedListSysNotice } from '../models';
import { AdminResultSqlSugarPagedListSysNoticeUser } from '../models'; import { AdminResultSqlSugarPagedListSysNoticeUser } from '../models';
import { DeleteNoticeInput } from '../models'; import { DeleteNoticeInput } from '../models';
import { Filter } from '../models';
import { FilterLogicEnum } from '../models';
import { FilterOperatorEnum } from '../models';
import { NoticeInput } from '../models'; import { NoticeInput } from '../models';
import { NoticeTypeEnum } from '../models'; import { NoticeTypeEnum } from '../models';
import { PageNoticeInput } from '../models'; import { PageNoticeInput } from '../models';
@ -186,10 +189,18 @@ export const SysNoticeApiAxiosParamCreator = function (configuration?: Configura
* @param {string} [field] * @param {string} [field]
* @param {string} [order] * @param {string} [order]
* @param {string} [descStr] * @param {string} [descStr]
* @param {Array<string>} [searchFields]
* @param {string} [searchKeyword]
* @param {string} [keyword]
* @param {FilterLogicEnum} [filterLogic]
* @param {Array<Filter>} [filterFilters]
* @param {string} [filterField]
* @param {FilterOperatorEnum} [filterOperator]
* @param {any} [filterValue]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
apiSysNoticePageReceivedGet: async (title?: string, type?: NoticeTypeEnum, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { apiSysNoticePageReceivedGet: async (title?: string, type?: NoticeTypeEnum, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array<string>, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array<Filter>, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysNotice/pageReceived`; const localVarPath = `/api/sysNotice/pageReceived`;
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com'); const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@ -238,6 +249,38 @@ export const SysNoticeApiAxiosParamCreator = function (configuration?: Configura
localVarQueryParameter['DescStr'] = descStr; 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); const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) { for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]); query.set(key, localVarQueryParameter[key]);
@ -502,11 +545,19 @@ export const SysNoticeApiFp = function(configuration?: Configuration) {
* @param {string} [field] * @param {string} [field]
* @param {string} [order] * @param {string} [order]
* @param {string} [descStr] * @param {string} [descStr]
* @param {Array<string>} [searchFields]
* @param {string} [searchKeyword]
* @param {string} [keyword]
* @param {FilterLogicEnum} [filterLogic]
* @param {Array<Filter>} [filterFilters]
* @param {string} [filterField]
* @param {FilterOperatorEnum} [filterOperator]
* @param {any} [filterValue]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysNoticePageReceivedGet(title?: string, type?: NoticeTypeEnum, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysNoticeUser>>> { async apiSysNoticePageReceivedGet(title?: string, type?: NoticeTypeEnum, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array<string>, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array<Filter>, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysNoticeUser>>> {
const localVarAxiosArgs = await SysNoticeApiAxiosParamCreator(configuration).apiSysNoticePageReceivedGet(title, type, page, pageSize, field, order, descStr, options); const localVarAxiosArgs = await SysNoticeApiAxiosParamCreator(configuration).apiSysNoticePageReceivedGet(title, type, page, pageSize, field, order, descStr, searchFields, searchKeyword, keyword, filterLogic, filterFilters, filterField, filterOperator, filterValue, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs); return axios.request(axiosRequestArgs);
@ -616,11 +667,19 @@ export const SysNoticeApiFactory = function (configuration?: Configuration, base
* @param {string} [field] * @param {string} [field]
* @param {string} [order] * @param {string} [order]
* @param {string} [descStr] * @param {string} [descStr]
* @param {Array<string>} [searchFields]
* @param {string} [searchKeyword]
* @param {string} [keyword]
* @param {FilterLogicEnum} [filterLogic]
* @param {Array<Filter>} [filterFilters]
* @param {string} [filterField]
* @param {FilterOperatorEnum} [filterOperator]
* @param {any} [filterValue]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysNoticePageReceivedGet(title?: string, type?: NoticeTypeEnum, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysNoticeUser>> { async apiSysNoticePageReceivedGet(title?: string, type?: NoticeTypeEnum, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array<string>, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array<Filter>, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysNoticeUser>> {
return SysNoticeApiFp(configuration).apiSysNoticePageReceivedGet(title, type, page, pageSize, field, order, descStr, options).then((request) => request(axios, basePath)); return SysNoticeApiFp(configuration).apiSysNoticePageReceivedGet(title, type, page, pageSize, field, order, descStr, searchFields, searchKeyword, keyword, filterLogic, filterFilters, filterField, filterOperator, filterValue, options).then((request) => request(axios, basePath));
}, },
/** /**
* *
@ -714,12 +773,20 @@ export class SysNoticeApi extends BaseAPI {
* @param {string} [field] * @param {string} [field]
* @param {string} [order] * @param {string} [order]
* @param {string} [descStr] * @param {string} [descStr]
* @param {Array<string>} [searchFields]
* @param {string} [searchKeyword]
* @param {string} [keyword]
* @param {FilterLogicEnum} [filterLogic]
* @param {Array<Filter>} [filterFilters]
* @param {string} [filterField]
* @param {FilterOperatorEnum} [filterOperator]
* @param {any} [filterValue]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
* @memberof SysNoticeApi * @memberof SysNoticeApi
*/ */
public async apiSysNoticePageReceivedGet(title?: string, type?: NoticeTypeEnum, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysNoticeUser>> { public async apiSysNoticePageReceivedGet(title?: string, type?: NoticeTypeEnum, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array<string>, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array<Filter>, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysNoticeUser>> {
return SysNoticeApiFp(this.configuration).apiSysNoticePageReceivedGet(title, type, page, pageSize, field, order, descStr, options).then((request) => request(this.axios, this.basePath)); return SysNoticeApiFp(this.configuration).apiSysNoticePageReceivedGet(title, type, page, pageSize, field, order, descStr, searchFields, searchKeyword, keyword, filterLogic, filterFilters, filterField, filterOperator, filterValue, options).then((request) => request(this.axios, this.basePath));
} }
/** /**
* *

View File

@ -22,7 +22,7 @@ import { AdminResultSqlSugarPagedListOpenAccessOutput } from '../models';
import { AdminResultString } from '../models'; import { AdminResultString } from '../models';
import { DeleteOpenAccessInput } from '../models'; import { DeleteOpenAccessInput } from '../models';
import { GenerateSignatureInput } from '../models'; import { GenerateSignatureInput } from '../models';
import { OpenAccessInput } from '../models'; import { PageOpenAccessInput } from '../models';
import { UpdateOpenAccessInput } from '../models'; import { UpdateOpenAccessInput } from '../models';
/** /**
* SysOpenAccessApi - axios parameter creator * SysOpenAccessApi - axios parameter creator
@ -177,11 +177,11 @@ export const SysOpenAccessApiAxiosParamCreator = function (configuration?: Confi
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {OpenAccessInput} [body] * @param {PageOpenAccessInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
apiSysOpenAccessPagePost: async (body?: OpenAccessInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { apiSysOpenAccessPagePost: async (body?: PageOpenAccessInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysOpenAccess/page`; const localVarPath = `/api/sysOpenAccess/page`;
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com'); const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@ -367,11 +367,11 @@ export const SysOpenAccessApiFp = function(configuration?: Configuration) {
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {OpenAccessInput} [body] * @param {PageOpenAccessInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysOpenAccessPagePost(body?: OpenAccessInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>>> { async apiSysOpenAccessPagePost(body?: PageOpenAccessInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>>> {
const localVarAxiosArgs = await SysOpenAccessApiAxiosParamCreator(configuration).apiSysOpenAccessPagePost(body, options); const localVarAxiosArgs = await SysOpenAccessApiAxiosParamCreator(configuration).apiSysOpenAccessPagePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@ -447,11 +447,11 @@ export const SysOpenAccessApiFactory = function (configuration?: Configuration,
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {OpenAccessInput} [body] * @param {PageOpenAccessInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysOpenAccessPagePost(body?: OpenAccessInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>> { async apiSysOpenAccessPagePost(body?: PageOpenAccessInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>> {
return SysOpenAccessApiFp(configuration).apiSysOpenAccessPagePost(body, options).then((request) => request(axios, basePath)); return SysOpenAccessApiFp(configuration).apiSysOpenAccessPagePost(body, options).then((request) => request(axios, basePath));
}, },
/** /**
@ -519,12 +519,12 @@ export class SysOpenAccessApi extends BaseAPI {
/** /**
* *
* @summary 🔖 * @summary 🔖
* @param {OpenAccessInput} [body] * @param {PageOpenAccessInput} [body]
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
* @memberof SysOpenAccessApi * @memberof SysOpenAccessApi
*/ */
public async apiSysOpenAccessPagePost(body?: OpenAccessInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>> { public async apiSysOpenAccessPagePost(body?: PageOpenAccessInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>> {
return SysOpenAccessApiFp(this.configuration).apiSysOpenAccessPagePost(body, options).then((request) => request(this.axios, this.basePath)); return SysOpenAccessApiFp(this.configuration).apiSysOpenAccessPagePost(body, options).then((request) => request(this.axios, this.basePath));
} }
/** /**

View File

@ -17,9 +17,14 @@ import { Configuration } from '../configuration';
// Some imports not used depending on template conditions // Some imports not used depending on template conditions
// @ts-ignore // @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { AdminResultCreatePayTransactionOutput } from '../models';
import { AdminResultGetRefundDomesticRefundByOutRefundNumberResponse } from '../models';
import { AdminResultObject } from '../models'; import { AdminResultObject } from '../models';
import { AdminResultSqlSugarPagedListSysWechatPay } from '../models';
import { AdminResultSysWechatPay } from '../models'; import { AdminResultSysWechatPay } from '../models';
import { AdminResultWechatPayOutput } from '../models'; import { AdminResultWechatPayOutput } from '../models';
import { PageSysWechatPayInput } from '../models';
import { RefundRequestInput } from '../models';
import { WechatPayParaInput } from '../models'; import { WechatPayParaInput } from '../models';
import { WechatPayTransactionInput } from '../models'; import { WechatPayTransactionInput } from '../models';
/** /**
@ -76,6 +81,54 @@ export const SysWechatPayApiAxiosParamCreator = function (configuration?: Config
options: localVarRequestOptions, options: localVarRequestOptions,
}; };
}, },
/**
*
* @summary ()
* @param {PageSysWechatPayInput} [body] PageSysWechatPayInput
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysWechatPayPagePost: async (body?: PageSysWechatPayInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysWechatPay/page`;
// 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 () 🔖 * @summary () 🔖
@ -259,6 +312,104 @@ export const SysWechatPayApiAxiosParamCreator = function (configuration?: Config
options: localVarRequestOptions, options: localVarRequestOptions,
}; };
}, },
/**
*
* @summary () https://api.mch.weixin.qq.com/v3/pay/transactions/id/{transaction_id}
* @param {string} transactionId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysWechatPayPayTransactionByIdTransactionIdGet: async (transactionId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'transactionId' is not null or undefined
if (transactionId === null || transactionId === undefined) {
throw new RequiredError('transactionId','Required parameter transactionId was null or undefined when calling apiSysWechatPayPayTransactionByIdTransactionIdGet.');
}
const localVarPath = `/api/sysWechatPay/payTransactionById/{transactionId}`
.replace(`{${"transactionId"}}`, encodeURIComponent(String(transactionId)));
// 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 () https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}
* @param {string} outTradeNumber
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet: async (outTradeNumber: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'outTradeNumber' is not null or undefined
if (outTradeNumber === null || outTradeNumber === undefined) {
throw new RequiredError('outTradeNumber','Required parameter outTradeNumber was null or undefined when calling apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet.');
}
const localVarPath = `/api/sysWechatPay/payTransactionByOutTradeNumber/{outTradeNumber}`
.replace(`{${"outTradeNumber"}}`, encodeURIComponent(String(outTradeNumber)));
// 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 Id() 🔖 * @summary Id() 🔖
@ -302,6 +453,103 @@ export const SysWechatPayApiAxiosParamCreator = function (configuration?: Config
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary 退退 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-refund-no.html
* @param {string} outRefundNumber
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet: async (outRefundNumber: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'outRefundNumber' is not null or undefined
if (outRefundNumber === null || outRefundNumber === undefined) {
throw new RequiredError('outRefundNumber','Required parameter outRefundNumber was null or undefined when calling apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet.');
}
const localVarPath = `/api/sysWechatPay/refundByOutRefundNumber/{outRefundNumber}`
.replace(`{${"outRefundNumber"}}`, encodeURIComponent(String(outRefundNumber)));
// 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 退 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
* @param {RefundRequestInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysWechatPayRefundPost: async (body?: RefundRequestInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysWechatPay/refund`;
// 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 { return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions, options: localVarRequestOptions,
@ -330,6 +578,20 @@ export const SysWechatPayApiFp = function(configuration?: Configuration) {
return axios.request(axiosRequestArgs); return axios.request(axiosRequestArgs);
}; };
}, },
/**
*
* @summary ()
* @param {PageSysWechatPayInput} [body] PageSysWechatPayInput
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayPagePost(body?: PageSysWechatPayInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysWechatPay>>> {
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPagePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/** /**
* *
* @summary () 🔖 * @summary () 🔖
@ -377,13 +639,41 @@ export const SysWechatPayApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> { async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>>> {
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayPartnerTransactionPost(body, options); const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayPartnerTransactionPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs); return axios.request(axiosRequestArgs);
}; };
}, },
/**
*
* @summary () https://api.mch.weixin.qq.com/v3/pay/transactions/id/{transaction_id}
* @param {string} transactionId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultWechatPayOutput>>> {
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary () https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}
* @param {string} outTradeNumber
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultWechatPayOutput>>> {
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/** /**
* *
* @summary Id() 🔖 * @summary Id() 🔖
@ -391,13 +681,41 @@ export const SysWechatPayApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> { async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>>> {
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayTransactionPost(body, options); const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayTransactionPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs); return axios.request(axiosRequestArgs);
}; };
}, },
/**
*
* @summary 退退 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-refund-no.html
* @param {string} outRefundNumber
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultGetRefundDomesticRefundByOutRefundNumberResponse>>> {
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 退 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
* @param {RefundRequestInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayRefundPost(body?: RefundRequestInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayRefundPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
} }
}; };
@ -417,6 +735,16 @@ export const SysWechatPayApiFactory = function (configuration?: Configuration, b
async apiSysWechatPayGenerateParametersForJsapiPayPost(body?: WechatPayParaInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> { async apiSysWechatPayGenerateParametersForJsapiPayPost(body?: WechatPayParaInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
return SysWechatPayApiFp(configuration).apiSysWechatPayGenerateParametersForJsapiPayPost(body, options).then((request) => request(axios, basePath)); return SysWechatPayApiFp(configuration).apiSysWechatPayGenerateParametersForJsapiPayPost(body, options).then((request) => request(axios, basePath));
}, },
/**
*
* @summary ()
* @param {PageSysWechatPayInput} [body] PageSysWechatPayInput
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayPagePost(body?: PageSysWechatPayInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysWechatPay>> {
return SysWechatPayApiFp(configuration).apiSysWechatPayPagePost(body, options).then((request) => request(axios, basePath));
},
/** /**
* *
* @summary () 🔖 * @summary () 🔖
@ -452,9 +780,29 @@ export const SysWechatPayApiFactory = function (configuration?: Configuration, b
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> { async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>> {
return SysWechatPayApiFp(configuration).apiSysWechatPayPayPartnerTransactionPost(body, options).then((request) => request(axios, basePath)); return SysWechatPayApiFp(configuration).apiSysWechatPayPayPartnerTransactionPost(body, options).then((request) => request(axios, basePath));
}, },
/**
*
* @summary () https://api.mch.weixin.qq.com/v3/pay/transactions/id/{transaction_id}
* @param {string} transactionId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultWechatPayOutput>> {
return SysWechatPayApiFp(configuration).apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary () https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}
* @param {string} outTradeNumber
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultWechatPayOutput>> {
return SysWechatPayApiFp(configuration).apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber, options).then((request) => request(axios, basePath));
},
/** /**
* *
* @summary Id() 🔖 * @summary Id() 🔖
@ -462,9 +810,29 @@ export const SysWechatPayApiFactory = function (configuration?: Configuration, b
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> { async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>> {
return SysWechatPayApiFp(configuration).apiSysWechatPayPayTransactionPost(body, options).then((request) => request(axios, basePath)); return SysWechatPayApiFp(configuration).apiSysWechatPayPayTransactionPost(body, options).then((request) => request(axios, basePath));
}, },
/**
*
* @summary 退退 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-refund-no.html
* @param {string} outRefundNumber
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultGetRefundDomesticRefundByOutRefundNumberResponse>> {
return SysWechatPayApiFp(configuration).apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 退 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
* @param {RefundRequestInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWechatPayRefundPost(body?: RefundRequestInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysWechatPayApiFp(configuration).apiSysWechatPayRefundPost(body, options).then((request) => request(axios, basePath));
},
}; };
}; };
@ -486,6 +854,17 @@ export class SysWechatPayApi extends BaseAPI {
public async apiSysWechatPayGenerateParametersForJsapiPayPost(body?: WechatPayParaInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> { public async apiSysWechatPayGenerateParametersForJsapiPayPost(body?: WechatPayParaInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
return SysWechatPayApiFp(this.configuration).apiSysWechatPayGenerateParametersForJsapiPayPost(body, options).then((request) => request(this.axios, this.basePath)); return SysWechatPayApiFp(this.configuration).apiSysWechatPayGenerateParametersForJsapiPayPost(body, options).then((request) => request(this.axios, this.basePath));
} }
/**
*
* @summary ()
* @param {PageSysWechatPayInput} [body] PageSysWechatPayInput
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysWechatPayApi
*/
public async apiSysWechatPayPagePost(body?: PageSysWechatPayInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysWechatPay>> {
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPagePost(body, options).then((request) => request(this.axios, this.basePath));
}
/** /**
* *
* @summary () 🔖 * @summary () 🔖
@ -525,9 +904,31 @@ export class SysWechatPayApi extends BaseAPI {
* @throws {RequiredError} * @throws {RequiredError}
* @memberof SysWechatPayApi * @memberof SysWechatPayApi
*/ */
public async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> { public async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>> {
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayPartnerTransactionPost(body, options).then((request) => request(this.axios, this.basePath)); return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayPartnerTransactionPost(body, options).then((request) => request(this.axios, this.basePath));
} }
/**
*
* @summary () https://api.mch.weixin.qq.com/v3/pay/transactions/id/{transaction_id}
* @param {string} transactionId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysWechatPayApi
*/
public async apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultWechatPayOutput>> {
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary () https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}
* @param {string} outTradeNumber
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysWechatPayApi
*/
public async apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultWechatPayOutput>> {
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber, options).then((request) => request(this.axios, this.basePath));
}
/** /**
* *
* @summary Id() 🔖 * @summary Id() 🔖
@ -536,7 +937,29 @@ export class SysWechatPayApi extends BaseAPI {
* @throws {RequiredError} * @throws {RequiredError}
* @memberof SysWechatPayApi * @memberof SysWechatPayApi
*/ */
public async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> { public async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>> {
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayTransactionPost(body, options).then((request) => request(this.axios, this.basePath)); return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayTransactionPost(body, options).then((request) => request(this.axios, this.basePath));
} }
/**
*
* @summary 退退 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-refund-no.html
* @param {string} outRefundNumber
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysWechatPayApi
*/
public async apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultGetRefundDomesticRefundByOutRefundNumberResponse>> {
return SysWechatPayApiFp(this.configuration).apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 退 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
* @param {RefundRequestInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysWechatPayApi
*/
public async apiSysWechatPayRefundPost(body?: RefundRequestInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysWechatPayApiFp(this.configuration).apiSysWechatPayRefundPost(body, options).then((request) => request(this.axios, this.basePath));
}
} }

View File

@ -168,6 +168,69 @@ export const SysWxOpenApiAxiosParamCreator = function (configuration?: Configura
options: localVarRequestOptions, options: localVarRequestOptions,
}; };
}, },
/**
*
* @summary 🔖
* @param {string} [signature]
* @param {string} [timestamp]
* @param {string} [nonce]
* @param {string} [echostr]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysWxOpenVerifySignatureGet: async (signature?: string, timestamp?: string, nonce?: string, echostr?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysWxOpen/verifySignature`;
// 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 (signature !== undefined) {
localVarQueryParameter['signature'] = signature;
}
if (timestamp !== undefined) {
localVarQueryParameter['timestamp'] = timestamp;
}
if (nonce !== undefined) {
localVarQueryParameter['nonce'] = nonce;
}
if (echostr !== undefined) {
localVarQueryParameter['echostr'] = echostr;
}
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 OpenId 🔖 * @summary OpenId 🔖
@ -379,6 +442,23 @@ export const SysWxOpenApiFp = function(configuration?: Configuration) {
return axios.request(axiosRequestArgs); return axios.request(axiosRequestArgs);
}; };
}, },
/**
*
* @summary 🔖
* @param {string} [signature]
* @param {string} [timestamp]
* @param {string} [nonce]
* @param {string} [echostr]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWxOpenVerifySignatureGet(signature?: string, timestamp?: string, nonce?: string, echostr?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<string>>> {
const localVarAxiosArgs = await SysWxOpenApiAxiosParamCreator(configuration).apiSysWxOpenVerifySignatureGet(signature, timestamp, nonce, echostr, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/** /**
* *
* @summary OpenId 🔖 * @summary OpenId 🔖
@ -460,6 +540,19 @@ export const SysWxOpenApiFactory = function (configuration?: Configuration, base
async apiSysWxOpenSendSubscribeMessagePost(body?: SendSubscribeMessageInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> { async apiSysWxOpenSendSubscribeMessagePost(body?: SendSubscribeMessageInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
return SysWxOpenApiFp(configuration).apiSysWxOpenSendSubscribeMessagePost(body, options).then((request) => request(axios, basePath)); return SysWxOpenApiFp(configuration).apiSysWxOpenSendSubscribeMessagePost(body, options).then((request) => request(axios, basePath));
}, },
/**
*
* @summary 🔖
* @param {string} [signature]
* @param {string} [timestamp]
* @param {string} [nonce]
* @param {string} [echostr]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysWxOpenVerifySignatureGet(signature?: string, timestamp?: string, nonce?: string, echostr?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<string>> {
return SysWxOpenApiFp(configuration).apiSysWxOpenVerifySignatureGet(signature, timestamp, nonce, echostr, options).then((request) => request(axios, basePath));
},
/** /**
* *
* @summary OpenId 🔖 * @summary OpenId 🔖
@ -533,6 +626,20 @@ export class SysWxOpenApi extends BaseAPI {
public async apiSysWxOpenSendSubscribeMessagePost(body?: SendSubscribeMessageInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> { public async apiSysWxOpenSendSubscribeMessagePost(body?: SendSubscribeMessageInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
return SysWxOpenApiFp(this.configuration).apiSysWxOpenSendSubscribeMessagePost(body, options).then((request) => request(this.axios, this.basePath)); return SysWxOpenApiFp(this.configuration).apiSysWxOpenSendSubscribeMessagePost(body, options).then((request) => request(this.axios, this.basePath));
} }
/**
*
* @summary 🔖
* @param {string} [signature]
* @param {string} [timestamp]
* @param {string} [nonce]
* @param {string} [echostr]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysWxOpenApi
*/
public async apiSysWxOpenVerifySignatureGet(signature?: string, timestamp?: string, nonce?: string, echostr?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<string>> {
return SysWxOpenApiFp(this.configuration).apiSysWxOpenVerifySignatureGet(signature, timestamp, nonce, echostr, options).then((request) => request(this.axios, this.basePath));
}
/** /**
* *
* @summary OpenId 🔖 * @summary OpenId 🔖

View File

@ -12,6 +12,8 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
import { Filter } from './filter';
import { Search } from './search';
/** /**
* *
* *
@ -20,6 +22,26 @@
*/ */
export interface AddCodeGenInput { export interface AddCodeGenInput {
/**
* @type {Search}
* @memberof AddCodeGenInput
*/
search?: Search;
/**
*
*
* @type {string}
* @memberof AddCodeGenInput
*/
keyword?: string | null;
/**
* @type {Filter}
* @memberof AddCodeGenInput
*/
filter?: Filter;
/** /**
* *
* *
@ -203,4 +225,12 @@ export interface AddCodeGenInput {
* @memberof AddCodeGenInput * @memberof AddCodeGenInput
*/ */
generateMenu: boolean; generateMenu: boolean;
/**
* 使 Api Service
*
* @type {boolean}
* @memberof AddCodeGenInput
*/
isApiService?: boolean;
} }

View File

@ -12,6 +12,7 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
import { SysUser } from './sys-user';
/** /**
* *
* *
@ -92,6 +93,12 @@ export interface AddOpenAccessInput {
*/ */
bindTenantId?: number; bindTenantId?: number;
/**
* @type {SysUser}
* @memberof AddOpenAccessInput
*/
bindUser?: SysUser;
/** /**
* *
* *

View File

@ -0,0 +1,69 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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 { CreatePayTransactionOutput } from './create-pay-transaction-output';
/**
*
*
* @export
* @interface AdminResultCreatePayTransactionOutput
*/
export interface AdminResultCreatePayTransactionOutput {
/**
*
*
* @type {number}
* @memberof AdminResultCreatePayTransactionOutput
*/
code?: number;
/**
* successwarningerror
*
* @type {string}
* @memberof AdminResultCreatePayTransactionOutput
*/
type?: string | null;
/**
*
*
* @type {string}
* @memberof AdminResultCreatePayTransactionOutput
*/
message?: string | null;
/**
* @type {CreatePayTransactionOutput}
* @memberof AdminResultCreatePayTransactionOutput
*/
result?: CreatePayTransactionOutput;
/**
*
*
* @type {any}
* @memberof AdminResultCreatePayTransactionOutput
*/
extras?: any | null;
/**
*
*
* @type {Date}
* @memberof AdminResultCreatePayTransactionOutput
*/
time?: Date;
}

View File

@ -0,0 +1,69 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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 { GetRefundDomesticRefundByOutRefundNumberResponse } from './get-refund-domestic-refund-by-out-refund-number-response';
/**
*
*
* @export
* @interface AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
*/
export interface AdminResultGetRefundDomesticRefundByOutRefundNumberResponse {
/**
*
*
* @type {number}
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
*/
code?: number;
/**
* successwarningerror
*
* @type {string}
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
*/
type?: string | null;
/**
*
*
* @type {string}
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
*/
message?: string | null;
/**
* @type {GetRefundDomesticRefundByOutRefundNumberResponse}
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
*/
result?: GetRefundDomesticRefundByOutRefundNumberResponse;
/**
*
*
* @type {any}
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
*/
extras?: any | null;
/**
*
*
* @type {Date}
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
*/
time?: Date;
}

View File

@ -0,0 +1,69 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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 { SqlSugarPagedListSysWechatPay } from './sql-sugar-paged-list-sys-wechat-pay';
/**
*
*
* @export
* @interface AdminResultSqlSugarPagedListSysWechatPay
*/
export interface AdminResultSqlSugarPagedListSysWechatPay {
/**
*
*
* @type {number}
* @memberof AdminResultSqlSugarPagedListSysWechatPay
*/
code?: number;
/**
* successwarningerror
*
* @type {string}
* @memberof AdminResultSqlSugarPagedListSysWechatPay
*/
type?: string | null;
/**
*
*
* @type {string}
* @memberof AdminResultSqlSugarPagedListSysWechatPay
*/
message?: string | null;
/**
* @type {SqlSugarPagedListSysWechatPay}
* @memberof AdminResultSqlSugarPagedListSysWechatPay
*/
result?: SqlSugarPagedListSysWechatPay;
/**
*
*
* @type {any}
* @memberof AdminResultSqlSugarPagedListSysWechatPay
*/
extras?: any | null;
/**
*
*
* @type {Date}
* @memberof AdminResultSqlSugarPagedListSysWechatPay
*/
time?: Date;
}

View File

@ -0,0 +1,83 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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 { From } from './from';
/**
*
*
* @export
* @interface Amount
*/
export interface Amount {
/**
* @type {number}
* @memberof Amount
*/
total?: number;
/**
* @type {number}
* @memberof Amount
*/
refund?: number;
/**
* @type {string}
* @memberof Amount
*/
currency?: string | null;
/**
* @type {number}
* @memberof Amount
*/
payerTotal?: number;
/**
* @type {number}
* @memberof Amount
*/
payerRefund?: number;
/**
* @type {number}
* @memberof Amount
*/
settlementTotal?: number;
/**
* @type {number}
* @memberof Amount
*/
settlementRefund?: number;
/**
* @type {number}
* @memberof Amount
*/
discountRefund?: number;
/**
* @type {Array<From>}
* @memberof Amount
*/
from?: Array<From> | null;
/**
* @type {number}
* @memberof Amount
*/
refundFee?: number | null;
}

View File

@ -0,0 +1,34 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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 CreatePayTransactionOutput
*/
export interface CreatePayTransactionOutput {
/**
* @type {string}
* @memberof CreatePayTransactionOutput
*/
prepayId?: string | null;
/**
* @type {string}
* @memberof CreatePayTransactionOutput
*/
outTradeNumber?: string | null;
}

View File

@ -42,6 +42,8 @@ export enum DbType {
NUMBER_21 = 21, NUMBER_21 = 21,
NUMBER_22 = 22, NUMBER_22 = 22,
NUMBER_23 = 23, NUMBER_23 = 23,
NUMBER_24 = 24,
NUMBER_25 = 25,
NUMBER_900 = 900 NUMBER_900 = 900
} }

View File

@ -0,0 +1,25 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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.
*/
/**
* <br />&nbsp; And = 0<br />&nbsp; Or = 1<br />&nbsp; Xor = 2<br />
* @export
* @enum {string}
*/
export enum FilterLogicEnum {
NUMBER_0 = 0,
NUMBER_1 = 1,
NUMBER_2 = 2
}

View File

@ -0,0 +1,31 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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.
*/
/**
* <br />&nbsp; EQ = 0<br />&nbsp; NEQ = 1<br />&nbsp; LT = 2<br />&nbsp; LTE = 3<br />&nbsp; GT = 4<br />&nbsp; GTE = 5<br />&nbsp; StartsWith = 6<br />&nbsp; EndsWith = 7<br />&nbsp; Contains = 8<br />
* @export
* @enum {string}
*/
export enum FilterOperatorEnum {
NUMBER_0 = 0,
NUMBER_1 = 1,
NUMBER_2 = 2,
NUMBER_3 = 3,
NUMBER_4 = 4,
NUMBER_5 = 5,
NUMBER_6 = 6,
NUMBER_7 = 7,
NUMBER_8 = 8
}

View File

@ -0,0 +1,61 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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 { Filter } from './filter';
import { FilterLogicEnum } from './filter-logic-enum';
import { FilterOperatorEnum } from './filter-operator-enum';
/**
*
*
* @export
* @interface Filter
*/
export interface Filter {
/**
* @type {FilterLogicEnum}
* @memberof Filter
*/
logic?: FilterLogicEnum;
/**
*
*
* @type {Array<Filter>}
* @memberof Filter
*/
filters?: Array<Filter> | null;
/**
*
*
* @type {string}
* @memberof Filter
*/
field?: string | null;
/**
* @type {FilterOperatorEnum}
* @memberof Filter
*/
operator?: FilterOperatorEnum;
/**
*
*
* @type {any}
* @memberof Filter
*/
value?: any | null;
}

View File

@ -0,0 +1,34 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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 From
*/
export interface From {
/**
* @type {number}
* @memberof From
*/
amount?: number;
/**
* @type {string}
* @memberof From
*/
account?: string | null;
}

View File

@ -13,13 +13,14 @@
*/ */
/** /**
* <br />&nbsp; Male = 1<br />&nbsp; Female = 2<br />&nbsp; Other = 3<br /> * GB/T 2261.1-2003<br />&nbsp; Unknown = 0<br />&nbsp; Male = 1<br />&nbsp; Female = 2<br />&nbsp; Unspecified = 9<br />
* @export * @export
* @enum {string} * @enum {string}
*/ */
export enum GenderEnum { export enum GenderEnum {
NUMBER_0 = 0,
NUMBER_1 = 1, NUMBER_1 = 1,
NUMBER_2 = 2, NUMBER_2 = 2,
NUMBER_3 = 3 NUMBER_9 = 9
} }

View File

@ -0,0 +1,114 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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 { Amount } from './amount';
import { Promotion } from './promotion';
/**
*
*
* @export
* @interface GetRefundDomesticRefundByOutRefundNumberResponse
*/
export interface GetRefundDomesticRefundByOutRefundNumberResponse {
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
code?: string | null;
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
message?: string | null;
/**
* @type {{ [key: string]: any; }}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
detail?: { [key: string]: any; } | null;
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
refundId?: string | null;
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
outRefundNo?: string | null;
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
transactionId?: string | null;
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
outTradeNo?: string | null;
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
channel?: string | null;
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
userReceivedAccount?: string | null;
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
fundsAccount?: string | null;
/**
* @type {string}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
status?: string | null;
/**
* @type {Date}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
successTime?: Date | null;
/**
* @type {Date}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
createTime?: Date;
/**
* @type {Amount}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
amount?: Amount;
/**
* @type {Array<Promotion>}
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
*/
promotionDetail?: Array<Promotion> | null;
}

View File

@ -0,0 +1,58 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* 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 GoodsDetail
*/
export interface GoodsDetail {
/**
* @type {string}
* @memberof GoodsDetail
*/
merchantGoodsId?: string | null;
/**
* @type {string}
* @memberof GoodsDetail
*/
wechatpayGoodsId?: string | null;
/**
* @type {string}
* @memberof GoodsDetail
*/
goodsName?: string | null;
/**
* @type {number}
* @memberof GoodsDetail
*/
unitPrice?: number;
/**
* @type {number}
* @memberof GoodsDetail
*/
refundAmount?: number;
/**
* @type {number}
* @memberof GoodsDetail
*/
refundQuantity?: number;
}

View File

@ -19,9 +19,11 @@ export * from './add-sys-ldap-input';
export * from './add-tenant-input'; export * from './add-tenant-input';
export * from './add-user-input'; export * from './add-user-input';
export * from './admin-result-boolean'; export * from './admin-result-boolean';
export * from './admin-result-create-pay-transaction-output';
export * from './admin-result-data-set'; export * from './admin-result-data-set';
export * from './admin-result-data-table'; export * from './admin-result-data-table';
export * from './admin-result-dictionary-string-string'; export * from './admin-result-dictionary-string-string';
export * from './admin-result-get-refund-domestic-refund-by-out-refund-number-response';
export * from './admin-result-iaction-result'; export * from './admin-result-iaction-result';
export * from './admin-result-int32'; export * from './admin-result-int32';
export * from './admin-result-int64'; export * from './admin-result-int64';
@ -82,6 +84,7 @@ export * from './admin-result-sql-sugar-paged-list-sys-online-user';
export * from './admin-result-sql-sugar-paged-list-sys-plugin'; export * from './admin-result-sql-sugar-paged-list-sys-plugin';
export * from './admin-result-sql-sugar-paged-list-sys-print'; export * from './admin-result-sql-sugar-paged-list-sys-print';
export * from './admin-result-sql-sugar-paged-list-sys-region'; export * from './admin-result-sql-sugar-paged-list-sys-region';
export * from './admin-result-sql-sugar-paged-list-sys-wechat-pay';
export * from './admin-result-sql-sugar-paged-list-tenant-output'; export * from './admin-result-sql-sugar-paged-list-tenant-output';
export * from './admin-result-sql-sugar-paged-list-user-output'; export * from './admin-result-sql-sugar-paged-list-user-output';
export * from './admin-result-string'; export * from './admin-result-string';
@ -101,6 +104,7 @@ export * from './admin-result-visual-db-table';
export * from './admin-result-wechat-pay-output'; export * from './admin-result-wechat-pay-output';
export * from './admin-result-wx-open-id-output'; export * from './admin-result-wx-open-id-output';
export * from './admin-result-wx-phone-output'; export * from './admin-result-wx-phone-output';
export * from './amount';
export * from './api-output'; export * from './api-output';
export * from './assembly'; export * from './assembly';
export * from './base-api-input'; export * from './base-api-input';
@ -114,13 +118,13 @@ export * from './card-type-enum';
export * from './change-pwd-input'; export * from './change-pwd-input';
export * from './cluster-status'; export * from './cluster-status';
export * from './code-gen-config'; export * from './code-gen-config';
export * from './code-gen-input';
export * from './column-ouput'; export * from './column-ouput';
export * from './column-relation'; export * from './column-relation';
export * from './compare-info'; export * from './compare-info';
export * from './const-output'; export * from './const-output';
export * from './constructor-info'; export * from './constructor-info';
export * from './create-entity-input'; export * from './create-entity-input';
export * from './create-pay-transaction-output';
export * from './create-seed-data-input'; export * from './create-seed-data-input';
export * from './culture-info'; export * from './culture-info';
export * from './culture-level-enum'; export * from './culture-level-enum';
@ -179,10 +183,16 @@ export * from './field-attributes';
export * from './field-info'; export * from './field-info';
export * from './file-input'; export * from './file-input';
export * from './file-output'; export * from './file-output';
export * from './filter';
export * from './filter-logic-enum';
export * from './filter-operator-enum';
export * from './from';
export * from './gen-auth-url-input'; export * from './gen-auth-url-input';
export * from './gender-enum'; export * from './gender-enum';
export * from './generate-signature-input'; export * from './generate-signature-input';
export * from './generic-parameter-attributes'; export * from './generic-parameter-attributes';
export * from './get-refund-domestic-refund-by-out-refund-number-response';
export * from './goods-detail';
export * from './http-method-enum'; export * from './http-method-enum';
export * from './iaction-result'; export * from './iaction-result';
export * from './icomponent'; export * from './icomponent';
@ -225,8 +235,8 @@ export * from './notice-user-status-enum';
export * from './number-format-info'; export * from './number-format-info';
export * from './oauth-user-input'; export * from './oauth-user-input';
export * from './oauth-user-output'; export * from './oauth-user-output';
export * from './open-access-input';
export * from './open-access-output'; export * from './open-access-output';
export * from './page-code-gen-input';
export * from './page-config-input'; export * from './page-config-input';
export * from './page-dict-data-input'; export * from './page-dict-data-input';
export * from './page-dict-type-input'; export * from './page-dict-type-input';
@ -236,6 +246,7 @@ export * from './page-job-trigger-record-input';
export * from './page-log-input'; export * from './page-log-input';
export * from './page-notice-input'; export * from './page-notice-input';
export * from './page-online-user-input'; export * from './page-online-user-input';
export * from './page-open-access-input';
export * from './page-plugin-input'; export * from './page-plugin-input';
export * from './page-pos-input'; export * from './page-pos-input';
export * from './page-pos-output'; export * from './page-pos-output';
@ -243,6 +254,8 @@ export * from './page-print-input';
export * from './page-region-input'; export * from './page-region-input';
export * from './page-role-input'; export * from './page-role-input';
export * from './page-role-output'; export * from './page-role-output';
export * from './page-sys-ldap-input';
export * from './page-sys-wechat-pay-input';
export * from './page-tenant-input'; export * from './page-tenant-input';
export * from './page-user-input'; export * from './page-user-input';
export * from './parameter-attributes'; export * from './parameter-attributes';
@ -250,8 +263,10 @@ export * from './parameter-info';
export * from './platform-type-enum'; export * from './platform-type-enum';
export * from './pos-output'; export * from './pos-output';
export * from './print-type-enum'; export * from './print-type-enum';
export * from './promotion';
export * from './property-attributes'; export * from './property-attributes';
export * from './property-info'; export * from './property-info';
export * from './refund-request-input';
export * from './reset-pwd-user-input'; export * from './reset-pwd-user-input';
export * from './role-api-input'; export * from './role-api-input';
export * from './role-input'; export * from './role-input';
@ -262,6 +277,7 @@ export * from './runtime-field-handle';
export * from './runtime-method-handle'; export * from './runtime-method-handle';
export * from './runtime-type-handle'; export * from './runtime-type-handle';
export * from './schema-serialization-mode'; export * from './schema-serialization-mode';
export * from './search';
export * from './security-rule-set'; export * from './security-rule-set';
export * from './send-subscribe-message-input'; export * from './send-subscribe-message-input';
export * from './serialization-format'; export * from './serialization-format';
@ -290,6 +306,7 @@ export * from './sql-sugar-paged-list-sys-online-user';
export * from './sql-sugar-paged-list-sys-plugin'; export * from './sql-sugar-paged-list-sys-plugin';
export * from './sql-sugar-paged-list-sys-print'; export * from './sql-sugar-paged-list-sys-print';
export * from './sql-sugar-paged-list-sys-region'; export * from './sql-sugar-paged-list-sys-region';
export * from './sql-sugar-paged-list-sys-wechat-pay';
export * from './sql-sugar-paged-list-tenant-output'; export * from './sql-sugar-paged-list-tenant-output';
export * from './sql-sugar-paged-list-user-output'; export * from './sql-sugar-paged-list-user-output';
export * from './status-enum'; export * from './status-enum';
@ -311,7 +328,6 @@ export * from './sys-job-detail';
export * from './sys-job-trigger'; export * from './sys-job-trigger';
export * from './sys-job-trigger-record'; export * from './sys-job-trigger-record';
export * from './sys-ldap'; export * from './sys-ldap';
export * from './sys-ldap-input';
export * from './sys-log-diff'; export * from './sys-log-diff';
export * from './sys-log-ex'; export * from './sys-log-ex';
export * from './sys-log-op'; export * from './sys-log-op';

View File

@ -28,6 +28,14 @@ export interface InfoSaveInput {
*/ */
sysLogoBase64?: string | null; sysLogoBase64?: string | null;
/**
*
*
* @type {string}
* @memberof InfoSaveInput
*/
sysLogoFileName?: string | null;
/** /**
* *
* *

View File

@ -30,12 +30,6 @@ export interface MemberInfo {
*/ */
memberType?: MemberTypes; memberType?: MemberTypes;
/**
* @type {string}
* @memberof MemberInfo
*/
name?: string | null;
/** /**
* @type {Type} * @type {Type}
* @memberof MemberInfo * @memberof MemberInfo
@ -48,6 +42,12 @@ export interface MemberInfo {
*/ */
reflectedType?: Type; reflectedType?: Type;
/**
* @type {string}
* @memberof MemberInfo
*/
name?: string | null;
/** /**
* @type {Module} * @type {Module}
* @memberof MemberInfo * @memberof MemberInfo

View File

@ -12,6 +12,8 @@
* Do not edit the class manually. * Do not edit the class manually.
*/ */
import { Filter } from './filter';
import { Search } from './search';
/** /**
* *
* *
@ -20,6 +22,26 @@
*/ */
export interface OAuthUserInput { export interface OAuthUserInput {
/**
* @type {Search}
* @memberof OAuthUserInput
*/
search?: Search;
/**
*
*
* @type {string}
* @memberof OAuthUserInput
*/
keyword?: string | null;
/**
* @type {Filter}
* @memberof OAuthUserInput
*/
filter?: Filter;
/** /**
* *
* *

Some files were not shown because too many files have changed in this diff Show More