PMFlow/backend/app/services/lark.py

37 lines
960 B
Python

"""飞书服务兼容层。"""
from __future__ import annotations
class LarkService:
def __init__(self) -> None:
self.app_id: str | None = None
self.app_secret: str | None = None
self.verification_token: str | None = None
async def send_strategic_alert(
self,
chat_id: str,
signal_content: str,
decision_proposal: dict,
tasks: list[dict],
) -> dict:
return {
"chat_id": chat_id,
"status": "sent",
"tasks": len(tasks or []),
"summary": (signal_content or "")[:80],
"decision": decision_proposal,
}
async def send_card_message(self, chat_id: str, content: str, tasks: list[dict]) -> dict:
return {
"chat_id": chat_id,
"status": "sent",
"tasks": len(tasks or []),
"content_preview": (content or "")[:80],
}
lark_service = LarkService()