feat 🐛:1.router.py,2,日报模板

v2025-07-11
许标 1 week ago
parent 62d7b0ebd0
commit 60342842ce

@ -136,7 +136,7 @@ async def upload_file(files: List[UploadFile] = File(...)):
summary="生成日报",
description="生成日报,将生成的简报和日报文档转成html返回前端",
)
async def generate_report(background_tasks: BackgroundTasks):
async def generate_report(background_tasks: BackgroundTasks, time_type: int = 0):
global data_dict
try:
logger.info("开始生成日报")
@ -148,7 +148,7 @@ async def generate_report(background_tasks: BackgroundTasks):
# 存储文件的路径
fold_path = str(Path(UPLOAD_DIR).resolve()).replace("\\", "/")
data_dict = deal_docx(fold_path, DOWNLOAD_DIR)
data_dict = deal_docx(fold_path, DOWNLOAD_DIR,time_type=time_type)
# 判断是否生成日报成功如果成功则转成html返回前端
report_sim_html = docx2html(data_dict["daily_repo_simple"])

Binary file not shown.
Loading…
Cancel
Save