😎1、去掉bool类型默认值(多库不兼容) 2、调整系统配置接口名称 3、其他代码优化
This commit is contained in:
parent
3b362a937f
commit
d17e26aa26
@ -41,7 +41,7 @@
|
||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.167" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.1.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.5" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1080" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1081" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -80,8 +80,8 @@ public abstract class EntityBase : EntityBaseId, IDeletedFilter
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "软删除", DefaultValue = "false")]
|
||||
public virtual bool IsDelete { get; set; } = false;
|
||||
[SugarColumn(ColumnDescription = "软删除")]
|
||||
public virtual bool? IsDelete { get; set; } = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -14,7 +14,7 @@ internal interface IDeletedFilter
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
bool IsDelete { get; set; }
|
||||
bool? IsDelete { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -126,7 +126,7 @@ public partial class SysCodeGen : EntityBase
|
||||
/// <summary>
|
||||
/// 是否使用 Api Service
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否使用 Api Service", DefaultValue = "false")]
|
||||
[SugarColumn(ColumnDescription = "是否使用 Api Service")]
|
||||
public bool IsApiService { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -106,6 +106,6 @@ public partial class SysFile : EntityTenantBaseData
|
||||
/// 是否公开
|
||||
/// 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否公开", DefaultValue = "false")]
|
||||
[SugarColumn(ColumnDescription = "是否公开")]
|
||||
public bool IsPublic { get; set; } = false;
|
||||
}
|
||||
@ -52,13 +52,13 @@ public partial class SysJobDetail : EntityBaseId
|
||||
/// <summary>
|
||||
/// 是否并行执行
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否并行执行", DefaultValue = "true")]
|
||||
[SugarColumn(ColumnDescription = "是否并行执行")]
|
||||
public bool Concurrent { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否扫描特性触发器
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否扫描特性触发器", ColumnName = "annotation", DefaultValue = "false")]
|
||||
[SugarColumn(ColumnDescription = "是否扫描特性触发器", ColumnName = "annotation")]
|
||||
public bool IncludeAnnotation { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -118,25 +118,25 @@ public partial class SysJobTrigger : EntityBaseId
|
||||
/// <summary>
|
||||
/// 重试间隔时间(ms)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "重试间隔时间(ms)", DefaultValue = "1000")]
|
||||
public int RetryTimeout { get; set; } = 1000;
|
||||
[SugarColumn(ColumnDescription = "重试间隔时间(ms)", DefaultValue = "3000")]
|
||||
public int RetryTimeout { get; set; } = 3000;
|
||||
|
||||
/// <summary>
|
||||
/// 是否立即启动
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否立即启动", DefaultValue = "true")]
|
||||
[SugarColumn(ColumnDescription = "是否立即启动")]
|
||||
public bool StartNow { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启动时执行一次
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否启动时执行一次", DefaultValue = "false")]
|
||||
[SugarColumn(ColumnDescription = "是否启动时执行一次")]
|
||||
public bool RunOnStart { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否在启动时重置最大触发次数等于一次的作业
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否重置触发次数", DefaultValue = "true")]
|
||||
[SugarColumn(ColumnDescription = "是否重置触发次数")]
|
||||
public bool ResetOnlyOnce { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -478,10 +478,10 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
if (ids == null || ids.Count == 0)
|
||||
return 0;
|
||||
return await _sysFileRep.AsUpdateable()
|
||||
.SetColumns(m => m.RelationName == relationName)
|
||||
.SetColumns(m => m.RelationId == relationId)
|
||||
.SetColumns(m => m.BelongId == belongId)
|
||||
.Where(m => ids.Contains(m.Id))
|
||||
.SetColumns(u => u.RelationName == relationName)
|
||||
.SetColumns(u => u.RelationId == relationId)
|
||||
.SetColumns(u => u.BelongId == belongId)
|
||||
.Where(u => ids.Contains(u.Id))
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
@ -495,25 +495,24 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
public async Task<List<FileOutput>> GetRelationFiles([FromQuery] RelationQueryInput input)
|
||||
{
|
||||
return await _sysFileRep.AsQueryable()
|
||||
.Where(m => !m.IsDelete)
|
||||
.WhereIF(input.RelationId.HasValue && input.RelationId > 0, m => m.RelationId == input.RelationId)
|
||||
.WhereIF(input.BelongId.HasValue && input.BelongId > 0, m => m.BelongId == input.BelongId.Value)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.RelationName), m => m.RelationName == input.RelationName)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.FileTypes), m => input.GetFileTypeBS().Contains(m.FileType))
|
||||
.Select(m => new FileOutput
|
||||
.WhereIF(input.RelationId.HasValue && input.RelationId > 0, u => u.RelationId == input.RelationId)
|
||||
.WhereIF(input.BelongId.HasValue && input.BelongId > 0, u => u.BelongId == input.BelongId.Value)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.RelationName), u => u.RelationName == input.RelationName)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.FileTypes), u => input.GetFileTypeBS().Contains(u.FileType))
|
||||
.Select(u => new FileOutput
|
||||
{
|
||||
Id = m.Id,
|
||||
FileType = m.FileType,
|
||||
Name = m.FileName,
|
||||
RelationId = m.RelationId,
|
||||
BelongId = m.BelongId,
|
||||
FilePath = m.FilePath,
|
||||
SizeKb = m.SizeKb,
|
||||
Suffix = m.Suffix,
|
||||
RelationName = m.RelationName,
|
||||
Url = SqlFunc.MergeString("/api/sysFile/Preview/", m.Id.ToString()),
|
||||
CreateUserName = m.CreateUserName,
|
||||
CreateTime = m.CreateTime,
|
||||
Id = u.Id,
|
||||
FileType = u.FileType,
|
||||
Name = u.FileName,
|
||||
RelationId = u.RelationId,
|
||||
BelongId = u.BelongId,
|
||||
FilePath = u.FilePath,
|
||||
SizeKb = u.SizeKb,
|
||||
Suffix = u.Suffix,
|
||||
RelationName = u.RelationName,
|
||||
Url = SqlFunc.MergeString("/api/sysFile/Preview/", u.Id.ToString()),
|
||||
CreateUserName = u.CreateUserName,
|
||||
CreateTime = u.CreateTime,
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user