mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-06-20 10:48:15 +08:00
wip: 🧠 初步的框架
This commit is contained in:
18
src/backend/NetAdmin.Domain/Dto/Dependency/BulkReq.cs
Normal file
18
src/backend/NetAdmin.Domain/Dto/Dependency/BulkReq.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 批量请求
|
||||
/// </summary>
|
||||
public sealed record BulkReq<T> : DataAbstraction
|
||||
where T : DataAbstraction, new()
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求对象
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.请求对象))]
|
||||
[MinLength(1)]
|
||||
[MaxLength(Numbers.BULK_REQ_LIMIT)]
|
||||
public IEnumerable<T> Items { get; init; }
|
||||
}
|
16
src/backend/NetAdmin.Domain/Dto/Dependency/DelReq.cs
Normal file
16
src/backend/NetAdmin.Domain/Dto/Dependency/DelReq.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Dependency;
|
||||
|
||||
/// <inheritdoc cref="DelReq{T}" />
|
||||
public sealed record DelReq : DelReq<long>;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:通过编号删除
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public record DelReq<T> : DataAbstraction, IFieldPrimary<T>
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
public T Id { get; init; }
|
||||
}
|
17
src/backend/NetAdmin.Domain/Dto/Dependency/IPagedInfo.cs
Normal file
17
src/backend/NetAdmin.Domain/Dto/Dependency/IPagedInfo.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace NetAdmin.Domain.Dto.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 信息:分页
|
||||
/// </summary>
|
||||
public interface IPagedInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前页码
|
||||
/// </summary>
|
||||
int Page { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 页容量
|
||||
/// </summary>
|
||||
int PageSize { get; init; }
|
||||
}
|
6
src/backend/NetAdmin.Domain/Dto/Dependency/NopReq.cs
Normal file
6
src/backend/NetAdmin.Domain/Dto/Dependency/NopReq.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 空请求
|
||||
/// </summary>
|
||||
public sealed record NopReq : DataAbstraction;
|
16
src/backend/NetAdmin.Domain/Dto/Dependency/PagedQueryReq.cs
Normal file
16
src/backend/NetAdmin.Domain/Dto/Dependency/PagedQueryReq.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace NetAdmin.Domain.Dto.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:分页查询
|
||||
/// </summary>
|
||||
public sealed record PagedQueryReq<T> : QueryReq<T>, IPagedInfo
|
||||
where T : DataAbstraction, new()
|
||||
{
|
||||
/// <inheritdoc cref="IPagedInfo.Page" />
|
||||
[Range(1, Numbers.QUERY_MAX_PAGE_NO)]
|
||||
public int Page { get; init; } = 1;
|
||||
|
||||
/// <inheritdoc cref="IPagedInfo.PageSize" />
|
||||
[Range(1, Numbers.QUERY_MAX_PAGE_SIZE)]
|
||||
public int PageSize { get; init; } = Numbers.QUERY_DEF_PAGE_SIZE;
|
||||
}
|
24
src/backend/NetAdmin.Domain/Dto/Dependency/PagedQueryRsp.cs
Normal file
24
src/backend/NetAdmin.Domain/Dto/Dependency/PagedQueryRsp.cs
Normal file
@ -0,0 +1,24 @@
|
||||
namespace NetAdmin.Domain.Dto.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:分页查询
|
||||
/// </summary>
|
||||
public sealed record PagedQueryRsp<T>(int Page, int PageSize, long Total, IEnumerable<T> Rows) : IPagedInfo
|
||||
where T : DataAbstraction
|
||||
{
|
||||
/// <inheritdoc cref="IPagedInfo.Page" />
|
||||
public int Page { get; init; } = Page;
|
||||
|
||||
/// <inheritdoc cref="IPagedInfo.PageSize" />
|
||||
public int PageSize { get; init; } = PageSize;
|
||||
|
||||
/// <summary>
|
||||
/// 数据行
|
||||
/// </summary>
|
||||
public IEnumerable<T> Rows { get; init; } = Rows;
|
||||
|
||||
/// <summary>
|
||||
/// 数据总条
|
||||
/// </summary>
|
||||
public long Total { get; init; } = Total;
|
||||
}
|
39
src/backend/NetAdmin.Domain/Dto/Dependency/QueryReq.cs
Normal file
39
src/backend/NetAdmin.Domain/Dto/Dependency/QueryReq.cs
Normal file
@ -0,0 +1,39 @@
|
||||
namespace NetAdmin.Domain.Dto.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询
|
||||
/// </summary>
|
||||
public record QueryReq<T> : DataAbstraction
|
||||
where T : DataAbstraction, new()
|
||||
{
|
||||
/// <summary>
|
||||
/// 取前n条
|
||||
/// </summary>
|
||||
[Range(1, Numbers.QUERY_LIMIT)]
|
||||
public int Count { get; init; } = Numbers.QUERY_LIMIT;
|
||||
|
||||
/// <summary>
|
||||
/// 动态查询条件
|
||||
/// </summary>
|
||||
public DynamicFilterInfo DynamicFilter { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询条件
|
||||
/// </summary>
|
||||
public T Filter { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询关键字
|
||||
/// </summary>
|
||||
public string Keywords { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序方式
|
||||
/// </summary>
|
||||
public Orders? Order { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
/// </summary>
|
||||
public string Prop { get; init; }
|
||||
}
|
23
src/backend/NetAdmin.Domain/Dto/RestfulInfo.cs
Normal file
23
src/backend/NetAdmin.Domain/Dto/RestfulInfo.cs
Normal file
@ -0,0 +1,23 @@
|
||||
namespace NetAdmin.Domain.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 信息:RESTful 风格结果集
|
||||
/// </summary>
|
||||
public record RestfulInfo<T> : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public ErrorCodes Code { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据
|
||||
/// </summary>
|
||||
public T Data { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息
|
||||
/// </summary>
|
||||
public object Msg { get; init; }
|
||||
}
|
8
src/backend/NetAdmin.Domain/Dto/Sys/Api/CreateApiReq.cs
Normal file
8
src/backend/NetAdmin.Domain/Dto/Sys/Api/CreateApiReq.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Api;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建接口
|
||||
/// </summary>
|
||||
public sealed record CreateApiReq : Sys_Api;
|
8
src/backend/NetAdmin.Domain/Dto/Sys/Api/QueryApiReq.cs
Normal file
8
src/backend/NetAdmin.Domain/Dto/Sys/Api/QueryApiReq.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Api;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询接口
|
||||
/// </summary>
|
||||
public sealed record QueryApiReq : Sys_Api;
|
38
src/backend/NetAdmin.Domain/Dto/Sys/Api/QueryApiRsp.cs
Normal file
38
src/backend/NetAdmin.Domain/Dto/Sys/Api/QueryApiRsp.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Api;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询接口
|
||||
/// </summary>
|
||||
public sealed record QueryApiRsp : Sys_Api
|
||||
{
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
public new IEnumerable<QueryApiRsp> Children { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
public override string Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Api.Method" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Method { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Api.Name" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Api.Namespace" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Namespace { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Api.ParentId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ParentId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldSummary.Summary" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Summary { get; init; }
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Cache;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:缓存统计
|
||||
/// </summary>
|
||||
public sealed record CacheStatisticsRsp : DataAbstraction
|
||||
{
|
||||
private static readonly Regex[] _regexes = {
|
||||
new(@"keyspace_hits:(\d+)", RegexOptions.Compiled)
|
||||
, new(@"keyspace_misses:(\d+)", RegexOptions.Compiled)
|
||||
, new(@"uptime_in_seconds:(\d+)", RegexOptions.Compiled)
|
||||
, new(@"used_cpu_sys:([\d\\.]+)", RegexOptions.Compiled)
|
||||
, new(@"used_cpu_user:([\d\\.]+)", RegexOptions.Compiled)
|
||||
, new(@"used_memory:(\d+)", RegexOptions.Compiled)
|
||||
, new("redis_version:(.+)", RegexOptions.Compiled)
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CacheStatisticsRsp" /> class.
|
||||
/// </summary>
|
||||
public CacheStatisticsRsp() { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CacheStatisticsRsp" /> class.
|
||||
/// </summary>
|
||||
public CacheStatisticsRsp(string redisResult)
|
||||
{
|
||||
KeyspaceHits = _regexes[0].Match(redisResult).Groups[1].Value.Trim().Int64Try(0);
|
||||
KeyspaceMisses = _regexes[1].Match(redisResult).Groups[1].Value.Trim().Int64Try(0);
|
||||
UpTime = _regexes[2].Match(redisResult).Groups[1].Value.Trim().Int64Try(0);
|
||||
UsedCpu = _regexes[3].Match(redisResult).Groups[1].Value.Trim().DecTry(0) +
|
||||
_regexes[4].Match(redisResult).Groups[1].Value.Trim().DecTry(0);
|
||||
UsedMemory = _regexes[5].Match(redisResult).Groups[1].Value.Trim().Int64Try(0);
|
||||
Version = _regexes[6].Match(redisResult).Groups[1].Value.Trim();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 键总数
|
||||
/// </summary>
|
||||
public long DbSize { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 命中键的数量
|
||||
/// </summary>
|
||||
public long KeyspaceHits { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 未命中键的数量
|
||||
/// </summary>
|
||||
public long KeyspaceMisses { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Redis运行时间(秒)
|
||||
/// </summary>
|
||||
public long UpTime { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 使用的CPU时间(秒)
|
||||
/// </summary>
|
||||
public decimal UsedCpu { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 使用的内存量(字节)
|
||||
/// </summary>
|
||||
public long UsedMemory { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Redis版本号
|
||||
/// </summary>
|
||||
public string Version { get; init; }
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Cache;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:获取所有缓存项
|
||||
/// </summary>
|
||||
public sealed record GetAllEntriesReq : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据库索引号
|
||||
/// </summary>
|
||||
public uint DbIndex { get; init; }
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Cache;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:获取所有缓存项
|
||||
/// </summary>
|
||||
public sealed record GetAllEntriesRsp : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetAllEntriesRsp" /> class.
|
||||
/// </summary>
|
||||
public GetAllEntriesRsp() { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetAllEntriesRsp" /> class.
|
||||
/// </summary>
|
||||
public GetAllEntriesRsp(long absExp, string key, long sldExp, string data)
|
||||
{
|
||||
AbsExp = absExp;
|
||||
Key = key;
|
||||
SldExp = sldExp;
|
||||
Data = data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绝对过期时间
|
||||
/// </summary>
|
||||
public long AbsExp { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 缓存值
|
||||
/// </summary>
|
||||
public string Data { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 缓存键
|
||||
/// </summary>
|
||||
public string Key { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 滑动过期时间
|
||||
/// </summary>
|
||||
public long SldExp { get; init; }
|
||||
}
|
28
src/backend/NetAdmin.Domain/Dto/Sys/Captcha/GetCaptchaRsp.cs
Normal file
28
src/backend/NetAdmin.Domain/Dto/Sys/Captcha/GetCaptchaRsp.cs
Normal file
@ -0,0 +1,28 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Captcha;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:获取人机校验图
|
||||
/// </summary>
|
||||
public sealed record GetCaptchaRsp : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 背景图(base64)
|
||||
/// </summary>
|
||||
public string BackgroundImage { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
public string Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 缺口x坐标
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public int SawOffsetX { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 滑块图(base64)
|
||||
/// </summary>
|
||||
public string SliderImage { get; init; }
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Captcha;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:完成人机验证
|
||||
/// </summary>
|
||||
public sealed record VerifyCaptchaReq : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.唯一编码))]
|
||||
public string Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 缺口x坐标
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public int? SawOffsetX { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证数据
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.验证数据))]
|
||||
public string VerifyData { get; init; }
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建配置
|
||||
/// </summary>
|
||||
public record CreateConfigReq : Sys_Config
|
||||
{
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterConfirm" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool UserRegisterConfirm { get; set; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterDeptId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long UserRegisterDeptId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterRoleId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long UserRegisterRoleId { get; init; }
|
||||
}
|
20
src/backend/NetAdmin.Domain/Dto/Sys/Config/QueryConfigReq.cs
Normal file
20
src/backend/NetAdmin.Domain/Dto/Sys/Config/QueryConfigReq.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询配置
|
||||
/// </summary>
|
||||
public sealed record QueryConfigReq : Sys_Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public new bool? Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
44
src/backend/NetAdmin.Domain/Dto/Sys/Config/QueryConfigRsp.cs
Normal file
44
src/backend/NetAdmin.Domain/Dto/Sys/Config/QueryConfigRsp.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.Dept;
|
||||
using NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询配置
|
||||
/// </summary>
|
||||
public sealed record QueryConfigRsp : Sys_Config
|
||||
{
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterConfirm" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool UserRegisterConfirm { get; set; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterDept" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public new QueryDeptRsp UserRegisterDept { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterDeptId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long UserRegisterDeptId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterRole" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public new QueryRoleRsp UserRegisterRole { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Config.UserRegisterRoleId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long UserRegisterRoleId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新配置
|
||||
/// </summary>
|
||||
public sealed record UpdateConfigReq : CreateConfigReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
32
src/backend/NetAdmin.Domain/Dto/Sys/Dept/CreateDeptReq.cs
Normal file
32
src/backend/NetAdmin.Domain/Dto/Sys/Dept/CreateDeptReq.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建部门
|
||||
/// </summary>
|
||||
public record CreateDeptReq : Sys_Dept
|
||||
{
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Dept.Name" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.部门名称))]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Dept.ParentId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long ParentId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldSort.Sort" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Sort { get; init; } = Numbers.DEF_SORT_VAL;
|
||||
|
||||
/// <inheritdoc cref="IFieldSummary.Summary" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Summary { get; init; }
|
||||
}
|
14
src/backend/NetAdmin.Domain/Dto/Sys/Dept/QueryDeptReq.cs
Normal file
14
src/backend/NetAdmin.Domain/Dto/Sys/Dept/QueryDeptReq.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询部门
|
||||
/// </summary>
|
||||
public sealed record QueryDeptReq : Sys_Dept
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
47
src/backend/NetAdmin.Domain/Dto/Sys/Dept/QueryDeptRsp.cs
Normal file
47
src/backend/NetAdmin.Domain/Dto/Sys/Dept/QueryDeptRsp.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询部门
|
||||
/// </summary>
|
||||
public record QueryDeptRsp : Sys_Dept
|
||||
{
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
public new virtual IEnumerable<QueryDeptRsp> Children { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Dept.Name" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Dept.ParentId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long ParentId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldSort.Sort" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Sort { get; init; } = Numbers.DEF_SORT_VAL;
|
||||
|
||||
/// <inheritdoc cref="IFieldSummary.Summary" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Summary { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
17
src/backend/NetAdmin.Domain/Dto/Sys/Dept/UpdateDeptReq.cs
Normal file
17
src/backend/NetAdmin.Domain/Dto/Sys/Dept/UpdateDeptReq.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dept;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新部门
|
||||
/// </summary>
|
||||
public sealed record UpdateDeptReq : CreateDeptReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{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; }
|
||||
}
|
22
src/backend/NetAdmin.Domain/Dto/Sys/Dev/GenerateCsCodeReq.cs
Normal file
22
src/backend/NetAdmin.Domain/Dto/Sys/Dev/GenerateCsCodeReq.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dev;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:生成后端代码
|
||||
/// </summary>
|
||||
public sealed record GenerateCsCodeReq : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 模块名称
|
||||
/// </summary>
|
||||
public string ModuleName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 模块说明
|
||||
/// </summary>
|
||||
public string ModuleRemark { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 模块类型
|
||||
/// </summary>
|
||||
public ModuleTypes Type { get; init; }
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dev;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:生成图标代码
|
||||
/// </summary>
|
||||
public sealed record GenerateIconCodeReq : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 图标名称
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.图标名称))]
|
||||
public string IconName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标代码
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.图标代码))]
|
||||
public string SvgCode { get; init; }
|
||||
}
|
39
src/backend/NetAdmin.Domain/Dto/Sys/Dev/IconExportJsInfo.cs
Normal file
39
src/backend/NetAdmin.Domain/Dto/Sys/Dev/IconExportJsInfo.cs
Normal file
@ -0,0 +1,39 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dev;
|
||||
|
||||
/// <summary>
|
||||
/// IconExportJsInfo
|
||||
/// </summary>
|
||||
public sealed record IconExportJsInfo : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// ExportDefault
|
||||
/// </summary>
|
||||
public ExportDefaultRecord ExportDefault { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// ExportDefaultRecord
|
||||
/// </summary>
|
||||
public sealed record ExportDefaultRecord
|
||||
{
|
||||
/// <summary>
|
||||
/// Icons
|
||||
/// </summary>
|
||||
public IEnumerable<IconsItem> Icons { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IconsItem
|
||||
/// </summary>
|
||||
public sealed record IconsItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Icons
|
||||
/// </summary>
|
||||
public ICollection<string> Icons { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Name
|
||||
/// </summary>
|
||||
public string Name { get; init; }
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Catalog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建字典目录
|
||||
/// </summary>
|
||||
public record CreateDicCatalogReq : Sys_DicCatalog
|
||||
{
|
||||
/// <inheritdoc cref="Sys_DicCatalog.Code" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.字典编码))]
|
||||
public override string Code { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_DicCatalog.Name" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.字典名称))]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_DicCatalog.ParentId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long ParentId { get; init; }
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Catalog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询字典目录
|
||||
/// </summary>
|
||||
public sealed record QueryDicCatalogReq : Sys_DicCatalog;
|
@ -0,0 +1,35 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Catalog;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询字典目录
|
||||
/// </summary>
|
||||
public sealed record QueryDicCatalogRsp : Sys_DicCatalog
|
||||
{
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
public new IEnumerable<QueryDicCatalogRsp> Children { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_DicCatalog.Code" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Code { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_DicCatalog.Name" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_DicCatalog.ParentId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long ParentId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Catalog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新字典目录
|
||||
/// </summary>
|
||||
public sealed record UpdateDicCatalogReq : CreateDicCatalogReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建字典内容
|
||||
/// </summary>
|
||||
public record CreateDicContentReq : Sys_DicContent
|
||||
{
|
||||
/// <inheritdoc cref="Sys_DicContent.CatalogId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.字典目录编号))]
|
||||
public override long CatalogId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_DicContent.Key" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.键名称))]
|
||||
public override string Key { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_DicContent.Value" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.键值))]
|
||||
public override string Value { get; init; }
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询字典内容
|
||||
/// </summary>
|
||||
public sealed record QueryDicContentReq : Sys_DicContent;
|
@ -0,0 +1,30 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询字典内容
|
||||
/// </summary>
|
||||
public sealed record QueryDicContentRsp : Sys_DicContent
|
||||
{
|
||||
/// <inheritdoc cref="Sys_DicContent.CatalogId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long CatalogId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_DicContent.Key" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Key { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_DicContent.Value" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Value { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新字典内容
|
||||
/// </summary>
|
||||
public sealed record UpdateDicContentReq : CreateDicContentReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
72
src/backend/NetAdmin.Domain/Dto/Sys/Menu/CreateMenuReq.cs
Normal file
72
src/backend/NetAdmin.Domain/Dto/Sys/Menu/CreateMenuReq.cs
Normal file
@ -0,0 +1,72 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Menu;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建菜单
|
||||
/// </summary>
|
||||
public record CreateMenuReq : Sys_Menu
|
||||
{
|
||||
/// <inheritdoc cref="Sys_Menu.Active" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Active { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Color" />
|
||||
public override string Color => Meta.Color;
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Component" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Component { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.FullPageRouting" />
|
||||
public override bool FullPageRouting => Meta.FullPage;
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Hidden" />
|
||||
public override bool Hidden => Meta.Hidden;
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.HiddenBreadCrumb" />
|
||||
public override bool HiddenBreadCrumb => Meta.HiddenBreadCrumb;
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Icon" />
|
||||
public override string Icon => Meta.Icon;
|
||||
|
||||
/// <summary>
|
||||
/// 元数据
|
||||
/// </summary>
|
||||
public MetaInfo Meta { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Name" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.菜单名称))]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.ParentId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long ParentId { get; init; } = 0;
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Path" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Path { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Redirect" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Redirect { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldSort.Sort" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Sort { get; init; } = Numbers.DEF_SORT_VAL;
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Tag" />
|
||||
public override string Tag => Meta.Tag;
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Title" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.菜单标题))]
|
||||
public override string Title => Meta.Title;
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Type" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override MenuTypes Type => Meta.Type;
|
||||
}
|
71
src/backend/NetAdmin.Domain/Dto/Sys/Menu/MetaInfo.cs
Normal file
71
src/backend/NetAdmin.Domain/Dto/Sys/Menu/MetaInfo.cs
Normal file
@ -0,0 +1,71 @@
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Menu;
|
||||
|
||||
/// <summary>
|
||||
/// 信息:元数据
|
||||
/// </summary>
|
||||
public sealed record MetaInfo : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MetaInfo" /> class.
|
||||
/// </summary>
|
||||
public MetaInfo() { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MetaInfo" /> class.
|
||||
/// </summary>
|
||||
public MetaInfo(string color, bool fullPage, bool hidden, bool hiddenBreadCrumb, string icon, string tag
|
||||
, string title, MenuTypes type)
|
||||
{
|
||||
Color = color;
|
||||
FullPage = fullPage;
|
||||
Hidden = hidden;
|
||||
HiddenBreadCrumb = hiddenBreadCrumb;
|
||||
Icon = icon;
|
||||
Tag = tag;
|
||||
Title = title;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
public string Color { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否整页路由
|
||||
/// </summary>
|
||||
public bool FullPage { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否隐藏
|
||||
/// </summary>
|
||||
public bool Hidden { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否隐藏面包屑
|
||||
/// </summary>
|
||||
public bool HiddenBreadCrumb { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public string Icon { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签
|
||||
/// </summary>
|
||||
public string Tag { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
public string Title { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(MenuTypes))]
|
||||
public MenuTypes Type { get; init; }
|
||||
}
|
14
src/backend/NetAdmin.Domain/Dto/Sys/Menu/QueryMenuReq.cs
Normal file
14
src/backend/NetAdmin.Domain/Dto/Sys/Menu/QueryMenuReq.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Menu;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询菜单
|
||||
/// </summary>
|
||||
public sealed record QueryMenuReq : Sys_Menu
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
78
src/backend/NetAdmin.Domain/Dto/Sys/Menu/QueryMenuRsp.cs
Normal file
78
src/backend/NetAdmin.Domain/Dto/Sys/Menu/QueryMenuRsp.cs
Normal file
@ -0,0 +1,78 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Menu;
|
||||
|
||||
/// <summary>
|
||||
/// 信息:菜单
|
||||
/// </summary>
|
||||
public sealed record QueryMenuRsp : Sys_Menu, IRegister
|
||||
{
|
||||
/// <summary>
|
||||
/// 元数据
|
||||
/// </summary>
|
||||
public MetaInfo Meta => new(Color, FullPageRouting, Hidden, HiddenBreadCrumb, Icon, Tag, Title, Type);
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Active" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Active { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
public new IEnumerable<QueryMenuRsp> Children { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Component" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Component { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.FullPageRouting" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool FullPageRouting { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Hidden" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Hidden { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.HiddenBreadCrumb" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool HiddenBreadCrumb { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Name" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.ParentId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long ParentId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Path" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Path { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Menu.Redirect" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Redirect { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldSort.Sort" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Sort { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<Sys_Menu, QueryMenuRsp>() //
|
||||
.Map(d => d.Path, s => s.Path ?? string.Empty)
|
||||
|
||||
//
|
||||
;
|
||||
}
|
||||
}
|
17
src/backend/NetAdmin.Domain/Dto/Sys/Menu/UpdateMenuReq.cs
Normal file
17
src/backend/NetAdmin.Domain/Dto/Sys/Menu/UpdateMenuReq.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Menu;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新菜单
|
||||
/// </summary>
|
||||
public sealed record UpdateMenuReq : CreateMenuReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{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,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.RequestLog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建请求日志
|
||||
/// </summary>
|
||||
public sealed record CreateRequestLogReq : Sys_RequestLog;
|
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.RequestLog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询请求日志
|
||||
/// </summary>
|
||||
public sealed record QueryRequestLogReq : Sys_RequestLog;
|
@ -0,0 +1,106 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.RequestLog;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询请求日志
|
||||
/// </summary>
|
||||
public sealed record QueryRequestLogRsp : Sys_RequestLog, IRegister
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作系统
|
||||
/// </summary>
|
||||
public string Os => UserAgentParser.Create(CreatedUserAgent).Platform;
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ApiId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ApiId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 接口描述
|
||||
/// </summary>
|
||||
public string ApiSummary { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.CreatedClientIp" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override int? CreatedClientIp { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.CreatedUserAgent" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string CreatedUserAgent { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedUser.CreatedUserName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string CreatedUserName { get; set; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.Duration" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Duration { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ErrorCode" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override ErrorCodes ErrorCode { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.Exception" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Exception { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ExtraData" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ExtraData { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.HttpStatusCode" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override int HttpStatusCode { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.Method" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Method { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ReferUrl" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ReferUrl { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.RequestBody" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string RequestBody { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.RequestContentType" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string RequestContentType { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.RequestHeaders" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string RequestHeaders { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.RequestUrl" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string RequestUrl { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ResponseBody" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ResponseBody { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ResponseContentType" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ResponseContentType { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ResponseHeaders" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ResponseHeaders { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ServerIp" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override int? ServerIp { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<Sys_RequestLog, QueryRequestLogRsp>().Map(dest => dest.ApiSummary, src => src.Api.Summary);
|
||||
}
|
||||
}
|
57
src/backend/NetAdmin.Domain/Dto/Sys/Role/CreateRoleReq.cs
Normal file
57
src/backend/NetAdmin.Domain/Dto/Sys/Role/CreateRoleReq.cs
Normal file
@ -0,0 +1,57 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建角色
|
||||
/// </summary>
|
||||
public record CreateRoleReq : Sys_Role
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色-接口映射
|
||||
/// </summary>
|
||||
public IReadOnlyCollection<string> ApiIds { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Role.DataScope" />
|
||||
[EnumDataType(typeof(DataScopes))]
|
||||
public override DataScopes DataScope { get; init; } = DataScopes.All;
|
||||
|
||||
/// <summary>
|
||||
/// 当 DataScope = SpecificDept ,此参数指定部门编号
|
||||
/// </summary>
|
||||
[SpecificDept]
|
||||
public IReadOnlyCollection<long> DeptIds { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Role.DisplayDashboard" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool DisplayDashboard { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Role.IgnorePermissionControl" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool IgnorePermissionControl { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色-菜单映射
|
||||
/// </summary>
|
||||
public IReadOnlyCollection<long> MenuIds { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Role.Name" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.角色名称))]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldSort.Sort" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Sort { get; init; } = Numbers.DEF_SORT_VAL;
|
||||
|
||||
/// <inheritdoc cref="IFieldSummary.Summary" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Summary { get; init; }
|
||||
}
|
17
src/backend/NetAdmin.Domain/Dto/Sys/Role/GetMenusRsp.cs
Normal file
17
src/backend/NetAdmin.Domain/Dto/Sys/Role/GetMenusRsp.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
/// <summary>
|
||||
/// 响应: 获取角色菜单
|
||||
/// </summary>
|
||||
public sealed record GetMenusRsp : Sys_RoleMenu
|
||||
{
|
||||
/// <inheritdoc cref="Sys_RoleMenu.MenuId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long MenuId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RoleMenu.RoleId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long RoleId { get; init; }
|
||||
}
|
21
src/backend/NetAdmin.Domain/Dto/Sys/Role/MapMenusReq.cs
Normal file
21
src/backend/NetAdmin.Domain/Dto/Sys/Role/MapMenusReq.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:角色-菜单映射
|
||||
/// </summary>
|
||||
public sealed record MapMenusReq : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 菜单编号
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.菜单编号))]
|
||||
public IReadOnlyCollection<long> MenuIds { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色编号
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.角色编号))]
|
||||
public long RoleId { get; init; }
|
||||
}
|
14
src/backend/NetAdmin.Domain/Dto/Sys/Role/QueryRoleReq.cs
Normal file
14
src/backend/NetAdmin.Domain/Dto/Sys/Role/QueryRoleReq.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询角色
|
||||
/// </summary>
|
||||
public sealed record QueryRoleReq : Sys_Role
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
84
src/backend/NetAdmin.Domain/Dto/Sys/Role/QueryRoleRsp.cs
Normal file
84
src/backend/NetAdmin.Domain/Dto/Sys/Role/QueryRoleRsp.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询角色
|
||||
/// </summary>
|
||||
public sealed record QueryRoleRsp : Sys_Role, IRegister
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色-接口映射
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public IReadOnlyCollection<string> ApiIds { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Role.DataScope" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DataScopes DataScope { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色-部门映射
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public IEnumerable<long> DeptIds { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Role.DisplayDashboard" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool DisplayDashboard { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{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; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色-菜单映射
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public IReadOnlyCollection<long> MenuIds { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_Role.Name" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Name { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldSort.Sort" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Sort { get; init; } = Numbers.DEF_SORT_VAL;
|
||||
|
||||
/// <inheritdoc cref="IFieldSummary.Summary" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Summary { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public new void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<Sys_Role, QueryRoleRsp>() //
|
||||
.IgnoreIf((s, _) => s.Depts == null, d => d.DeptIds)
|
||||
.IgnoreIf((s, _) => s.Menus == null, d => d.MenuIds)
|
||||
.IgnoreIf((s, _) => s.Apis == null, d => d.ApiIds)
|
||||
.Map(d => d.DeptIds, s => s.Depts.Select(x => x.Id))
|
||||
.Map(d => d.ApiIds, s => s.Apis.Select(x => x.Id))
|
||||
.Map(d => d.MenuIds, s => s.Menus.Select(x => x.Id))
|
||||
|
||||
//
|
||||
;
|
||||
}
|
||||
}
|
20
src/backend/NetAdmin.Domain/Dto/Sys/Role/UpdateRoleReq.cs
Normal file
20
src/backend/NetAdmin.Domain/Dto/Sys/Role/UpdateRoleReq.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:修改角色
|
||||
/// </summary>
|
||||
public sealed record UpdateRoleReq : CreateRoleReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.唯一编码))]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.数据版本))]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:检查手机号是否可用
|
||||
/// </summary>
|
||||
public sealed record CheckMobileAvailableReq : Sys_User
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Mobile" />
|
||||
[Mobile]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Mobile { get; init; }
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:检查用户名是否可用
|
||||
/// </summary>
|
||||
public sealed record CheckUserNameAvailableReq : Sys_User
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.UserName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.用户名))]
|
||||
[UserName]
|
||||
public override string UserName { get; init; }
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建更新用户
|
||||
/// </summary>
|
||||
public abstract record CreateUpdateUserReq : Sys_User
|
||||
{
|
||||
/// <inheritdoc cref="Sys_User.Avatar" />
|
||||
[CultureUrl]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Avatar { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.DeptId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long DeptId { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Email" />
|
||||
[EmailAddress]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Email { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Mobile" />
|
||||
[Mobile]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Mobile { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录密码
|
||||
/// </summary>
|
||||
[Password]
|
||||
public virtual string PasswordText { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色编号列表
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.角色编号列表))]
|
||||
[MinLength(1)]
|
||||
[MaxLength(Numbers.BULK_REQ_LIMIT)]
|
||||
public IReadOnlyCollection<long> RoleIds { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Summary" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Summary { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.UserName" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.用户名))]
|
||||
[UserName]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string UserName { get; init; }
|
||||
}
|
29
src/backend/NetAdmin.Domain/Dto/Sys/User/CreateUserReq.cs
Normal file
29
src/backend/NetAdmin.Domain/Dto/Sys/User/CreateUserReq.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建用户
|
||||
/// </summary>
|
||||
public record CreateUserReq : CreateUpdateUserReq, IRegister
|
||||
{
|
||||
/// <inheritdoc cref="CreateUpdateUserReq.PasswordText" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.密码))]
|
||||
public override string PasswordText { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Profile" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.用户档案))]
|
||||
public new CreateUserProfileReq Profile { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public new void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<RegisterUserReq, CreateUserReq>() //
|
||||
.Map(d => d.Mobile, s => s.VerifySmsCodeReq.DestDevice)
|
||||
|
||||
//
|
||||
;
|
||||
}
|
||||
}
|
20
src/backend/NetAdmin.Domain/Dto/Sys/User/LoginByPwdReq.cs
Normal file
20
src/backend/NetAdmin.Domain/Dto/Sys/User/LoginByPwdReq.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:密码登录
|
||||
/// </summary>
|
||||
public record LoginByPwdReq : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户名、手机号、邮箱
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.账号))]
|
||||
public string Account { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Password" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.密码))]
|
||||
public string Password { get; init; }
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:短信登录
|
||||
/// </summary>
|
||||
public record LoginBySmsReq : VerifySmsCodeReq;
|
27
src/backend/NetAdmin.Domain/Dto/Sys/User/LoginRsp.cs
Normal file
27
src/backend/NetAdmin.Domain/Dto/Sys/User/LoginRsp.cs
Normal file
@ -0,0 +1,27 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:密码登录
|
||||
/// </summary>
|
||||
public record LoginRsp : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 访问令牌
|
||||
/// </summary>
|
||||
public string AccessToken { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 刷新令牌
|
||||
/// </summary>
|
||||
public string RefreshToken { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 设置到响应头
|
||||
/// </summary>
|
||||
public void SetToRspHeader()
|
||||
{
|
||||
// 设置响应报文头
|
||||
App.HttpContext.Response.Headers[Chars.FLG_ACCESS_TOKEN] = AccessToken;
|
||||
App.HttpContext.Response.Headers[Chars.FLG_X_ACCESS_TOKEN] = RefreshToken;
|
||||
}
|
||||
}
|
26
src/backend/NetAdmin.Domain/Dto/Sys/User/QueryUserReq.cs
Normal file
26
src/backend/NetAdmin.Domain/Dto/Sys/User/QueryUserReq.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询用户
|
||||
/// </summary>
|
||||
public sealed record QueryUserReq : Sys_User
|
||||
{
|
||||
/// <summary>
|
||||
/// 部门编号
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long DeptId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色编号
|
||||
/// </summary>
|
||||
public long RoleId { get; init; }
|
||||
}
|
58
src/backend/NetAdmin.Domain/Dto/Sys/User/QueryUserRsp.cs
Normal file
58
src/backend/NetAdmin.Domain/Dto/Sys/User/QueryUserRsp.cs
Normal file
@ -0,0 +1,58 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.Dept;
|
||||
using NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询用户
|
||||
/// </summary>
|
||||
public record QueryUserRsp : Sys_User
|
||||
{
|
||||
/// <inheritdoc cref="Sys_User.Avatar" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Avatar { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门
|
||||
/// </summary>
|
||||
public new virtual QueryDeptRsp Dept { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Email" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Email { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldEnabled.Enabled" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override bool Enabled { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Mobile" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Mobile { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色列表
|
||||
/// </summary>
|
||||
public new virtual IEnumerable<QueryRoleRsp> Roles { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Summary" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Summary { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.UserName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string UserName { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
39
src/backend/NetAdmin.Domain/Dto/Sys/User/RegisterUserReq.cs
Normal file
39
src/backend/NetAdmin.Domain/Dto/Sys/User/RegisterUserReq.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:注册用户
|
||||
/// </summary>
|
||||
public record RegisterUserReq : Sys_User
|
||||
{
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.密码))]
|
||||
[Password]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public virtual string PasswordText { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色编号列表
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public IReadOnlyCollection<long> RoleIds { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.用户名))]
|
||||
[UserName]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string UserName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 短信验证请求
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.短信验证请求))]
|
||||
public VerifySmsCodeReq VerifySmsCodeReq { get; set; }
|
||||
}
|
23
src/backend/NetAdmin.Domain/Dto/Sys/User/ResetPasswordReq.cs
Normal file
23
src/backend/NetAdmin.Domain/Dto/Sys/User/ResetPasswordReq.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:重置密码
|
||||
/// </summary>
|
||||
public sealed record ResetPasswordReq : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.密码))]
|
||||
[Password]
|
||||
public string PasswordText { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 短信验证请求
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.短信验证请求))]
|
||||
public VerifySmsCodeReq VerifySmsCodeReq { get; init; }
|
||||
}
|
16
src/backend/NetAdmin.Domain/Dto/Sys/User/SetAvatarReq.cs
Normal file
16
src/backend/NetAdmin.Domain/Dto/Sys/User/SetAvatarReq.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新用户头像
|
||||
/// </summary>
|
||||
public sealed record SetAvatarReq : Sys_User
|
||||
{
|
||||
/// <inheritdoc cref="Sys_User.Avatar" />
|
||||
[CultureUrl]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.用户头像))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Avatar { get; init; }
|
||||
}
|
14
src/backend/NetAdmin.Domain/Dto/Sys/User/SetEmailReq.cs
Normal file
14
src/backend/NetAdmin.Domain/Dto/Sys/User/SetEmailReq.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:设置邮箱
|
||||
/// </summary>
|
||||
public sealed record SetEmailReq : VerifyEmailCodeReq
|
||||
{
|
||||
/// <summary>
|
||||
/// 短信验证请求
|
||||
/// </summary>
|
||||
public VerifySmsCodeReq VerifySmsCodeReq { get; init; }
|
||||
}
|
21
src/backend/NetAdmin.Domain/Dto/Sys/User/SetMobileReq.cs
Normal file
21
src/backend/NetAdmin.Domain/Dto/Sys/User/SetMobileReq.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:设置手机号
|
||||
/// </summary>
|
||||
public sealed record SetMobileReq : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 新手机短信验证请求
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.短信验证请求))]
|
||||
public VerifySmsCodeReq NewVerifySmsCodeReq { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 原手机短信验证请求
|
||||
/// </summary>
|
||||
public VerifySmsCodeReq OriginVerifySmsCodeReq { get; init; }
|
||||
}
|
23
src/backend/NetAdmin.Domain/Dto/Sys/User/SetPasswordReq.cs
Normal file
23
src/backend/NetAdmin.Domain/Dto/Sys/User/SetPasswordReq.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:设置密码
|
||||
/// </summary>
|
||||
public sealed record SetPasswordReq : DataAbstraction
|
||||
{
|
||||
/// <summary>
|
||||
/// 新密码
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.新密码))]
|
||||
[Password]
|
||||
public string NewPassword { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 旧密码
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.旧密码))]
|
||||
[Password]
|
||||
public string OldPassword { get; init; }
|
||||
}
|
24
src/backend/NetAdmin.Domain/Dto/Sys/User/UpdateUserReq.cs
Normal file
24
src/backend/NetAdmin.Domain/Dto/Sys/User/UpdateUserReq.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新用户
|
||||
/// </summary>
|
||||
public sealed record UpdateUserReq : CreateUpdateUserReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_User.Profile" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.用户档案))]
|
||||
public new UpdateUserProfileReq Profile { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
28
src/backend/NetAdmin.Domain/Dto/Sys/User/UserInfoRsp.cs
Normal file
28
src/backend/NetAdmin.Domain/Dto/Sys/User/UserInfoRsp.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.Dept;
|
||||
using NetAdmin.Domain.Dto.Sys.Role;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.User;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:当前用户信息
|
||||
/// </summary>
|
||||
public record UserInfoRsp : QueryUserRsp, IRegister
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override QueryDeptRsp Dept { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override IEnumerable<QueryRoleRsp> Roles { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public new void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<Sys_User, UserInfoRsp>() //
|
||||
.IgnoreIf((s, _) => s.Mobile == null, d => d.Mobile)
|
||||
.Map(d => d.Mobile, s => s.Mobile.MaskMobile())
|
||||
|
||||
//
|
||||
;
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建用户档案
|
||||
/// </summary>
|
||||
public record CreateUserProfileReq : Sys_UserProfile
|
||||
{
|
||||
/// <inheritdoc cref="Sys_UserProfile.BornDate" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DateTime? BornDate { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CertificateNumber" />
|
||||
[Certificate]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string CertificateNumber { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CertificateType" />
|
||||
[EnumDataType(typeof(CertificateTypes))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override CertificateTypes? CertificateType { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CompanyAddress" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string CompanyAddress { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 工作地区
|
||||
/// </summary>
|
||||
public new QueryDicContentRsp CompanyArea { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CompanyName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string CompanyName { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CompanyTelephone" />
|
||||
[Telephone]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string CompanyTelephone { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Education" />
|
||||
[EnumDataType(typeof(Educations))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override Educations? Education { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.EmergencyContactAddress" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string EmergencyContactAddress { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 紧急联系地区
|
||||
/// </summary>
|
||||
public new QueryDicContentRsp EmergencyContactArea { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.EmergencyContactMobile" />
|
||||
[Mobile]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string EmergencyContactMobile { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.EmergencyContactName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string EmergencyContactName { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.GraduateSchool" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string GraduateSchool { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Height" />
|
||||
[Range(100, 250)]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override int? Height { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.HomeAddress" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string HomeAddress { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 住宅地区
|
||||
/// </summary>
|
||||
public new QueryDicContentRsp HomeArea { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.HomeTelephone" />
|
||||
[Telephone]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string HomeTelephone { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.MarriageStatus" />
|
||||
[EnumDataType(typeof(MarriageStatues))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override MarriageStatues? MarriageStatus { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Nation" />
|
||||
[EnumDataType(typeof(Nations))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override Nations? Nation { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 籍贯
|
||||
/// </summary>
|
||||
public new CreateDicContentReq NationArea { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.PoliticalStatus" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[EnumDataType(typeof(PoliticalStatues))]
|
||||
public override PoliticalStatues? PoliticalStatus { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Profession" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Profession { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.RealName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string RealName { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Sex" />
|
||||
[EnumDataType(typeof(Sexes))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override Sexes? Sex { get; init; }
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询用户档案
|
||||
/// </summary>
|
||||
public sealed record QueryUserProfileReq : Sys_UserProfile
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.Dic.Content;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询用户档案
|
||||
/// </summary>
|
||||
public sealed record QueryUserProfileRsp : Sys_UserProfile
|
||||
{
|
||||
/// <inheritdoc cref="Sys_UserProfile.BornDate" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override DateTime? BornDate { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CertificateNumber" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string CertificateNumber { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CertificateType" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override CertificateTypes? CertificateType { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CompanyAddress" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string CompanyAddress { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 工作地区
|
||||
/// </summary>
|
||||
public new QueryDicContentRsp CompanyArea { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CompanyName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string CompanyName { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.CompanyTelephone" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string CompanyTelephone { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Education" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override Educations? Education { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.EmergencyContactAddress" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string EmergencyContactAddress { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 紧急联系地区
|
||||
/// </summary>
|
||||
public new QueryDicContentRsp EmergencyContactArea { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.EmergencyContactMobile" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string EmergencyContactMobile { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.EmergencyContactName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string EmergencyContactName { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.GraduateSchool" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string GraduateSchool { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Height" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override int? Height { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.HomeAddress" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string HomeAddress { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 住宅地区
|
||||
/// </summary>
|
||||
public new QueryDicContentRsp HomeArea { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.HomeTelephone" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string HomeTelephone { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.MarriageStatus" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override MarriageStatues? MarriageStatus { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Nation" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override Nations? Nation { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 籍贯
|
||||
/// </summary>
|
||||
public new QueryDicContentRsp NationArea { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.PoliticalStatus" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override PoliticalStatues? PoliticalStatus { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Profession" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Profession { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.RealName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string RealName { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_UserProfile.Sex" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override Sexes? Sex { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.UserProfile;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新用户档案
|
||||
/// </summary>
|
||||
public sealed record UpdateUserProfileReq : CreateUserProfileReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建验证码
|
||||
/// </summary>
|
||||
public record CreateVerifyCodeReq : Sys_VerifyCode;
|
@ -0,0 +1,14 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询验证码
|
||||
/// </summary>
|
||||
public sealed record QueryVerifyCodeReq : Sys_VerifyCode
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询验证码
|
||||
/// </summary>
|
||||
public sealed record QueryVerifyCodeRsp : Sys_VerifyCode
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{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,64 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.Captcha;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:发送验证码
|
||||
/// </summary>
|
||||
public sealed record SendVerifyCodeReq : Sys_VerifyCode, IValidatableObject
|
||||
{
|
||||
/// <inheritdoc cref="Sys_VerifyCode.DestDevice" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.目标设备))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string DestDevice { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_VerifyCode.DeviceType" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.设备类型))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[EnumDataType(typeof(VerifyCodeDeviceTypes))]
|
||||
public override VerifyCodeDeviceTypes DeviceType { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_VerifyCode.Status" />
|
||||
public override VerifyCodeStatues Status => VerifyCodeStatues.Waiting;
|
||||
|
||||
/// <inheritdoc cref="Sys_VerifyCode.Type" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.验证码类型))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[EnumDataType(typeof(VerifyCodeTypes))]
|
||||
public override VerifyCodeTypes Type { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 人机校验请求
|
||||
/// </summary>
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.人机校验请求))]
|
||||
public VerifyCaptchaReq VerifyCaptchaReq { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
ValidationResult validationResult;
|
||||
switch (DeviceType) {
|
||||
case VerifyCodeDeviceTypes.Email:
|
||||
validationResult = new EmailAttribute().GetValidationResult(DestDevice, validationContext);
|
||||
if (validationResult == null) {
|
||||
yield break;
|
||||
}
|
||||
|
||||
yield return new ValidationResult(validationResult.ErrorMessage, new[] { nameof(DestDevice) });
|
||||
break;
|
||||
case VerifyCodeDeviceTypes.Mobile:
|
||||
validationResult = new MobileAttribute().GetValidationResult(DestDevice, validationContext);
|
||||
if (validationResult == null) {
|
||||
yield break;
|
||||
}
|
||||
|
||||
yield return new ValidationResult(validationResult.ErrorMessage, new[] { nameof(DestDevice) });
|
||||
break;
|
||||
default:
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:发送验证码
|
||||
/// </summary>
|
||||
public sealed record SendVerifyCodeRsp : Sys_VerifyCode
|
||||
{
|
||||
#if DEBUG
|
||||
/// <inheritdoc cref="Sys_VerifyCode.Code" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override string Code { get; init; }
|
||||
#endif
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新验证码
|
||||
/// </summary>
|
||||
public sealed record UpdateVerifyCodeReq : CreateVerifyCodeReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:核实验证码
|
||||
/// </summary>
|
||||
public abstract record VerifyCodeReq : Sys_VerifyCode
|
||||
{
|
||||
/// <inheritdoc cref="Sys_VerifyCode.Code" />
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.验证码))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[VerifyCode]
|
||||
public override string Code { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_VerifyCode.DestDevice" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
[CultureRequired(ErrorMessageResourceType = typeof(Ln), ErrorMessageResourceName = nameof(Ln.目标设备))]
|
||||
public override string DestDevice { get; init; }
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:核实邮箱验证码
|
||||
/// </summary>
|
||||
public record VerifyEmailCodeReq : VerifyCodeReq
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[Email]
|
||||
public override string DestDevice { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
public override VerifyCodeDeviceTypes DeviceType { get; init; } = VerifyCodeDeviceTypes.Email;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using NetAdmin.Domain.Attributes.DataValidation;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:核实短信验证码
|
||||
/// </summary>
|
||||
public record VerifySmsCodeReq : VerifyCodeReq
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[Mobile]
|
||||
public override string DestDevice { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
public override VerifyCodeDeviceTypes DeviceType { get; init; } = VerifyCodeDeviceTypes.Mobile;
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Tpl;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Tpl.Example;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建示例
|
||||
/// </summary>
|
||||
public record CreateExampleReq : Tpl_Example;
|
@ -0,0 +1,14 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Tpl;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Tpl.Example;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询示例
|
||||
/// </summary>
|
||||
public sealed record QueryExampleReq : Tpl_Example
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Tpl;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Tpl.Example;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询示例
|
||||
/// </summary>
|
||||
public sealed record QueryExampleRsp : Tpl_Example
|
||||
{
|
||||
/// <inheritdoc cref="IFieldPrimary{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.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Tpl.Example;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:更新示例
|
||||
/// </summary>
|
||||
public sealed record UpdateExampleReq : CreateExampleReq
|
||||
{
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
Reference in New Issue
Block a user