Files
wcs/WCS.DAL/Db/AuthEnum/AuthEnum.cs
hehaibing-1996 e89b64ea3a !提交代码
2024-04-15 18:43:28 +08:00

59 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace WCS.DAL
{
/// <summary>
/// 认证项
/// </summary>
public enum AuthEnum
{
/* 注意枚举的值必须大于0 */
= 1000,
= 2000,
//[Description("用户")]
//[EnumTree(权限, new[] { 用户新增, 用户删除, 用户修改 })]
//用户管理 = 3100, 用户新增 = 3110, 用户删除, 用户修改,
//[Description("角色")]
//[EnumTree(权限, new[] { 角色新增, 角色删除, 角色修改 })]
//角色管理 = 3200, 角色新增 = 3210, 角色删除, 角色修改,
= 3000,
= 4000,
}
public class EnumTreeAttribute : Attribute
{
public EnumTreeAttribute() { }
public EnumTreeAttribute(AuthEnum parent)
{
Parent = parent;
}
public EnumTreeAttribute(AuthEnum[] childs)
{
Childs = childs;
}
public EnumTreeAttribute(AuthEnum parent, AuthEnum[] childs)
{
Parent = parent;
Childs = childs;
}
/// <summary>
/// 父级
/// </summary>
public AuthEnum? Parent { get; set; } = null;
/// <summary>
/// 子级
/// </summary>
public AuthEnum[]? Childs { get; set; } = null;
}
}