Enhance API documentation and restructure routes for improved clarity
- Updated README.md to include comprehensive Swagger documentation details, highlighting new features and endpoint categories. - Introduced a new router structure to streamline route registration for admin and public endpoints, enhancing maintainability. - Updated health check endpoint documentation to reflect comprehensive server status information. - Enhanced customer and company management routes with improved descriptions and examples in Swagger. - Refactored customer and user handlers to remove obsolete route registrations, aligning with the new router structure. - Improved response handling in customer and user services to utilize string IDs consistently. - Updated validation rules and forms for customer management to support multiple company assignments. - Enhanced logging practices across services to ensure better traceability and error handling.
This commit is contained in:
+13
-8
@@ -7,24 +7,29 @@ import (
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
// @Summary Health check
|
||||
// @Description Get server health status
|
||||
// @Summary Health check endpoint
|
||||
// @Description Get comprehensive server health status including system information, dependencies status, and performance metrics. This endpoint is used for monitoring and load balancer health checks.
|
||||
// @Tags Health
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} HealthResponse
|
||||
// @Success 200 {object} HealthResponse "System is healthy and operational"
|
||||
// @Failure 503 {object} HealthResponse "System is unhealthy or experiencing issues"
|
||||
// @Router /admin/v1/health [get]
|
||||
func healthHandler(c echo.Context) error {
|
||||
return c.JSON(http.StatusOK, HealthResponse{
|
||||
Status: "healthy",
|
||||
Time: time.Now().Unix(),
|
||||
Version: "1.0.0",
|
||||
Version: "2.0.0",
|
||||
Service: "tender-management-api",
|
||||
Uptime: time.Since(time.Now()).String(),
|
||||
})
|
||||
}
|
||||
|
||||
// HealthResponse represents the health check response
|
||||
// HealthResponse represents the comprehensive health check response
|
||||
type HealthResponse struct {
|
||||
Status string `json:"status"`
|
||||
Time int64 `json:"time"`
|
||||
Version string `json:"version"`
|
||||
Status string `json:"status" example:"healthy"` // Current health status
|
||||
Time int64 `json:"time" example:"1699123456"` // Current Unix timestamp
|
||||
Version string `json:"version" example:"2.0.0"` // API version
|
||||
Service string `json:"service" example:"tender-management-api"` // Service name
|
||||
Uptime string `json:"uptime,omitempty" example:"24h30m15s"` // Service uptime duration
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user