mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-07 08:42:28 +08:00
feat: ✨ 框架代码同步 (#148)
[skip ci] Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
@ -8,5 +8,5 @@ public sealed record GetAllEntriesReq : DataAbstraction
|
||||
/// <summary>
|
||||
/// 数据库索引号
|
||||
/// </summary>
|
||||
public uint DbIndex { get; init; }
|
||||
public int DbIndex { get; init; }
|
||||
}
|
@ -1,22 +1,22 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑用户单体
|
||||
/// 请求:启用/禁用配置
|
||||
/// </summary>
|
||||
public sealed record EditSingleUserReq : CreateEditUserReq
|
||||
public sealed record SetConfigEnabledReq : Sys_Config
|
||||
{
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Profile" />
|
||||
public new EditUserProfileReq Profile { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
@ -5,4 +5,11 @@ namespace NetAdmin.Domain.Dto.Sys.Job;
|
||||
/// <summary>
|
||||
/// 请求:完成计划作业
|
||||
/// </summary>
|
||||
public sealed record FinishJobReq : Sys_Job;
|
||||
public sealed record FinishJobReq : Sys_Job, IRegister
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<QueryJobRsp, FinishJobReq>().Map(d => d.LastStatusCode, s => ((Sys_Job)s).LastStatusCode);
|
||||
}
|
||||
}
|
@ -12,6 +12,17 @@ namespace NetAdmin.Domain.Dto.Sys.Job;
|
||||
/// </summary>
|
||||
public sealed record QueryJobRsp : Sys_Job
|
||||
{
|
||||
/// <inheritdoc cref="Sys_Job.LastStatusCode" />
|
||||
public new string LastStatusCode =>
|
||||
#pragma warning disable IDE0072
|
||||
base.LastStatusCode switch {
|
||||
#pragma warning restore IDE0072
|
||||
null => null
|
||||
, _ => (int)base.LastStatusCode.Value == Numbers.HTTP_STATUS_BIZ_FAIL
|
||||
? nameof(ErrorCodes.Unhandled).ToLowerCamelCase()
|
||||
: base.LastStatusCode.Value.ToString().ToLowerCamelCase()
|
||||
};
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
@ -52,10 +63,6 @@ public sealed record QueryJobRsp : Sys_Job
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override DateTime? LastExecTime { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Job.LastStatusCode" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override HttpStatusCode? LastStatusCode { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldModifiedTime.ModifiedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override DateTime? ModifiedTime { get; init; }
|
||||
|
@ -1,6 +1,7 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.Job;
|
||||
using HttpMethods = NetAdmin.Domain.Enums.HttpMethods;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.JobRecord;
|
||||
@ -11,8 +12,10 @@ namespace NetAdmin.Domain.Dto.Sys.JobRecord;
|
||||
public sealed record QueryJobRecordRsp : Sys_JobRecord
|
||||
{
|
||||
/// <inheritdoc cref="Sys_JobRecord.HttpStatusCode" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public new HttpStatusCode HttpStatusCode => (HttpStatusCode)base.HttpStatusCode;
|
||||
public new string HttpStatusCode =>
|
||||
base.HttpStatusCode == Numbers.HTTP_STATUS_BIZ_FAIL
|
||||
? nameof(ErrorCodes.Unhandled).ToLowerCamelCase()
|
||||
: ((HttpStatusCode)base.HttpStatusCode).ToString().ToLowerCamelCase();
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
@ -30,6 +33,11 @@ public sealed record QueryJobRecordRsp : Sys_JobRecord
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 作业信息
|
||||
/// </summary>
|
||||
public new QueryJobRsp Job { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_JobRecord.JobId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long JobId { get; init; }
|
||||
|
@ -0,0 +1,23 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:设置是否显示仪表板
|
||||
/// </summary>
|
||||
public sealed record SetDisplayDashboardReq : Sys_Role
|
||||
{
|
||||
/// <inheritdoc cref="Sys_Role.DisplayDashboard" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool DisplayDashboard { get; init; }
|
||||
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:设置是否忽略权限控制
|
||||
/// </summary>
|
||||
public sealed record SetIgnorePermissionControlReq : Sys_Role
|
||||
{
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Role.IgnorePermissionControl" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool IgnorePermissionControl { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:获取当前用户应用配置
|
||||
/// </summary>
|
||||
public sealed record GetSessionUserAppConfigRsp : Sys_UserProfile
|
||||
{
|
||||
/// <inheritdoc cref="Sys_UserProfile.AppConfig" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string AppConfig { get; init; }
|
||||
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:设置当前用户应用配置
|
||||
/// </summary>
|
||||
public record SetSessionUserAppConfigReq : Sys_UserProfile
|
||||
{
|
||||
/// <inheritdoc cref="Sys_UserProfile.AppConfig" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string AppConfig { get; init; }
|
||||
}
|
Reference in New Issue
Block a user