```
refactor(core,ai): 调整模块导入路径并移除废弃文件 - 修复 scheduler.py 中的导入路径错误,将 reports.service 改为 reports.services - 移除废弃的 app/core/background/task_queue.py 文件 - 移除废弃的 app/modules/ai_agent/adapters.py 文件 - 修复 ai_memory/service.py 中的导入路径错误,将 events.service 改为 events.services ```
This commit is contained in:
51
app/tasks/reports.py
Normal file
51
app/tasks/reports.py
Normal file
@@ -0,0 +1,51 @@
|
||||
from typing import Any
|
||||
|
||||
from app.core.constants import ActorValue
|
||||
from app.core.database import SessionLocal
|
||||
from app.modules.feishu.constants import FeishuReceiveIdType
|
||||
from app.tasks.app import celery_app
|
||||
|
||||
|
||||
@celery_app.task(name="reports.push_daily_brief")
|
||||
def push_daily_brief(
|
||||
receive_id: str | None = None,
|
||||
receive_id_type: str = FeishuReceiveIdType.CHAT_ID,
|
||||
actor: str = ActorValue.SCHEDULER,
|
||||
push_run_code: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
from app.modules.reports.services import ReportService
|
||||
|
||||
db = SessionLocal()
|
||||
try:
|
||||
report = ReportService(db).daily_brief()
|
||||
return ReportService(db).push_report(
|
||||
report,
|
||||
receive_id,
|
||||
receive_id_type,
|
||||
actor,
|
||||
push_run_code=push_run_code,
|
||||
)
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
@celery_app.task(name="reports.push_project_weekly")
|
||||
def push_project_weekly(
|
||||
receive_id: str | None = None,
|
||||
receive_id_type: str = FeishuReceiveIdType.CHAT_ID,
|
||||
actor: str = ActorValue.SCHEDULER,
|
||||
push_run_code: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
from app.modules.reports.services import ReportService
|
||||
|
||||
db = SessionLocal()
|
||||
try:
|
||||
report = ReportService(db).project_weekly()
|
||||
return ReportService(db).push_report(
|
||||
report,
|
||||
receive_id,
|
||||
receive_id_type,
|
||||
actor,
|
||||
push_run_code=push_run_code,
|
||||
)
|
||||
finally:
|
||||
db.close()
|
||||
Reference in New Issue
Block a user