add dockerfile and fix trival bugs (#78)

This commit is contained in:
KevinHuSh
2024-02-28 15:01:12 +08:00
committed by GitHub
parent eb517f3106
commit 39269d2f79
14 changed files with 243 additions and 52 deletions

View File

@ -107,4 +107,11 @@ class DocumentService(CommonService):
docs = cls.model.select(Knowledgebase.tenant_id).join(Knowledgebase, on=(Knowledgebase.id == cls.model.kb_id)).where(cls.model.id == doc_id, Knowledgebase.status==StatusEnum.VALID.value)
docs = docs.dicts()
if not docs:return
return docs[0]["tenant_id"]
return docs[0]["tenant_id"]
@classmethod
@DB.connection_context()
def get_thumbnails(cls, docids):
fields = [cls.model.id, cls.model.thumbnail]
return list(cls.model.select(*fields).where(cls.model.id.in_(docids)).dicts())