2023-02-08 17:03:25 +08:00
|
|
|
import uuid
|
|
|
|
|
|
|
|
from sqlalchemy import Column, String, Boolean, ForeignKey, Enum, Text, DateTime, func, Integer
|
|
|
|
from Utils.SqlAlchemyUtils import Base
|
|
|
|
|
|
|
|
|
2023-02-09 10:54:07 +08:00
|
|
|
class AuthRuleNode(Base):
|
|
|
|
__tablename__ = "AUTH_RULE_NODE_TABLE"
|
|
|
|
id = Column(Integer, primary_key=True, comment="规则节点id")
|
|
|
|
name = Column(String(32), unique=True, comment="规则节点名称")
|
|
|
|
node_type = Column(Enum("category", "rule", name="节点类型"))
|
|
|
|
belong = Column(Integer, comment="所属节点")
|
2023-02-08 17:03:25 +08:00
|
|
|
|
|
|
|
def to_dict(self):
|
|
|
|
return {c.name: getattr(self, c.name) for c in self.__table__.columns}
|
|
|
|
|
2023-02-09 10:54:07 +08:00
|
|
|
|