first commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
using F9WebAiTest.Domain.Entities.SYS.Departments;
|
||||
|
||||
namespace F9WebAiTest.Domain.Interfaces.SYS.Departments;
|
||||
|
||||
/// <summary>部门用户关联写仓储</summary>
|
||||
public interface IDepartmentUserRepository : IDInterface
|
||||
{
|
||||
Task<bool> AssignAsync(DepartmentUser depUser);
|
||||
|
||||
Task<bool> RemoveAsync(long depId, long userId);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using F9WebAiTest.Domain.Entities.SYS.Departments;
|
||||
|
||||
namespace F9WebAiTest.Domain.Interfaces.SYS.Departments;
|
||||
|
||||
/// <summary>部门写仓储(聚合根仓储)</summary>
|
||||
public interface IDepartmentWriteRepository : IDInterface
|
||||
{
|
||||
/// <summary>返回聚合根</summary>
|
||||
Task<Department> GetByIdAsync(long id, CancellationToken cancellationToken);
|
||||
|
||||
Task<bool> AddAsync(Department dep);
|
||||
Task<bool> UpdateAsync(Department dep);
|
||||
Task<bool> SoftDeleteAsync(long id);
|
||||
Task<bool> ActiveOrDeactive(long id, bool active);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using F9WebAiTest.Domain.Entities.SYS.RBAC;
|
||||
|
||||
namespace F9WebAiTest.Domain.Interfaces.SYS.RBAC.Menus;
|
||||
|
||||
/// <summary>菜单写仓储(聚合根仓储)</summary>
|
||||
public interface IMenuWriteRepository : IDInterface
|
||||
{
|
||||
Task<Menu> GetByIdAsync(long id);
|
||||
Task<bool> AddAsync(Menu menu);
|
||||
Task<bool> UpdateAsync(Menu menu);
|
||||
Task<bool> SoftDeleteAsync(long id);
|
||||
Task<bool> ActiveOrDeactive(long id, bool active);
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
using F9WebAiTest.Domain.Entities.SYS.RBAC;
|
||||
using F9WebAiTest.Domain.Enums.SYS.RBAC;
|
||||
|
||||
namespace F9WebAiTest.Domain.Interfaces.SYS.RBAC.Permissions;
|
||||
|
||||
/// <summary>权限写仓储</summary>
|
||||
public interface IPermissionWriteRepository : IDInterface
|
||||
{
|
||||
Task<Permission> GetByIdAsync(Permission_Type_Enum permissionType, Resource_Type_Enum resourceType, long resourceId);
|
||||
Task<bool> AddRangeAsync(Permission[] entites);
|
||||
Task<bool> DeleteByResourceIdAndTypeAsync(Permission_Type_Enum permissionType, Resource_Type_Enum resourceType, long resourceId);
|
||||
Task<bool> DeleteByResourceIdAsync(long resourceId);
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
using F9WebAiTest.Domain.Entities.SYS.RBAC;
|
||||
|
||||
namespace F9WebAiTest.Domain.Interfaces.SYS.RBAC.Roles;
|
||||
|
||||
/// <summary>角色权限关联写仓储</summary>
|
||||
public interface IRolePermissionWriteRepository : IDInterface
|
||||
{
|
||||
Task<RolePermission> GetByIdAsync(long id);
|
||||
Task<bool> AssignAsync(RolePermission rolePermission);
|
||||
Task<bool> RemoveAsync(long id);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using F9WebAiTest.Domain.Entities.SYS.RBAC;
|
||||
|
||||
namespace F9WebAiTest.Domain.Interfaces.SYS.RBAC.Roles;
|
||||
|
||||
/// <summary>角色写仓储(聚合根仓储)</summary>
|
||||
public interface IRoleWriteRepository : IDInterface
|
||||
{
|
||||
Task<Role> GetByIdAsync(long id);
|
||||
Task<bool> AddAsync(Role role);
|
||||
Task<bool> UpdateAsync(Role role);
|
||||
Task<bool> SoftDeleteAsync(long id);
|
||||
Task<bool> ActiveOrDeactive(long id, bool active);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using F9WebAiTest.Domain.Entities.SYS.RBAC;
|
||||
|
||||
namespace F9WebAiTest.Domain.Interfaces.SYS.RBAC.Users;
|
||||
|
||||
/// <summary>
|
||||
/// 用户角色关联写仓储:不把 AssignRole 放在 IUserWriteRepository(避免污染聚合仓储),
|
||||
/// 而是定义独立的细粒度接口,应用层依赖此抽象,基础设施层实现。
|
||||
/// </summary>
|
||||
public interface IUserRoleWriteRepository : IDInterface
|
||||
{
|
||||
Task<bool> AssignAsync(UserRole userRole);
|
||||
|
||||
Task<bool> RemoveAsync(long userid, long roleId);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using F9WebAiTest.Domain.Entities.SYS.RBAC;
|
||||
|
||||
namespace F9WebAiTest.Domain.Interfaces.SYS.RBAC.Users;
|
||||
|
||||
/// <summary>用户写仓储(聚合根仓储)</summary>
|
||||
public interface IUserWriteRepository : IDInterface
|
||||
{
|
||||
/// <summary>返回聚合根</summary>
|
||||
Task<User> GetByIdAsync(long id);
|
||||
|
||||
Task<bool> AddAsync(User user);
|
||||
Task<bool> UpdateAsync(User user);
|
||||
Task<bool> SoftDeleteAsync(long id);
|
||||
Task<bool> ActiveOrDeactive(long id, bool active);
|
||||
|
||||
Task<bool> UpdatePassworkdAsync(long id, string passwordHash);
|
||||
Task<bool> UpdateLastLoginAtAsync(long id, DateTime dt);
|
||||
}
|
||||
Reference in New Issue
Block a user