kjh2064
|
c92118ab32
|
feat: migrate BlogController to FastEndpoints Endpoints (Phase 2)
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m25s
IMPLEMENTATION:
- Create 10 FastEndpoints Endpoint classes for Blog API:
- GetPublishedEndpoint: GET /api/blog (public, paginated)
- GetBySlugEndpoint: GET /api/blog/{slug} (public)
- GetByIdEndpoint: GET /api/blog/admin/{id} (auth)
- GetAllEndpoint: GET /api/blog/admin/all (auth)
- GetAdminPagedEndpoint: GET /api/blog/admin (auth, paginated)
- GetArchivedPagedEndpoint: GET /api/blog/admin/archived (auth, paginated)
- CreateEndpoint: POST /api/blog (auth)
- UpdateEndpoint: PUT /api/blog/{id} (auth)
- DeleteEndpoint: DELETE /api/blog/{id} (auth, archives post)
- RestoreEndpoint: POST /api/blog/{id}/restore (auth)
- Create BlogDtos.cs with shared response types:
- BlogPublishedQuery / BlogAdminQuery (query parameters)
- PaginatedResponse<T> (generic pagination response)
- BlogPostListResponse (list response)
- MessageResponse (simple message)
- Backup BlogController.cs (no longer active)
ARCHITECTURE:
- All endpoints use Endpoint<TRequest, TResponse> pattern
- BlogService injected via constructor DI
- Proper error handling with ThrowError()
- Authorization via Policies("Bearer") for protected endpoints
- AllowAnonymous() for public endpoints
VERIFICATION:
✅ dotnet build: 0 errors, 0 warnings
✅ dotnet test: 26/26 passed
✅ FastEndpoints auto-discovery working
Next Phase: Migrate remaining Controllers (18 total - 2 done = 16 remaining)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
2026-07-03 17:17:30 +09:00 |
|
kjh2064
|
675ef64975
|
feat: migrate AuthController to FastEndpoints Endpoints (Phase 1)
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m31s
IMPLEMENTATION:
- Create 4 FastEndpoints Endpoint classes:
- LoginEndpoint: POST /api/auth/login
- RefreshTokenEndpoint: POST /api/auth/refresh
- ChangePasswordEndpoint: POST /api/auth/change-password
- ResetPasswordEndpoint: POST /api/auth/reset-password
- Backup AuthController.cs (no longer active)
- Add FastEndpoints.Endpoint<TRequest, TResponse> pattern
- Implement proper DI with AuthService injection
- Use Policies("Bearer") for authorization
- Proper error handling with ThrowError()
ARCHITECTURE:
- Start of Phase 1: Core Auth APIs
- Endpoints follow FastEndpoints conventions
- DTOs: LoginRequest, RefreshTokenRequest, ChangePasswordRequest, ResetPasswordRequest, TokenPairResponse, MessageResponse
- AllowAnonymous for login/refresh/reset
- Bearer policy for change-password
VERIFICATION:
✅ dotnet build: 0 errors, 0 warnings
✅ dotnet test: 26/26 passed
✅ FastEndpoints auto-discovery working (no endpoint errors)
✅ JWT validation passes
Next Phase: BlogController and remaining APIs
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
2026-07-03 17:14:35 +09:00 |
|