deconstruction_what.py 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. from .base import BaseMySQLClient
  2. class DeconstructionWhat(BaseMySQLClient):
  3. async def insert_deconstruction_what(self, content_id, doc_id, what_text, description):
  4. query = """
  5. INSERT INTO deconstruction_what (doc_id, content_id, what_text, description)
  6. VALUES (%s, %s, %s, %s);
  7. """
  8. return await self.pool.async_save(
  9. query=query, params=(doc_id, content_id, what_text, description)
  10. )
  11. async def update_deconstruction_what_embedding_status(self, doc_id):
  12. query = """
  13. UPDATE deconstruction_what
  14. SET embedding_status = 1
  15. WHERE doc_id = %s
  16. """
  17. return await self.pool.async_save(
  18. query=query, params=(doc_id,)
  19. )
  20. async def insert_deconstruction_what_contents(self, content_id, content):
  21. query = """
  22. INSERT INTO deconstruction_what_contents (content_id, content)
  23. VALUES (%s, %s);
  24. """
  25. return await self.pool.async_save(
  26. query=query, params=(content_id, content,)
  27. )