mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-13 19:52:27 +08:00
feat: ✨ 基础模块
注册登录 用户管理 角色管理 部门管理 消息管理 接口管理 菜单管理 字典管理 缓存管理 请求日志 系统设置 版本信息 代码生成
This commit is contained in:
@ -3,14 +3,10 @@ using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 不可变实体
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public abstract record ImmutableEntity : ImmutableEntity<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Snowflake]
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override long Id { get; init; }
|
||||
@ -19,26 +15,20 @@ public abstract record ImmutableEntity : ImmutableEntity<long>
|
||||
/// <summary>
|
||||
/// 不可变实体
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <typeparam name="T">主键类型</typeparam>
|
||||
public abstract record ImmutableEntity<T> : LiteImmutableEntity<T>, IFieldCreatedUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建者编号
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldCreatedUser.CreatedUserId" />
|
||||
[JsonIgnore]
|
||||
[Column(CanUpdate = false, Position = -1)]
|
||||
public long? CreatedUserId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者用户名
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldCreatedUser.CreatedUserName" />
|
||||
[JsonIgnore]
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanUpdate = false, Position = -1)]
|
||||
public virtual string CreatedUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
}
|
@ -3,14 +3,10 @@ using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 轻型不可变实体
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public abstract record LiteImmutableEntity : LiteImmutableEntity<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Snowflake]
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override long Id { get; init; }
|
||||
@ -19,19 +15,15 @@ public abstract record LiteImmutableEntity : LiteImmutableEntity<long>
|
||||
/// <summary>
|
||||
/// 轻型不可变实体
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <typeparam name="T">主键类型</typeparam>
|
||||
public abstract record LiteImmutableEntity<T> : EntityBase, IFieldPrimary<T>, IFieldCreatedTime
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore]
|
||||
[Column(ServerTime = DateTimeKind.Utc, CanUpdate = false, Position = -1)]
|
||||
public virtual DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[JsonIgnore]
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public virtual T Id { get; init; }
|
||||
|
@ -3,14 +3,10 @@ using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 轻型可变实体
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public abstract record LiteMutableEntity : LiteMutableEntity<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Snowflake]
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override long Id { get; init; }
|
||||
@ -21,15 +17,11 @@ public abstract record LiteMutableEntity : LiteMutableEntity<long>
|
||||
/// </summary>
|
||||
public abstract record LiteMutableEntity<T> : LiteImmutableEntity<T>, IFieldModifiedTime
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldModifiedTime.ModifiedTime" />
|
||||
[JsonIgnore]
|
||||
[Column(ServerTime = DateTimeKind.Utc, CanInsert = false, Position = -1)]
|
||||
public virtual DateTime? ModifiedTime { get; init; }
|
||||
|
@ -3,14 +3,10 @@ using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 乐观锁轻型可变实体
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public abstract record LiteVersionEntity : LiteVersionEntity<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Snowflake]
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override long Id { get; init; }
|
||||
@ -21,15 +17,11 @@ public abstract record LiteVersionEntity : LiteVersionEntity<long>
|
||||
/// </summary>
|
||||
public abstract record LiteVersionEntity<T> : LiteMutableEntity<T>, IFieldVersion
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据版本
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore]
|
||||
[Column(IsVersion = true, Position = -1)]
|
||||
public virtual long Version { get; init; }
|
||||
|
@ -3,14 +3,10 @@ using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 可变实体
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public abstract record MutableEntity : MutableEntity<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Snowflake]
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override long Id { get; init; }
|
||||
@ -21,22 +17,16 @@ public abstract record MutableEntity : MutableEntity<long>
|
||||
/// </summary>
|
||||
public abstract record MutableEntity<T> : LiteMutableEntity<T>, IFieldModifiedUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者编号
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserId" />
|
||||
[JsonIgnore]
|
||||
[Column(CanInsert = false, Position = -1)]
|
||||
public long? ModifiedUserId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者用户名
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserName" />
|
||||
[JsonIgnore]
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanInsert = false, Position = -1)]
|
||||
public string ModifiedUserName { get; init; }
|
||||
|
@ -3,14 +3,10 @@ using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
|
||||
namespace NetAdmin.Domain.DbMaps.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 乐观锁可变实体
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public abstract record VersionEntity : VersionEntity<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Snowflake]
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override long Id { get; init; }
|
||||
@ -19,24 +15,28 @@ public abstract record VersionEntity : VersionEntity<long>
|
||||
/// <summary>
|
||||
/// 乐观锁可变实体
|
||||
/// </summary>
|
||||
public abstract record VersionEntity<T> : LiteVersionEntity<T>, IFieldModifiedUser
|
||||
public abstract record VersionEntity<T> : LiteVersionEntity<T>, IFieldModifiedUser, IFieldCreatedUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一编码
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
[Column(CanUpdate = false, Position = -1)]
|
||||
public long? CreatedUserId { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanUpdate = false, Position = -1)]
|
||||
public string CreatedUserName { get; set; }
|
||||
|
||||
/// <inheritdoc cref="IFieldPrimary{T}.Id" />
|
||||
[Column(IsIdentity = false, IsPrimary = true, Position = 1)]
|
||||
public override T Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者编号
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserId" />
|
||||
[JsonIgnore]
|
||||
[Column(CanInsert = false, Position = -1)]
|
||||
public long? ModifiedUserId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者用户名
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IFieldModifiedUser.ModifiedUserName" />
|
||||
[JsonIgnore]
|
||||
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_31, CanInsert = false, Position = -1)]
|
||||
public string ModifiedUserName { get; init; }
|
||||
|
Reference in New Issue
Block a user