Handler Layer Refactor (Gin + Services) #5

Open
opened 2025-10-23 21:41:52 +00:00 by H3ALY · 0 comments
Owner

Refactor handlers

  1. Create handlers//handler.go using Gin’s *gin.Context.
  2. Replace direct DB calls with service usage.

Create centralized router

  • internal/http/router.go registers all endpoints.

Add JSON response helpers

  • Add httputil for common responses and error mapping.

Acceptance Criteria

  1. All handlers are Gin-based.
  2. No direct DB imports in handlers.
  3. Unified error/response format.
**Refactor handlers** 1. Create handlers/<feature>/handler.go using Gin’s *gin.Context. 2. Replace direct DB calls with service usage. **Create centralized router** - internal/http/router.go registers all endpoints. **Add JSON response helpers** - Add httputil for common responses and error mapping. **Acceptance Criteria** 1. All handlers are Gin-based. 2. No direct DB imports in handlers. 3. Unified error/response format.
H3ALY added this to the 🛠 In Progress project 2025-10-23 21:41:52 +00:00
Sign in to join this conversation.