Refactor health check and user management endpoints for improved structure and clarity

- Replaced the existing health check endpoint with a new handler at `/admin/v1/health` to align with the updated API structure.
- Introduced a dedicated `health.go` file to encapsulate health check logic and response formatting.
- Updated Swagger documentation to reflect the new health check endpoint and its response structure.
- Refined user management routes to enhance clarity and maintainability, including changes to login, logout, and profile management endpoints.
- Ensured all user-related endpoints are now prefixed appropriately and documented in Swagger for better API usability.
This commit is contained in:
n.nakhostin
2025-08-10 19:06:20 +03:30
parent dbcc2d1d4a
commit 2119f49b9b
7 changed files with 1345 additions and 1190 deletions
+1 -7
View File
@@ -116,13 +116,7 @@ func initHTTPServer(conf infra.Config, log logger.Logger) *echo.Echo {
})
// Add health check endpoint
e.GET("/health", func(c echo.Context) error {
return c.JSON(http.StatusOK, map[string]interface{}{
"status": "healthy",
"time": time.Now().Unix(),
"version": "1.0.0",
})
})
e.GET("/admin/v1/health", healthHandler)
// Add Swagger documentation endpoint
e.GET("/swagger/*", echoSwagger.WrapHandler)