+
+
-
-
+
\ No newline at end of file
+
diff --git a/frontend/demo/vite.config.js b/frontend/demo/vite.config.js
index b1c6147..ba175c3 100644
--- a/frontend/demo/vite.config.js
+++ b/frontend/demo/vite.config.js
@@ -30,5 +30,6 @@ export default defineConfig({
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
+ dedupe: ['vue']
},
})
--
Gitee
From 90b9f0bdbb45f61bdab09bb5c78a685d29c05c3b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=A2=E9=9B=A8=E6=99=B4?= <1207713896@qq.com>
Date: Wed, 23 Jul 2025 10:11:22 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E5=9C=A8=E5=9F=BA=E7=A1=80=E8=AE=BE?=
=?UTF-8?q?=E6=96=BD=E5=B1=82=E5=AE=9A=E4=B9=89=E6=95=B0=E6=8D=AE=E5=BA=93?=
=?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=96=87=EF=BC=8C=E7=94=9F=E6=88=90=E8=BF=81?=
=?UTF-8?q?=E7=A7=BB=E6=96=87=E4=BB=B6=E4=B8=94=E5=90=8C=E6=AD=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/BaseController.cs | 33 --
.../Controllers/UsersController.cs | 73 ----
backend/src/UniversalAdmin.Api/Program.cs | 37 +-
.../UniversalAdmin.Api.csproj | 9 +
.../Commands/CreateUserCommand.cs | 24 --
.../UniversalAdmin.Application.csproj | 5 +
.../Entities/App/AppPemission.cs | 22 -
.../Entities/App/AppPermission.cs | 17 +
.../Entities/App/AppRole.cs | 12 +-
...pRolePemission.cs => AppRolePermission.cs} | 10 +-
.../Entities/EntityBase.cs | 2 +-
.../Repositories/IRepository.cs | 2 +-
.../UniversalAdmin.Domain.csproj | 6 +
.../Data/UniversalDbContext.cs | 262 ++++++------
.../Events/MediatRDomainEventPublisher.cs | 25 ++
.../20250723015230_InitCreate.Designer.cs | 388 ++++++++++++++++++
.../Migrations/20250723015230_InitCreate.cs | 222 ++++++++++
.../UniversalDbContextModelSnapshot.cs | 385 +++++++++++++++++
.../Repositories/EfRepository.cs | 2 +-
.../ServiceCollectionExtensions.cs | 20 +-
.../{Security => Services}/PasswordHasher.cs | 5 +-
.../UniversalAdmin.Infrastructure.csproj | 6 +-
22 files changed, 1214 insertions(+), 353 deletions(-)
delete mode 100644 backend/src/UniversalAdmin.Api/Controllers/BaseController.cs
delete mode 100644 backend/src/UniversalAdmin.Api/Controllers/UsersController.cs
delete mode 100644 backend/src/UniversalAdmin.Application/Commands/CreateUserCommand.cs
delete mode 100644 backend/src/UniversalAdmin.Domain/Entities/App/AppPemission.cs
create mode 100644 backend/src/UniversalAdmin.Domain/Entities/App/AppPermission.cs
rename backend/src/UniversalAdmin.Domain/Entities/App/{AppRolePemission.cs => AppRolePermission.cs} (72%)
create mode 100644 backend/src/UniversalAdmin.Infrastructure/Events/MediatRDomainEventPublisher.cs
create mode 100644 backend/src/UniversalAdmin.Infrastructure/Migrations/20250723015230_InitCreate.Designer.cs
create mode 100644 backend/src/UniversalAdmin.Infrastructure/Migrations/20250723015230_InitCreate.cs
create mode 100644 backend/src/UniversalAdmin.Infrastructure/Migrations/UniversalDbContextModelSnapshot.cs
rename backend/src/UniversalAdmin.Infrastructure/{Security => Services}/PasswordHasher.cs (85%)
diff --git a/backend/src/UniversalAdmin.Api/Controllers/BaseController.cs b/backend/src/UniversalAdmin.Api/Controllers/BaseController.cs
deleted file mode 100644
index f3c688d..0000000
--- a/backend/src/UniversalAdmin.Api/Controllers/BaseController.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-namespace UniversalAdmin.Api.Controllers
-{
- [ApiController]
- [Route("api/[controller]")]
- [Authorize]
- public abstract class BaseController : ControllerBase
- {
- protected readonly IMediator _mediator;
-
- protected BaseController(IMediator mediator)
- {
- _mediator = mediator;
- }
-
- protected int CurrentUserId => int.Parse(User.FindFirst("sub")?.Value ?? "0");
- protected string CurrentUsername => User.FindFirst("username")?.Value ?? string.Empty;
-
- protected ActionResult
> Success(T data, string message = "success")
- {
- return Ok(ApiResult.Success(data, message));
- }
-
- protected ActionResult> Success(string message = "success")
- {
- return Ok(ApiResult.Success(default(T), message));
- }
-
- protected ActionResult> Error(string message, int code = 400)
- {
- return BadRequest(ApiResult.Failure(code, message));
- }
- }
-}
\ No newline at end of file
diff --git a/backend/src/UniversalAdmin.Api/Controllers/UsersController.cs b/backend/src/UniversalAdmin.Api/Controllers/UsersController.cs
deleted file mode 100644
index 82e2c32..0000000
--- a/backend/src/UniversalAdmin.Api/Controllers/UsersController.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-namespace UniversalAdmin.Api.Controllers
-{
- ///
- /// 用户管理控制器
- ///
- public class UsersController : BaseController
- {
- public UsersController(IMediator mediator) : base(mediator)
- {
- }
-
- ///
- /// 获取用户列表
- ///
- [HttpGet]
- public async Task>>> GetUsers(
- [FromQuery] GetUsersQuery query)
- {
- var result = await _mediator.Send(query);
- return Success(result);
- }
-
- ///
- /// 获取用户详情
- ///
- [HttpGet("{id}")]
- public async Task>> GetUser(int id)
- {
- var query = new GetUserByIdQuery { Id = id };
- var result = await _mediator.Send(query);
-
- if (result == null)
- return NotFound(ApiResult.Failure(404, "用户不存在"));
-
- return Success(result);
- }
-
- ///
- /// 创建用户
- ///
- [HttpPost]
- public async Task>> CreateUser(
- [FromBody] CreateUserCommand command)
- {
- var result = await _mediator.Send(command);
- return Success(result, "用户创建成功");
- }
-
- ///
- /// 更新用户
- ///
- [HttpPut("{id}")]
- public async Task>> UpdateUser(
- int id,
- [FromBody] UpdateUserCommand command)
- {
- command.Id = id;
- var result = await _mediator.Send(command);
- return Success(result, "用户更新成功");
- }
-
- ///
- /// 删除用户
- ///
- [HttpDelete("{id}")]
- public async Task>> DeleteUser(int id)
- {
- var command = new DeleteUserCommand { Id = id };
- await _mediator.Send(command);
- return Success(null, "用户删除成功");
- }
- }
-}
\ No newline at end of file
diff --git a/backend/src/UniversalAdmin.Api/Program.cs b/backend/src/UniversalAdmin.Api/Program.cs
index ee9d65d..00acb91 100644
--- a/backend/src/UniversalAdmin.Api/Program.cs
+++ b/backend/src/UniversalAdmin.Api/Program.cs
@@ -1,41 +1,10 @@
+using UniversalAdmin.Infrastructure;
var builder = WebApplication.CreateBuilder(args);
-// Add services to the container.
-// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
-builder.Services.AddOpenApi();
-
+//注册基础服务
+builder.Services.AddInfrastructure(builder.Configuration);
var app = builder.Build();
-// Configure the HTTP request pipeline.
-if (app.Environment.IsDevelopment())
-{
- app.MapOpenApi();
-}
-
-app.UseHttpsRedirection();
-var summaries = new[]
-{
- "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
-};
-
-app.MapGet("/weatherforecast", () =>
-{
- var forecast = Enumerable.Range(1, 5).Select(index =>
- new WeatherForecast
- (
- DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
- Random.Shared.Next(-20, 55),
- summaries[Random.Shared.Next(summaries.Length)]
- ))
- .ToArray();
- return forecast;
-})
-.WithName("GetWeatherForecast");
app.Run();
-
-record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
-{
- public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
-}
diff --git a/backend/src/UniversalAdmin.Api/UniversalAdmin.Api.csproj b/backend/src/UniversalAdmin.Api/UniversalAdmin.Api.csproj
index 2f6e7b3..ca999bf 100644
--- a/backend/src/UniversalAdmin.Api/UniversalAdmin.Api.csproj
+++ b/backend/src/UniversalAdmin.Api/UniversalAdmin.Api.csproj
@@ -10,7 +10,16 @@
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+
+
+
+
diff --git a/backend/src/UniversalAdmin.Application/Commands/CreateUserCommand.cs b/backend/src/UniversalAdmin.Application/Commands/CreateUserCommand.cs
deleted file mode 100644
index 44dfb9a..0000000
--- a/backend/src/UniversalAdmin.Application/Commands/CreateUserCommand.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using MediatR;
-
-namespace UniversalAdmin.Application.Commands
-{
- public class CreateUserCommand : IRequest
- {
- public string Username { get; set; } = string.Empty;
- public string Email { get; set; } = string.Empty;
- public string Password { get; set; } = string.Empty;
- public string? Phone { get; set; }
- public string? Avatar { get; set; }
- public string? FullName { get; set; }
- public string? Department { get; set; }
- public List RoleIds { get; set; } = new();
- }
-
- public class CreateUserResult
- {
- public int Id { get; set; }
- public string Username { get; set; } = string.Empty;
- public string Email { get; set; } = string.Empty;
- public DateTime CreatedAt { get; set; }
- }
-}
\ No newline at end of file
diff --git a/backend/src/UniversalAdmin.Application/UniversalAdmin.Application.csproj b/backend/src/UniversalAdmin.Application/UniversalAdmin.Application.csproj
index 9b86875..995963c 100644
--- a/backend/src/UniversalAdmin.Application/UniversalAdmin.Application.csproj
+++ b/backend/src/UniversalAdmin.Application/UniversalAdmin.Application.csproj
@@ -12,4 +12,9 @@
+
+
+
+
+
diff --git a/backend/src/UniversalAdmin.Domain/Entities/App/AppPemission.cs b/backend/src/UniversalAdmin.Domain/Entities/App/AppPemission.cs
deleted file mode 100644
index b0efd35..0000000
--- a/backend/src/UniversalAdmin.Domain/Entities/App/AppPemission.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace UniversalAdmin.Domain.Entities.App;
-public class AppPemission : EntityBase
-{
- public string Name { get; set; }
-
- public string Description { get; set; }
- public string Code { get; set; }
-
-#pragma warning disable CS8618
- protected AppPemission() { }
-
- public AppPemission(string name, string description, string code)
- {
-
- Name = name;
- Description = description;
- Code = code;
- }
-
-
-
-}
\ No newline at end of file
diff --git a/backend/src/UniversalAdmin.Domain/Entities/App/AppPermission.cs b/backend/src/UniversalAdmin.Domain/Entities/App/AppPermission.cs
new file mode 100644
index 0000000..043c18d
--- /dev/null
+++ b/backend/src/UniversalAdmin.Domain/Entities/App/AppPermission.cs
@@ -0,0 +1,17 @@
+namespace UniversalAdmin.Domain.Entities.App;
+
+public class AppPermission : EntityBase
+{
+ public string Name { get; set; }
+ public string Description { get; set; }
+#pragma warning disable CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑添加 "required" 修饰符或声明为可为 null。
+ protected AppPermission() { }
+#pragma warning restore CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑添加 "required" 修饰符或声明为可为 null。
+
+ public AppPermission(string code, string name, string description)
+ {
+ Code = code;
+ Name = name;
+ Description = description;
+ }
+}
\ No newline at end of file
diff --git a/backend/src/UniversalAdmin.Domain/Entities/App/AppRole.cs b/backend/src/UniversalAdmin.Domain/Entities/App/AppRole.cs
index 32556db..f991095 100644
--- a/backend/src/UniversalAdmin.Domain/Entities/App/AppRole.cs
+++ b/backend/src/UniversalAdmin.Domain/Entities/App/AppRole.cs
@@ -8,8 +8,8 @@ public class AppRole : EntityBase
{
public string Name { get; set; }
- private readonly List _rolePermission = new();
- public IReadOnlyCollection RolePemission => _rolePermission.AsReadOnly();
+ private readonly List _rolePermission = new();
+ public IReadOnlyCollection RolePemission => _rolePermission.AsReadOnly();
#pragma warning disable CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑添加 "required" 修饰符或声明为可为 null。
@@ -22,15 +22,15 @@ public class AppRole : EntityBase
Name = name;
}
//分配权限
- public void GreantPermission(AppPemission pemission)
+ public void GreantPermission(AppPermission pemission)
{
if (_rolePermission.Any(rq => rq.PermissionId == pemission.Id)) return;
- _rolePermission.Add(new AppRolePemission(this, pemission));
+ _rolePermission.Add(new AppRolePermission(this, pemission));
}
//收回权限
- public void RevokePermission(AppPemission appPemission)
+ public void RevokePermission(AppPermission appPemission)
{
var rq = _rolePermission.FirstOrDefault(rp => rp.PermissionId == appPemission.Id);
if (rq != null) _rolePermission.Remove(rq);
@@ -39,6 +39,6 @@ public class AppRole : EntityBase
public bool HasPemission(string permissionName)
{
- return _rolePermission.Any(rp => rp.Pemission.Name == permissionName);
+ return _rolePermission.Any(rp => rp.Permission.Name == permissionName);
}
}
\ No newline at end of file
diff --git a/backend/src/UniversalAdmin.Domain/Entities/App/AppRolePemission.cs b/backend/src/UniversalAdmin.Domain/Entities/App/AppRolePermission.cs
similarity index 72%
rename from backend/src/UniversalAdmin.Domain/Entities/App/AppRolePemission.cs
rename to backend/src/UniversalAdmin.Domain/Entities/App/AppRolePermission.cs
index 71a6fba..ec796df 100644
--- a/backend/src/UniversalAdmin.Domain/Entities/App/AppRolePemission.cs
+++ b/backend/src/UniversalAdmin.Domain/Entities/App/AppRolePermission.cs
@@ -3,7 +3,7 @@ namespace UniversalAdmin.Domain.Entities.App;
-public class AppRolePemission : EntityBase
+public class AppRolePermission : EntityBase
{
@@ -12,21 +12,21 @@ public class AppRolePemission : EntityBase
public AppRole Role { get; private set; }
public Guid PermissionId { get; private set; }
- public AppPemission Pemission { get; private set; }
+ public AppPermission Permission { get; private set; }
#pragma warning disable CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑添加 "required" 修饰符或声明为可为 null。
- protected AppRolePemission() { }
+ protected AppRolePermission() { }
#pragma warning restore CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑添加 "required" 修饰符或声明为可为 null。
- public AppRolePemission(AppRole role, AppPemission permission)
+ public AppRolePermission(AppRole role, AppPermission permission)
{
Role = role;
RoleId = role.Id;
- Pemission = permission;
+ Permission = permission;
PermissionId = permission.Id;
}
diff --git a/backend/src/UniversalAdmin.Domain/Entities/EntityBase.cs b/backend/src/UniversalAdmin.Domain/Entities/EntityBase.cs
index f443414..ec1f356 100644
--- a/backend/src/UniversalAdmin.Domain/Entities/EntityBase.cs
+++ b/backend/src/UniversalAdmin.Domain/Entities/EntityBase.cs
@@ -1,4 +1,3 @@
-using System.Reflection.Metadata;
namespace UniversalAdmin.Domain.Entities;
@@ -6,6 +5,7 @@ namespace UniversalAdmin.Domain.Entities;
public abstract class EntityBase
{
public Guid Id { get; set; } //分为long int Gui
+ public string? Code { get; set; }
public bool IsActived { get; set; } = true;
public bool IsDeleted { get; set; } = false;
diff --git a/backend/src/UniversalAdmin.Domain/Repositories/IRepository.cs b/backend/src/UniversalAdmin.Domain/Repositories/IRepository.cs
index 541e638..a8a8f5c 100644
--- a/backend/src/UniversalAdmin.Domain/Repositories/IRepository.cs
+++ b/backend/src/UniversalAdmin.Domain/Repositories/IRepository.cs
@@ -1,6 +1,6 @@
using UniversalAdmin.Domain.common;
-namespace Admin.Domain.Entities;
+namespace UniversalAdmin.Domain.Entities;
public interface IRepository
{
diff --git a/backend/src/UniversalAdmin.Domain/UniversalAdmin.Domain.csproj b/backend/src/UniversalAdmin.Domain/UniversalAdmin.Domain.csproj
index 125f4c9..accc665 100644
--- a/backend/src/UniversalAdmin.Domain/UniversalAdmin.Domain.csproj
+++ b/backend/src/UniversalAdmin.Domain/UniversalAdmin.Domain.csproj
@@ -1,5 +1,11 @@
+
+
+
+
+
+
net9.0
enable
diff --git a/backend/src/UniversalAdmin.Infrastructure/Data/UniversalDbContext.cs b/backend/src/UniversalAdmin.Infrastructure/Data/UniversalDbContext.cs
index b589d94..12c4008 100644
--- a/backend/src/UniversalAdmin.Infrastructure/Data/UniversalDbContext.cs
+++ b/backend/src/UniversalAdmin.Infrastructure/Data/UniversalDbContext.cs
@@ -13,144 +13,144 @@ public class UniversalDbContext : DbContext
public DbSet AppPermission { get; set; }
public DbSet AppUserRole { get; set; }
public DbSet AppRolePermission { get; set; }
- public DbSet AppFile { get; set; }
+ public DbSet AppFile { get; set; } }
- protected override void OnModelCreating(ModelBuilder modelBuilder)
- {
- base.OnModelCreating(modelBuilder);
+ // protected override void OnModelCreating(ModelBuilder modelBuilder)
+ // {
+ // base.OnModelCreating(modelBuilder);
- // 静态Id
- var adminUserId = Guid.Parse("11111111-1111-1111-1111-111111111111");
- var adminRoleId = Guid.Parse("22222222-2222-2222-2222-222222222222");
- var permUserManageId = Guid.Parse("33333333-3333-3333-3333-333333333333");
- var permRoleManageId = Guid.Parse("44444444-4444-4444-4444-444444444444");
+// // 静态Id
+// var adminUserId = Guid.Parse("11111111-1111-1111-1111-111111111111");
+// var adminRoleId = Guid.Parse("22222222-2222-2222-2222-222222222222");
+// var permUserManageId = Guid.Parse("33333333-3333-3333-3333-333333333333");
+// var permRoleManageId = Guid.Parse("44444444-4444-4444-4444-444444444444");
- var defaultTime = new DateTime(2025, 7, 2, 0, 0, 0, DateTimeKind.Utc);
- // 权限
- modelBuilder.Entity().HasData(
- new
- {
- Id = permUserManageId,
- Name = "User.Manage",
- Description = "用户管理",
- CreatedAt = defaultTime,
- UpdatedAt = defaultTime,
- IsActived = true,
- IsDeleted = false,
- CreatedBy = Guid.Empty,
- UpdatedBy = Guid.Empty,
- DisplayOrder = 0,
- Remarks = ""
- },
- new
- {
- Id = permRoleManageId,
- Name = "Role.Manage",
- Description = "角色管理",
- CreatedAt = defaultTime,
- UpdatedAt = defaultTime,
- IsActived = true,
- IsDeleted = false,
- CreatedBy = Guid.Empty,
- UpdatedBy = Guid.Empty,
- DisplayOrder = 0,
- Remarks = ""
- }
- );
+// var defaultTime = new DateTime(2025, 7, 2, 0, 0, 0, DateTimeKind.Utc);
+// // 权限
+// modelBuilder.Entity().HasData(
+// new
+// {
+// Id = permUserManageId,
+// Name = "User.Manage",
+// Description = "用户管理",
+// CreatedAt = defaultTime,
+// UpdatedAt = defaultTime,
+// IsActived = true,
+// IsDeleted = false,
+// CreatedBy = Guid.Empty,
+// UpdatedBy = Guid.Empty,
+// DisplayOrder = 0,
+// Remarks = ""
+// },
+// new
+// {
+// Id = permRoleManageId,
+// Name = "Role.Manage",
+// Description = "角色管理",
+// CreatedAt = defaultTime,
+// UpdatedAt = defaultTime,
+// IsActived = true,
+// IsDeleted = false,
+// CreatedBy = Guid.Empty,
+// UpdatedBy = Guid.Empty,
+// DisplayOrder = 0,
+// Remarks = ""
+// }
+// );
- // 角色
- modelBuilder.Entity().HasData(
- new
- {
- Id = adminRoleId,
- RoleName = "Admin",
- CreatedAt = defaultTime,
- UpdatedAt = defaultTime,
- IsActived = true,
- IsDeleted = false,
- CreatedBy = Guid.Empty,
- UpdatedBy = Guid.Empty,
- DisplayOrder = 0,
- Remarks = ""
- }
- );
+// // 角色
+// modelBuilder.Entity().HasData(
+// new
+// {
+// Id = adminRoleId,
+// RoleName = "Admin",
+// CreatedAt = defaultTime,
+// UpdatedAt = defaultTime,
+// IsActived = true,
+// IsDeleted = false,
+// CreatedBy = Guid.Empty,
+// UpdatedBy = Guid.Empty,
+// DisplayOrder = 0,
+// Remarks = ""
+// }
+// );
- // 用户
- modelBuilder.Entity().HasData(
- new
- {
- Id = adminUserId,
- UserName = "admin",
- Password = "113",
- Salt = "333",
- CreatedAt = defaultTime,
- UpdatedAt = defaultTime,
- IsActived = true,
- IsDeleted = false,
- CreatedBy = Guid.Empty,
- UpdatedBy = Guid.Empty,
- DisplayOrder = 0,
- Remarks = ""
- }
- );
+// // 用户
+// modelBuilder.Entity().HasData(
+// new
+// {
+// Id = adminUserId,
+// UserName = "admin",
+// Password = "113",
+// Salt = "333",
+// CreatedAt = defaultTime,
+// UpdatedAt = defaultTime,
+// IsActived = true,
+// IsDeleted = false,
+// CreatedBy = Guid.Empty,
+// UpdatedBy = Guid.Empty,
+// DisplayOrder = 0,
+// Remarks = ""
+// }
+// );
- // 用户-角色
- modelBuilder.Entity().HasData(
- new
- {
- Id = Guid.NewGuid(),
- UserId = adminUserId,
- RoleId = adminRoleId,
- CreatedAt = defaultTime,
- UpdatedAt = defaultTime,
- IsActived = true,
- IsDeleted = false,
- CreatedBy = Guid.Empty,
- UpdatedBy = Guid.Empty,
- DisplayOrder = 0,
- Remarks = ""
- }
- );
+// // 用户-角色
+// modelBuilder.Entity().HasData(
+// new
+// {
+// Id = Guid.NewGuid(),
+// UserId = adminUserId,
+// RoleId = adminRoleId,
+// CreatedAt = defaultTime,
+// UpdatedAt = defaultTime,
+// IsActived = true,
+// IsDeleted = false,
+// CreatedBy = Guid.Empty,
+// UpdatedBy = Guid.Empty,
+// DisplayOrder = 0,
+// Remarks = ""
+// }
+// );
- // 角色-权限
- modelBuilder.Entity().HasData(
- new
- {
- Id = Guid.NewGuid(),
- RoleId = adminRoleId,
- PermissionId = permUserManageId,
- CreatedAt = defaultTime,
- UpdatedAt = defaultTime,
- IsActived = true,
- IsDeleted = false,
- CreatedBy = Guid.Empty,
- UpdatedBy = Guid.Empty,
- DisplayOrder = 0,
- Remarks = ""
- },
- new
- {
- Id = Guid.NewGuid(),
- RoleId = adminRoleId,
- PermissionId = permRoleManageId,
- CreatedAt = defaultTime,
- UpdatedAt = defaultTime,
- IsActived = true,
- IsDeleted = false,
- CreatedBy = Guid.Empty,
- UpdatedBy = Guid.Empty,
- DisplayOrder = 0,
- Remarks = ""
- }
- );
- }
-}
+// // 角色-权限
+// modelBuilder.Entity().HasData(
+// new
+// {
+// Id = Guid.NewGuid(),
+// RoleId = adminRoleId,
+// PermissionId = permUserManageId,
+// CreatedAt = defaultTime,
+// UpdatedAt = defaultTime,
+// IsActived = true,
+// IsDeleted = false,
+// CreatedBy = Guid.Empty,
+// UpdatedBy = Guid.Empty,
+// DisplayOrder = 0,
+// Remarks = ""
+// },
+// new
+// {
+// Id = Guid.NewGuid(),
+// RoleId = adminRoleId,
+// PermissionId = permRoleManageId,
+// CreatedAt = defaultTime,
+// UpdatedAt = defaultTime,
+// IsActived = true,
+// IsDeleted = false,
+// CreatedBy = Guid.Empty,
+// UpdatedBy = Guid.Empty,
+// DisplayOrder = 0,
+// Remarks = ""
+// }
+// );
+// }
+// }
-public class AppRolePermission
-{
-}
+// public class AppRolePermission
+// {
+// }
-public class AppPermission
-{
-}
\ No newline at end of file
+// public class AppPermission
+// {
+// }
\ No newline at end of file
diff --git a/backend/src/UniversalAdmin.Infrastructure/Events/MediatRDomainEventPublisher.cs b/backend/src/UniversalAdmin.Infrastructure/Events/MediatRDomainEventPublisher.cs
new file mode 100644
index 0000000..1ea33f0
--- /dev/null
+++ b/backend/src/UniversalAdmin.Infrastructure/Events/MediatRDomainEventPublisher.cs
@@ -0,0 +1,25 @@
+// using UniversalAdmin.Application
+// using UniversalAdmin.Application.Common.Interfaces;
+// using UniversalAdmin.Domain.Events;
+// using MediatR;
+
+// namespace Admin2025.Infrastructure.Events;
+
+// ///
+// /// 基于MediatR的领域事件发布器
+// ///
+// public class MediatRDomainEventPublisher : IDomainEventPublisher
+// {
+// private readonly IMediator _mediator;
+
+// public MediatRDomainEventPublisher(IMediator mediator)
+// {
+// _mediator = mediator;
+// }
+
+// public async Task PublishAsync(TDomainEvent domainEvent) where TDomainEvent : IDomainEvent
+// {
+// var notification = new DomainEventNotification(domainEvent);
+// await _mediator.Publish(notification);
+// }
+// }
diff --git a/backend/src/UniversalAdmin.Infrastructure/Migrations/20250723015230_InitCreate.Designer.cs b/backend/src/UniversalAdmin.Infrastructure/Migrations/20250723015230_InitCreate.Designer.cs
new file mode 100644
index 0000000..ebe99ed
--- /dev/null
+++ b/backend/src/UniversalAdmin.Infrastructure/Migrations/20250723015230_InitCreate.Designer.cs
@@ -0,0 +1,388 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using UniversalAdmin.Infrastructure.Data;
+
+#nullable disable
+
+namespace UniversalAdmin.Infrastructure.Migrations
+{
+ [DbContext(typeof(UniversalDbContext))]
+ [Migration("20250723015230_InitCreate")]
+ partial class InitCreate
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.2")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppPermission", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Remarks")
+ .HasColumnType("text");
+
+ b.Property("UPdateBy")
+ .HasColumnType("uuid");
+
+ b.Property("UpdateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("AppPermission");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Remarks")
+ .HasColumnType("text");
+
+ b.Property("UPdateBy")
+ .HasColumnType("uuid");
+
+ b.Property("UpdateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("AppRole");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppRolePermission", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("PermissionId")
+ .HasColumnType("uuid");
+
+ b.Property("Remarks")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .HasColumnType("uuid");
+
+ b.Property("UPdateBy")
+ .HasColumnType("uuid");
+
+ b.Property("UpdateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PermissionId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AppRolePermission");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppUser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Avatar")
+ .HasColumnType("text");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("Email")
+ .HasColumnType("text");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("Nickname")
+ .HasColumnType("text");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Remarks")
+ .HasColumnType("text");
+
+ b.Property("Salt")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Telephone")
+ .HasColumnType("text");
+
+ b.Property("UPdateBy")
+ .HasColumnType("uuid");
+
+ b.Property("UpdateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("AppUser");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppUserRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("Remarks")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .HasColumnType("uuid");
+
+ b.Property("UPdateBy")
+ .HasColumnType("uuid");
+
+ b.Property("UpdateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AppUserRole");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.AppFile", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("ContentType")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("FileExtension")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("FileSize")
+ .HasColumnType("bigint");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("OriginFileName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Remarks")
+ .HasColumnType("text");
+
+ b.Property("StoragePath")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("StoredFileName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UPdateBy")
+ .HasColumnType("uuid");
+
+ b.Property("UpdateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.ToTable("AppFile");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppRolePermission", b =>
+ {
+ b.HasOne("UniversalAdmin.Domain.Entities.App.AppPermission", "Permission")
+ .WithMany()
+ .HasForeignKey("PermissionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("UniversalAdmin.Domain.Entities.App.AppRole", "Role")
+ .WithMany("RolePemission")
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Permission");
+
+ b.Navigation("Role");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppUserRole", b =>
+ {
+ b.HasOne("UniversalAdmin.Domain.Entities.App.AppRole", "Role")
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("UniversalAdmin.Domain.Entities.App.AppUser", "User")
+ .WithMany("UserRoles")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Role");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppRole", b =>
+ {
+ b.Navigation("RolePemission");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppUser", b =>
+ {
+ b.Navigation("UserRoles");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/src/UniversalAdmin.Infrastructure/Migrations/20250723015230_InitCreate.cs b/backend/src/UniversalAdmin.Infrastructure/Migrations/20250723015230_InitCreate.cs
new file mode 100644
index 0000000..f7aa577
--- /dev/null
+++ b/backend/src/UniversalAdmin.Infrastructure/Migrations/20250723015230_InitCreate.cs
@@ -0,0 +1,222 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace UniversalAdmin.Infrastructure.Migrations
+{
+ ///
+ public partial class InitCreate : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "AppFile",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ OriginFileName = table.Column(type: "text", nullable: false),
+ StoredFileName = table.Column(type: "text", nullable: false),
+ FileExtension = table.Column(type: "text", nullable: false),
+ ContentType = table.Column(type: "text", nullable: false),
+ FileSize = table.Column(type: "bigint", nullable: false),
+ StoragePath = table.Column(type: "text", nullable: false),
+ UserId = table.Column(type: "uuid", nullable: true),
+ Code = table.Column(type: "text", nullable: true),
+ IsActived = table.Column(type: "boolean", nullable: false),
+ IsDeleted = table.Column(type: "boolean", nullable: false),
+ CreateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ CreateBy = table.Column(type: "uuid", nullable: false),
+ UPdateBy = table.Column(type: "uuid", nullable: false),
+ DisplayOrder = table.Column(type: "integer", nullable: false),
+ Remarks = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppFile", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppPermission",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ Name = table.Column(type: "text", nullable: false),
+ Description = table.Column(type: "text", nullable: false),
+ Code = table.Column(type: "text", nullable: true),
+ IsActived = table.Column(type: "boolean", nullable: false),
+ IsDeleted = table.Column(type: "boolean", nullable: false),
+ CreateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ CreateBy = table.Column(type: "uuid", nullable: false),
+ UPdateBy = table.Column(type: "uuid", nullable: false),
+ DisplayOrder = table.Column(type: "integer", nullable: false),
+ Remarks = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppPermission", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppRole",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ Name = table.Column(type: "text", nullable: false),
+ Code = table.Column(type: "text", nullable: true),
+ IsActived = table.Column(type: "boolean", nullable: false),
+ IsDeleted = table.Column(type: "boolean", nullable: false),
+ CreateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ CreateBy = table.Column(type: "uuid", nullable: false),
+ UPdateBy = table.Column(type: "uuid", nullable: false),
+ DisplayOrder = table.Column(type: "integer", nullable: false),
+ Remarks = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppRole", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppUser",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ UserName = table.Column(type: "text", nullable: false),
+ Password = table.Column(type: "text", nullable: false),
+ Salt = table.Column(type: "text", nullable: false),
+ Nickname = table.Column(type: "text", nullable: true),
+ Avatar = table.Column(type: "text", nullable: true),
+ Telephone = table.Column(type: "text", nullable: true),
+ Email = table.Column(type: "text", nullable: true),
+ Code = table.Column(type: "text", nullable: true),
+ IsActived = table.Column(type: "boolean", nullable: false),
+ IsDeleted = table.Column(type: "boolean", nullable: false),
+ CreateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ CreateBy = table.Column(type: "uuid", nullable: false),
+ UPdateBy = table.Column(type: "uuid", nullable: false),
+ DisplayOrder = table.Column(type: "integer", nullable: false),
+ Remarks = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppUser", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppRolePermission",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ RoleId = table.Column(type: "uuid", nullable: false),
+ PermissionId = table.Column(type: "uuid", nullable: false),
+ Code = table.Column(type: "text", nullable: true),
+ IsActived = table.Column(type: "boolean", nullable: false),
+ IsDeleted = table.Column(type: "boolean", nullable: false),
+ CreateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ CreateBy = table.Column(type: "uuid", nullable: false),
+ UPdateBy = table.Column(type: "uuid", nullable: false),
+ DisplayOrder = table.Column(type: "integer", nullable: false),
+ Remarks = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppRolePermission", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AppRolePermission_AppPermission_PermissionId",
+ column: x => x.PermissionId,
+ principalTable: "AppPermission",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_AppRolePermission_AppRole_RoleId",
+ column: x => x.RoleId,
+ principalTable: "AppRole",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppUserRole",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ UserId = table.Column(type: "uuid", nullable: false),
+ RoleId = table.Column(type: "uuid", nullable: false),
+ Code = table.Column(type: "text", nullable: true),
+ IsActived = table.Column(type: "boolean", nullable: false),
+ IsDeleted = table.Column(type: "boolean", nullable: false),
+ CreateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdateAt = table.Column(type: "timestamp with time zone", nullable: false),
+ CreateBy = table.Column(type: "uuid", nullable: false),
+ UPdateBy = table.Column(type: "uuid", nullable: false),
+ DisplayOrder = table.Column(type: "integer", nullable: false),
+ Remarks = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppUserRole", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AppUserRole_AppRole_RoleId",
+ column: x => x.RoleId,
+ principalTable: "AppRole",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_AppUserRole_AppUser_UserId",
+ column: x => x.UserId,
+ principalTable: "AppUser",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppRolePermission_PermissionId",
+ table: "AppRolePermission",
+ column: "PermissionId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppRolePermission_RoleId",
+ table: "AppRolePermission",
+ column: "RoleId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppUserRole_RoleId",
+ table: "AppUserRole",
+ column: "RoleId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppUserRole_UserId",
+ table: "AppUserRole",
+ column: "UserId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "AppFile");
+
+ migrationBuilder.DropTable(
+ name: "AppRolePermission");
+
+ migrationBuilder.DropTable(
+ name: "AppUserRole");
+
+ migrationBuilder.DropTable(
+ name: "AppPermission");
+
+ migrationBuilder.DropTable(
+ name: "AppRole");
+
+ migrationBuilder.DropTable(
+ name: "AppUser");
+ }
+ }
+}
diff --git a/backend/src/UniversalAdmin.Infrastructure/Migrations/UniversalDbContextModelSnapshot.cs b/backend/src/UniversalAdmin.Infrastructure/Migrations/UniversalDbContextModelSnapshot.cs
new file mode 100644
index 0000000..809ee86
--- /dev/null
+++ b/backend/src/UniversalAdmin.Infrastructure/Migrations/UniversalDbContextModelSnapshot.cs
@@ -0,0 +1,385 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using UniversalAdmin.Infrastructure.Data;
+
+#nullable disable
+
+namespace UniversalAdmin.Infrastructure.Migrations
+{
+ [DbContext(typeof(UniversalDbContext))]
+ partial class UniversalDbContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.2")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppPermission", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Remarks")
+ .HasColumnType("text");
+
+ b.Property("UPdateBy")
+ .HasColumnType("uuid");
+
+ b.Property("UpdateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("AppPermission");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Remarks")
+ .HasColumnType("text");
+
+ b.Property("UPdateBy")
+ .HasColumnType("uuid");
+
+ b.Property("UpdateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("AppRole");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppRolePermission", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property("IsDeleted")
+ .HasColumnType("boolean");
+
+ b.Property("PermissionId")
+ .HasColumnType("uuid");
+
+ b.Property("Remarks")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .HasColumnType("uuid");
+
+ b.Property("UPdateBy")
+ .HasColumnType("uuid");
+
+ b.Property("UpdateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PermissionId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AppRolePermission");
+ });
+
+ modelBuilder.Entity("UniversalAdmin.Domain.Entities.App.AppUser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Avatar")
+ .HasColumnType("text");
+
+ b.Property("Code")
+ .HasColumnType("text");
+
+ b.Property("CreateAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreateBy")
+ .HasColumnType("uuid");
+
+ b.Property("DisplayOrder")
+ .HasColumnType("integer");
+
+ b.Property("Email")
+ .HasColumnType("text");
+
+ b.Property("IsActived")
+ .HasColumnType("boolean");
+
+ b.Property