mini-rbac/backend/models/menu.py

24 lines
991 B
Python
Raw Normal View History

2022-09-12 07:22:08 +00:00
from models.common import Table, fields
2022-09-11 10:34:18 +00:00
class MenuModel(Table):
"""
菜单表
"""
name = fields.CharField(max_length=20, description="名称", null=True)
2022-09-19 10:02:37 +00:00
icon = fields.CharField(max_length=100, description="菜单图标", null=True)
2022-09-11 10:34:18 +00:00
path = fields.CharField(max_length=128, description="菜单url", null=True)
2022-09-19 10:02:37 +00:00
type = fields.SmallIntField(description="菜单类型 0目录 1组件 2按钮 3数据")
2022-09-11 10:34:18 +00:00
component = fields.CharField(max_length=128, description="组件地址", null=True)
pid = fields.IntField(description="父id", null=True)
identifier = fields.CharField(max_length=30, description="权限标识 user:add", null=True)
api = fields.CharField(max_length=128, description="接口地址", null=True)
method = fields.CharField(max_length=10, description="接口请求方式", null=True)
class Meta:
table = "sys_menu"
table_description = "菜单表"
# 非唯一的索引
indexes = ("type", "name")