43 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""商机产线数据能力:从数据爬取平台拉取招标数据(只读)。
所有函数签名统一 (sor, **params),返回 (ok, payload|错误信息)。
薄封装:查询条件透传给爬虫平台,本层不做二次加工(热点排序由爬虫平台算)。
"""
from .opp_common import crawler_get
async def search_tenders(sor, keyword="", days=7, source="", only_it=True, limit=50):
"""关键词检索招标信息。"""
params = {"days": days, "limit": limit}
if keyword:
params["keyword"] = keyword
if source:
params["source"] = source
params["only_it"] = "1" if only_it else "0"
return await crawler_get(sor, "/api/tenders", params)
async def tender_detail(sor, tender_id):
"""单条招标详情(含公告全文、来源 url)。"""
return await crawler_get(sor, "/api/tenders/%s" % tender_id)
async def daily_ai_tenders(sor, target_date=""):
"""每日 AI/Agent 软件类招标展示数据。"""
params = {}
if target_date:
params["date"] = target_date
return await crawler_get(sor, "/api/ai_tenders", params)
async def hot_software(sor, days=30, top=10):
"""热点软件主题排名(数量+预算+热点地区+样例)。"""
return await crawler_get(sor, "/api/hot_software",
{"days": days, "top": top})
async def crawler_stats(sor):
"""爬虫平台采集健康度。"""
return await crawler_get(sor, "/api/stats")