docs: add FastEndpoints framework guidelines to ENGINEERING_HARNESS
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m3s
TaxBaik CI/CD / build-and-deploy (push) Failing after 1m3s
Documented FastEndpoints adoption: - Framework: FastEndpoints v5.30.0 - Naming convention: Create[Entity]Endpoint, Get[Entity]Endpoint, etc. - Location: Features/[DomainName]/ folder structure - Validation: FluentValidation integration - Coexistence: Controllers and FastEndpoints can run together - URL routing: Explicit routes to maintain API contracts Guidelines added to prevent URL conflicts and ensure consistent endpoint implementation pattern across API layers. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -88,6 +88,38 @@
|
||||
| Form | `XForm.razor` | 입력 컴포넌트와 UI validation |
|
||||
| Tests | unit + Playwright/API smoke | 회귀 방지 |
|
||||
|
||||
## FastEndpoints Framework
|
||||
|
||||
새 API 엔드포인트는 Controllers 대신 **FastEndpoints**로 구현한다.
|
||||
|
||||
| 규칙 | 실행 |
|
||||
| --- | --- |
|
||||
| Library | `FastEndpoints` v5.30.0 이상 |
|
||||
| Naming | `Create[Entity]Endpoint`, `Get[Entity]Endpoint`, `List[Entity]Endpoint` 등 |
|
||||
| Location | `src/TaxBaik.Web/Features/[DomainName]/` |
|
||||
| Pattern | Request DTO → Endpoint class → Response DTO |
|
||||
| Validation | FluentValidation (FastEndpoints 내장) |
|
||||
| Registration | `builder.Services.AddFastEndpoints()` + `app.MapFastEndpoints()` |
|
||||
| Coexistence | Controllers와 FastEndpoints는 PathBase 내에서 병행 가능 (URL 충돌만 피함) |
|
||||
|
||||
**주의**: 기존 Controllers에서 FastEndpoints로 마이그레이션 시, 기존 엔드포인트 URL(`/api/*`)이 변경되지 않도록 명시적 라우팅을 지정한다.
|
||||
|
||||
```csharp
|
||||
public class GetBlogEndpoint : Endpoint<GetBlogRequest, GetBlogResponse>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/blog/{id}");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetBlogRequest req, CancellationToken ct)
|
||||
{
|
||||
// Logic here
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Rendering Boundary
|
||||
|
||||
| 영역 | 렌더링 | 데이터 접근 |
|
||||
|
||||
Reference in New Issue
Block a user