feat: complete heaven readings and screener publication

This commit is contained in:
leefer
2026-08-05 23:44:17 +08:00
parent 1d01d114a5
commit c6d648cebe
34 changed files with 3538 additions and 225 deletions
+19
View File
@@ -131,6 +131,25 @@ class HeavenRepositoryMixin:
items = self.list_heaven_readings(user_id, mode, context_date, 1)
return items[0] if items else None
def heaven_reading_interpretation_version(
self, user_id: int, reading_id: int
) -> str:
with self.connect() as connection:
row = connection.execute(
"""
SELECT context_snapshot FROM heaven_readings
WHERE id = ? AND user_id = ?
""",
(int(reading_id), int(user_id)),
).fetchone()
if not row:
return ""
try:
snapshot = json.loads(str(row["context_snapshot"] or "{}"))
except (TypeError, json.JSONDecodeError):
return ""
return str(snapshot.get("interpretation_version") or "")
def delete_heaven_reading(self, user_id: int, reading_id: int) -> bool:
with self.connect() as connection:
cursor = connection.execute(