first commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using F9WebAiTest.Application.Contracts;
|
||||
|
||||
namespace F9WebAiTest.Application.Interfaces.LoginUsers;
|
||||
|
||||
/// <summary>登录用户服务(从当前请求上下文获取登录用户信息)</summary>
|
||||
public interface ILoginUserService
|
||||
{
|
||||
/// <summary>登录用户信息</summary>
|
||||
LoginUserInfo LoginUserInfo { get; }
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
using F9WebAiTest.Application.Dtos.SYS.Departments;
|
||||
using F9WebAiTest.Domain.Interfaces;
|
||||
|
||||
namespace F9WebAiTest.Application.Interfaces.Repositories.SYS.Departments;
|
||||
|
||||
/// <summary>部门读仓储(返回读模型 DTO)</summary>
|
||||
public interface IDepartmentReadRepository : IDInterface
|
||||
{
|
||||
Task<List<DepartmentReadDto_View>> GetAllAsync();
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using F9WebAiTest.Application.Dtos.SYS.RBAC.Menus;
|
||||
using F9WebAiTest.Domain.Interfaces;
|
||||
|
||||
namespace F9WebAiTest.Application.Interfaces.Repositories.SYS.RBAC.Menus;
|
||||
|
||||
/// <summary>菜单读仓储(返回读模型 DTO)</summary>
|
||||
public interface IMenuReadRepository : IDInterface
|
||||
{
|
||||
Task<MenuReadDto_Menu_Edit?> GetMenuByIdForEditAsync(long id);
|
||||
Task<bool> ExistMenuByTypeFullnameExcludeIdAsync(string typeFullname, long? excludeId);
|
||||
|
||||
Task<List<MenuReadDto_Menu_Table>> GetAllMenuAsync(string like, long? parentId);
|
||||
Task<List<MenuReadDto_Menu_Table>> GetTreeMenuAsync();
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
using F9WebAiTest.Application.Dtos.SYS.RBAC.Roles;
|
||||
using F9WebAiTest.Domain.Enums.SYS.RBAC;
|
||||
using F9WebAiTest.Domain.Interfaces;
|
||||
|
||||
namespace F9WebAiTest.Application.Interfaces.Repositories.SYS.RBAC.Roles;
|
||||
|
||||
/// <summary>角色读仓储(返回读模型 DTO)</summary>
|
||||
public interface IRoleReadRepository : IDInterface
|
||||
{
|
||||
/// <summary>查询单个</summary>
|
||||
Task<RoleReadDto_Edit> GetByIdAsync(long id);
|
||||
|
||||
/// <summary>获取所有对象集合</summary>
|
||||
Task<List<RoleReadDto_View>> GetAllAsync();
|
||||
|
||||
/// <summary>获取所有对象集合(缓存用)</summary>
|
||||
Task<List<RoleReadDto_Cache>> GetAllForCacheAsync();
|
||||
|
||||
/// <summary>通过资源类型获取角色权限集合</summary>
|
||||
Task<List<RolePermissionReadDto_View>> GetRolePermissionsByResourceType(long roleId, Resource_Type_Enum resourceType);
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
using F9WebAiTest.Application.Dtos.Common;
|
||||
using F9WebAiTest.Application.Dtos.SYS.RBAC.Users;
|
||||
using F9WebAiTest.Domain.Interfaces;
|
||||
|
||||
namespace F9WebAiTest.Application.Interfaces.Repositories.SYS.RBAC.Users;
|
||||
|
||||
/// <summary>用户读仓储(返回读模型 DTO)</summary>
|
||||
public interface IUserReadRepository : IDInterface
|
||||
{
|
||||
// 单个用户查询
|
||||
Task<UserReadDto_Edit> GetByIdAsync(long id);
|
||||
|
||||
// 通过 ID 集合查询用户集合
|
||||
Task<List<UserReadDto_Edit>> GetByIdsAsync(List<long> ids);
|
||||
|
||||
// 通过登录名查询
|
||||
Task<UserReadDto_Login> GetByLoginNameAsync(string loginName);
|
||||
|
||||
// 通过电话查询
|
||||
Task<UserReadDto_Login> GetByPhoneAsync(string phone);
|
||||
|
||||
// 条件分页查询
|
||||
Task<PagedResult<UserReadDto_View>> GetPagedAsync(long departmentId, string like, int page = 1, int pageSize = 10);
|
||||
|
||||
// 获取用户绑定角色集合
|
||||
Task<List<UserRoleReadDto_Cache>> GetUserRolesByUserId(long userId);
|
||||
|
||||
// 通过角色 ID 集合查询用户集合
|
||||
Task<List<UserReadDto_Edit>> GetByRoleIdsAsync(List<long> roleIds);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace F9WebAiTest.Application.Interfaces.Security;
|
||||
|
||||
/// <summary>密码哈希服务</summary>
|
||||
public interface IPasswordHasher
|
||||
{
|
||||
string Hash256(string input);
|
||||
string GetMd5Hash(string input);
|
||||
string HashPassword(string password);
|
||||
bool VerifyPassword(string password, string hashedPassword);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace F9WebAiTest.Application.Interfaces.SnowflakeID;
|
||||
|
||||
/// <summary>雪花 ID 生成器(ID 生成属于应用能力,故接口放在应用层)</summary>
|
||||
public interface ISnowflakeIdGenerator
|
||||
{
|
||||
long CreateId();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace F9WebAiTest.Application.Interfaces.UOW;
|
||||
|
||||
/// <summary>工作单元:在事务内执行一组操作(简化版,替代 F9 的 Begin/Commit/Rollback)</summary>
|
||||
public interface IUnitOfWork_F9
|
||||
{
|
||||
/// <summary>在事务内执行操作,返回是否提交成功(异常自动回滚)</summary>
|
||||
Task<bool> ExecuteWithUow(Func<Task<bool>> func);
|
||||
}
|
||||
Reference in New Issue
Block a user