Files
IOT_API/Model/Dto/System/OrgDto.cs
T
dengbolingandClaude Sonnet 4.6 6aca0297bb 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>
2026-09-10 17:31:39 +08:00

57 lines
1.9 KiB
C#

namespace Model.Dto.System
{
/// <summary>
/// 组织架构树节点 DTO(嵌套子级;含数据权限摘要)
/// </summary>
public class OrgTreeDto
{
public string Id { get; set; }
public string ParentId { get; set; }
public string Name { get; set; }
public string Code { get; set; }
public int OrgType { get; set; }
public int ShiftType { get; set; }
public string? Leader { get; set; }
public string? Phone { get; set; }
public int Sort { get; set; }
public string? Remark { get; set; }
public List<OrgTreeDto> Children { get; set; } = new();
/// <summary>直接挂靠用户数</summary>
public int UserCount { get; set; }
/// <summary>本组织及下级用户总数</summary>
public int TotalUserCount { get; set; }
/// <summary>数据权限摘要:本组织及下级用户的角色+数据范围(去重,如「实验室管理员·本组织及下级」)</summary>
public List<string> ScopeSummary { get; set; } = new();
}
/// <summary>
/// 组织架构编辑 DTO(新增/修改用)
/// </summary>
public class OrgDto
{
public string Id { get; set; }
public string ParentId { get; set; }
public string Name { get; set; }
public string Code { get; set; }
public int OrgType { get; set; }
public int ShiftType { get; set; }
public string? Leader { get; set; }
public string? Phone { get; set; }
public int Sort { get; set; }
public string? Remark { get; set; }
}
/// <summary>
/// 组织下拉选项 DTO(用户表单选组织用)
/// </summary>
public class OrgOptionDto
{
public string Id { get; set; }
public string Name { get; set; }
public int OrgType { get; set; }
}
}