```
feat: 添加仪表板路由和响应数据脱敏功能 - 添加了仪表板模块路由并集成到主路由器中 - 实现了敏感数据响应脱敏配置和功能 - 增加了 Feishu 审批卡片操作处理功能 - 支持通过任务队列异步推送日常简报和项目周报 - 添加了风险事件生成的任务队列支持 - 在 smoke 测试中增加了相关功能验证 refactor: 格式化模型注册模块导入列表 - 将单行导入列表改为多行格式以提高可读性 ```
This commit is contained in:
@@ -5,6 +5,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from app.core.database import get_db
|
||||
from app.core.security import ApiPrincipal, require_api_key
|
||||
from app.core.task_queue import enqueue_daily_brief_push, enqueue_project_weekly_push
|
||||
from app.modules.reports.schemas import (
|
||||
PushReportRequest,
|
||||
ReportResponse,
|
||||
@@ -16,12 +17,16 @@ router = APIRouter(dependencies=[Depends(require_api_key)])
|
||||
|
||||
|
||||
@router.get("/daily-brief", response_model=ReportResponse)
|
||||
def daily_brief(db: Session = Depends(get_db)) -> dict:
|
||||
def daily_brief(
|
||||
db: Session = Depends(get_db),
|
||||
) -> dict:
|
||||
return ReportService(db).daily_brief()
|
||||
|
||||
|
||||
@router.get("/project-weekly", response_model=ReportResponse)
|
||||
def project_weekly(db: Session = Depends(get_db)) -> dict:
|
||||
def project_weekly(
|
||||
db: Session = Depends(get_db),
|
||||
) -> dict:
|
||||
return ReportService(db).project_weekly()
|
||||
|
||||
|
||||
@@ -99,3 +104,27 @@ def push_project_weekly(
|
||||
payload.receive_id_type,
|
||||
principal.actor,
|
||||
)
|
||||
|
||||
|
||||
@router.post("/daily-brief/enqueue")
|
||||
def enqueue_daily_brief(
|
||||
payload: PushReportRequest,
|
||||
principal: ApiPrincipal = Depends(require_api_key),
|
||||
) -> dict:
|
||||
return enqueue_daily_brief_push(
|
||||
receive_id=payload.receive_id,
|
||||
receive_id_type=payload.receive_id_type,
|
||||
actor=principal.actor,
|
||||
)
|
||||
|
||||
|
||||
@router.post("/project-weekly/enqueue")
|
||||
def enqueue_project_weekly(
|
||||
payload: PushReportRequest,
|
||||
principal: ApiPrincipal = Depends(require_api_key),
|
||||
) -> dict:
|
||||
return enqueue_project_weekly_push(
|
||||
receive_id=payload.receive_id,
|
||||
receive_id_type=payload.receive_id_type,
|
||||
actor=principal.actor,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user