16 lines
464 B
Python
16 lines
464 B
Python
from db import SessionLocal
|
|
from models import MonitoringTopic
|
|
|
|
class MonitoringService:
|
|
def handle(self, message: str, mode: str, prefs: dict) -> dict:
|
|
db = SessionLocal()
|
|
topic = MonitoringTopic(
|
|
user_id="renato",
|
|
label=message,
|
|
sources="[]"
|
|
)
|
|
db.add(topic)
|
|
db.commit()
|
|
db.close()
|
|
return {"text": "[MONITORING] Vou monitorar esse tema e te avisar sobre novidades."}
|