|
@@ -19,34 +19,22 @@ class KnowledgeFile(Base):
|
|
|
is_deleted = Column(Integer, default=0, comment='是否删除')
|
|
|
createTime = Column(DateTime, comment='创建时间')
|
|
|
updateTime = Column(DateTime, comment='更新时间')
|
|
|
- # 一个文件通过知识库的base_code来关联
|
|
|
knowledge_base_code = Column(String(50), ForeignKey('knowledge_base.base_code'), nullable=False)
|
|
|
knowledge_base = relationship("KnowledgeBase", back_populates="files")
|
|
|
|
|
|
|
|
|
class KnowledgeBase(Base):
|
|
|
__tablename__ = 'knowledge_base'
|
|
|
-
|
|
|
- # 知识库表主键
|
|
|
reportId = Column(String(255), primary_key=True)
|
|
|
- # 报告名称
|
|
|
reportName = Column(String(400), comment='报告名称')
|
|
|
- # 主题词
|
|
|
subject = Column(String(100), comment='主题词')
|
|
|
- # 事件类型 // 事件类型,字典项值(例如,自然灾害)
|
|
|
eventType = Column(String(10), comment='事件类型')
|
|
|
- # 发布日期
|
|
|
publishDate = Column(DateTime, comment='发布日期')
|
|
|
- # 来源单位
|
|
|
publishingUnit = Column(String(255), comment='来源单位')
|
|
|
- # 摘要
|
|
|
summary = Column(String(100), comment='摘要')
|
|
|
- # 知识类型notificationType
|
|
|
notificationType = Column(String(100), comment='知识类型')
|
|
|
- # 更新时间
|
|
|
updateTime = Column(DateTime, comment='更新时间')
|
|
|
- # 知识库的基础编码
|
|
|
base_code = Column(String(50), unique=True, comment='知识库的基础编码')
|
|
|
|
|
|
- # 关联文件
|
|
|
+ del_flag = Column(String(10), comment='是否删除')
|
|
|
files = relationship("KnowledgeFile", order_by=KnowledgeFile.id, back_populates="knowledge_base")
|