21 lines
742 B
Python
21 lines
742 B
Python
from sqlalchemy import Column, BigInteger, String
|
|
from ..core.database import Base
|
|
|
|
|
|
class FunctionList(Base):
|
|
"""铁科平台功能列表"""
|
|
__tablename__ = "function_list"
|
|
|
|
id = Column(BigInteger, primary_key=True, index=True, autoincrement=True)
|
|
function_name = Column(String(255), nullable=False, comment="功能名称")
|
|
description = Column(String(1000), nullable=True, comment="描述")
|
|
path = Column(String(500), nullable=True, comment="路径")
|
|
postfix = Column(String(255), nullable=False, comment="后缀")
|
|
|
|
def to_dict(self):
|
|
"""将模型实例转换为字典"""
|
|
return {
|
|
column.name: getattr(self, column.name)
|
|
for column in self.__table__.columns
|
|
}
|