feat: 网关管理模块 + RBAC权限认证 + 组织架构 + 审计日志
- 网关管理:GatewayEntity/Service/Controller CRUD + 测试连接;设备 GatewayId 外键关联 - JWT 认证:登录签发 Token(权限编码写入 Claims)、RequirePermission 权限过滤器、CurrentUser 上下文 - RBAC:用户/角色/权限实体与 CRUD,预定义 4 角色 + 6 权限种子(admin/admin123) - 组织架构:sys_org 固定层级树(公司/实验室/部门/班组白夜班),层级校验,用户挂 OrgId/岗位/技能标签 - 数据权限:角色 DataScope(全部/本组织及下级),用户列表按组织子树过滤 - 防锁死保护:禁止删/禁自己,保证至少一名活跃管理员,角色摘除 user:manage 前校验 - 审计日志:AuditRecorder 接入设备增删改/指令下发/登录登出/组织变更,AuditController 查询 - 设备指令下发按网关表取连接参数;设备列表支持 gatewayId/productId 筛选 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
namespace Model.Dto.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户 DTO
|
||||
/// </summary>
|
||||
public class UserDto
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string? RealName { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public string OrgId { get; set; }
|
||||
public string? OrgName { get; set; }
|
||||
public string? Position { get; set; }
|
||||
public string? SkillTags { get; set; }
|
||||
public byte IsEnabled { get; set; }
|
||||
public DateTime? LastLoginTime { get; set; }
|
||||
public string? Avatar { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>用户的角色Id列表(分配角色用)</summary>
|
||||
public List<string>? RoleIds { get; set; }
|
||||
/// <summary>用户的角色名称(展示用,逗号分隔)</summary>
|
||||
public string? RoleNames { get; set; }
|
||||
/// <summary>初始密码(仅新增用户时传入,不回显)</summary>
|
||||
public string? InitialPassword { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登录请求 DTO
|
||||
/// </summary>
|
||||
public class LoginDto
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登录结果 DTO
|
||||
/// </summary>
|
||||
public class LoginResultDto
|
||||
{
|
||||
public string Token { get; set; }
|
||||
public string RefreshToken { get; set; }
|
||||
public UserDto User { get; set; }
|
||||
public List<string> Permissions { get; set; } = new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改密码 DTO
|
||||
/// </summary>
|
||||
public class ChangePasswordDto
|
||||
{
|
||||
public string OldPassword { get; set; }
|
||||
public string NewPassword { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户下拉选项 DTO
|
||||
/// </summary>
|
||||
public class UserOptionDto
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string? RealName { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user