|
@@ -245,6 +245,7 @@ async def email_authorizations_fetch_email(
|
|
|
bodyKeywords: str = Query("", description="邮件内容关键词, 支持多个关键词, 用逗号隔开"),
|
|
bodyKeywords: str = Query("", description="邮件内容关键词, 支持多个关键词, 用逗号隔开"),
|
|
|
sentDate: str = Query(..., description="发件日期, UTC时间, 格式: yyyy-mm-dd hh:mm:ss"),
|
|
sentDate: str = Query(..., description="发件日期, UTC时间, 格式: yyyy-mm-dd hh:mm:ss"),
|
|
|
expiry: int = Query(300, description="邮件有效期, 单位秒, 从sentDate 开始算起"),
|
|
expiry: int = Query(300, description="邮件有效期, 单位秒, 从sentDate 开始算起"),
|
|
|
|
|
+ onlyText: bool = Query(True, description="是否纯文本"),
|
|
|
db: AsyncSession = Depends(get_db)
|
|
db: AsyncSession = Depends(get_db)
|
|
|
):
|
|
):
|
|
|
auth = await EmailAuthorizationService.get_by_email(db, email)
|
|
auth = await EmailAuthorizationService.get_by_email(db, email)
|
|
@@ -257,7 +258,7 @@ async def email_authorizations_fetch_email(
|
|
|
body_keywords=bodyKeywords,
|
|
body_keywords=bodyKeywords,
|
|
|
sent_date=sentDate,
|
|
sent_date=sentDate,
|
|
|
expiry=expiry,
|
|
expiry=expiry,
|
|
|
- only_text=True
|
|
|
|
|
|
|
+ only_text=onlyText
|
|
|
)
|
|
)
|
|
|
return success(data={"body": result})
|
|
return success(data={"body": result})
|
|
|
|
|
|
|
@@ -269,6 +270,7 @@ async def email_authorizations_fetch_email_from_topn(
|
|
|
subjectKeywords: str = Query("", description="邮件主题关键词, 支持多个关键词, 用逗号隔开"),
|
|
subjectKeywords: str = Query("", description="邮件主题关键词, 支持多个关键词, 用逗号隔开"),
|
|
|
bodyKeywords: str = Query("", description="邮件内容关键词, 支持多个关键词, 用逗号隔开"),
|
|
bodyKeywords: str = Query("", description="邮件内容关键词, 支持多个关键词, 用逗号隔开"),
|
|
|
top: int = Query(10, description="指定从最近几封邮件读取"),
|
|
top: int = Query(10, description="指定从最近几封邮件读取"),
|
|
|
|
|
+ onlyText: bool = Query(True, description="是否纯文本"),
|
|
|
db: AsyncSession = Depends(get_db)
|
|
db: AsyncSession = Depends(get_db)
|
|
|
):
|
|
):
|
|
|
auth = await EmailAuthorizationService.get_by_email(db, email)
|
|
auth = await EmailAuthorizationService.get_by_email(db, email)
|
|
@@ -279,7 +281,7 @@ async def email_authorizations_fetch_email_from_topn(
|
|
|
subject_keywords=subjectKeywords,
|
|
subject_keywords=subjectKeywords,
|
|
|
body_keywords=bodyKeywords,
|
|
body_keywords=bodyKeywords,
|
|
|
top=top,
|
|
top=top,
|
|
|
- only_text=True
|
|
|
|
|
|
|
+ only_text=onlyText
|
|
|
)
|
|
)
|
|
|
return success(data={"body": result})
|
|
return success(data={"body": result})
|
|
|
|
|
|