Skip to content

Add optional AMap POI service and contributor setup docs - #8

Merged
kaikkd merged 1 commit into
kaikkd:mainfrom
RCF-117:codex/setup-amap-poi-service
Aug 18, 2026
Merged

Add optional AMap POI service and contributor setup docs#8
kaikkd merged 1 commit into
kaikkd:mainfrom
RCF-117:codex/setup-amap-poi-service

Conversation

@RCF-117

@RCF-117 RCF-117 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add docs/CONTRIBUTING.md and align local setup docs around uv, project-local caches, and health-check smoke tests
  • add an optional backend amap_service for AMap Web Service POI lookup with TTL caching and stub fallback
  • wire candidate POI flows through the new service while preserving the existing no-key stub behavior
  • ensure SQLite file database parent directories are created during backend startup

Notes

  • AMAP_KEY remains optional. Without it, local development and tests continue to use the existing stub data.
  • The AMap client degrades back to stub data on missing keys, request failures, empty responses, or invalid coordinates.
  • This keeps the change scoped to contributor setup and the POI service boundary, without requiring a paid service for new contributors.

Validation

  • uv run pytest -> 60 passed
  • npm test -- --run -> 10 passed
  • npm run build -> passed
  • FastAPI TestClient /health -> 200 {'status': 'ok'}

@RCF-117
RCF-117 marked this pull request as ready for review July 7, 2026 07:18

@kaikkd kaikkd left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本地复核通过:后端 60 项测试通过,前端 10 项测试通过,生产构建通过。高德响应解析、无 Key 降级、缓存和 SQLite 父目录处理整体清晰;留一条非阻塞的数据契约建议。


def _poi_out(p) -> dict:
return {
"amap_id": p.amap_id,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] 请把 amap_id 继续透传到前端候选/排程链路

这里开始返回真实高德 ID,但当前 frontend/src/api/client.tstoPoi() 仍固定写入 amap_id: nullSelectedPoiPayload 和后端 SelectedPoi 也没有该字段。因此 /plan/candidates 返回的 ID 在用户选中 POI 后立即丢失,后续反查、去重或 grounding 无法使用这次新增的数据。

这不阻塞当前展示,所以作为非阻塞建议:让 toPoi 使用 p.amap_id ?? null,并在 selected POI payload 与排程转换中继续透传;如果本 PR 有意只负责后端,请至少建立跟踪 issue。

@kaikkd
kaikkd merged commit e1e39ff into kaikkd:main Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants