Content: public read endpoints, Meilisearch posts index, ISR revalidation (Phase 4.4)
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 42/100
调研方向
从 CommunityPro.Search 模块模式、现有的 reindex 命令以及使用现有 search fake 的测试开始;Members/MembersTestHarness.cs 展示了项目的测试工具约定。跟踪由 #4 发出的 PostPublished 事件以及公共 endpoint 的分组约定。完成意味着所有验收标准都通过,包括过滤未发布的 post、具备韧性的同步和重新验证、稳定的错误代码,以及批量 reindex。
由索引模型根据 Issue 内容生成。
描述
Scope
Public read surface + search sync + frontend cache invalidation for the blog.
Endpoints (anonymous)
| Method | Path | Notes |
|---|---|---|
| GET | /posts |
published only, tag filter, paginated, newest first |
| GET | /posts/{slug} |
published only; feeds the ISR post page |
| GET | /posts/featured |
the single featured published post |
Meilisearch posts index
- Follow the
CommunityPro.Searchmodule patterns exactly (hand-rolled REST client, index+settings ensured at boot, sync-on-write handler that logs failures and never throws). - Document shape mirrors public card data only: id, slug, title, excerpt, tags, authorId, publishedAt. Searchable:
title, excerpt, tags; filterable:tags; sortable:publishedAt. Never index drafts/submitted/rejected posts — publish adds, unpublish/reject removes. - Extend the existing
reindexcommand (dotnet run -- reindex) to rebuildpostsalongsidemembersin 500-doc batches.
ISR revalidation
On PostPublished: POST {FRONTEND_URL}/api/revalidate?tag=post-{slug} with a shared secret header (REVALIDATE_SECRET — treat like any credential). Best-effort with logging; never fail the pipeline.
Error codes
content.not_found, search.unavailable (degrade like members search does)
Dependencies
Blocked by #3; consumes the PostPublished event emitted by #4.
Acceptance criteria
- Unpublished posts are unreachable via every public endpoint and absent from the index (query-level filtering, tested)
-
PostPublishedhandler upserts the search doc; failure is logged, not thrown - Revalidation call sends the secret and swallows/logs failures
-
reindexrebuilds posts (test via the existing search fakes)
Conventions (project-wide, non-negotiable)
- .NET 9, records for immutable shapes, file-scoped namespaces, primary constructors where they read well. Minimal-API endpoints grouped per module via
IEndpointModule.MapEndpoints. Result<T>(SharedKernel) instead of exception-driven control flow. Endpoint results map failures to ProblemDetails with the stable error codes listed above — the frontend keys off them.- Module owns its EF Core
DbContextmapped to its own Postgres schema. Modules never reference each other's internals — cross-module needs go through a public contract interface or an in-process domain event (IEventPublisher). - All external calls (GitHub, Stripe, Brevo, Cloudinary, Meilisearch) behind interfaces owned by the consuming module.
- Every list endpoint paginated (offset is fine). xUnit tests in
tests/CommunityPro.Tests/<Module>/following the existing harness patterns (seeMembers/MembersTestHarness.cs).
- 主要语言
- C#
- 星标
- 0
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CommunityPro/community-pro-api 的其他 Issue
-
cross-cutting decision
难度 5/5 一周以上 新手友好度 35/100
-
cross-cutting
难度 4/5 3-5 天 新手友好度 58/100
-
admin
难度 5/5 一周以上 新手友好度 35/100
-
admin
难度 5/5 一周以上 新手友好度 35/100
-
sponsorship
难度 4/5 3-5 天 新手友好度 48/100
查看 CommunityPro/community-pro-api 的全部 Issue
相似的 Issue
-
bug front-end social
难度 2/5 1-3 小时 新手友好度 72/100
gameguild-gg/gameguild#1237 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/microsoft-ui-xaml#12515 · 1 条评论 · 1 个 reaction ·
维护者通常 2 天内回复
-
[v5-preview5] `func new` displays incorrect command in error message when project is not initialized未关闭Needs: Triage (Functions) v5 v5-preview5
难度 1/5 1 小时以内 新手友好度 85/100
Azure/azure-functions-core-tools#5838 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
customer-reported needs-team-triage question server-Azure.Mcp tools-Pricing
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复