mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-31 06:03:06 +02:00
- These changes makes the API incombatible with previous versions - Added new types for error handling, success responses, and health checks. - Updated health check logic to utilize the new types for better clarity and structure. - Refactored existing handlers to improve response consistency and error handling. - Updated Makefile to include a new target for generating API types from Swagger. - Updated "new agent" API to respond an encrypted cert pair
27 lines
652 B
Go
27 lines
652 B
Go
package routeApi
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/yusing/go-proxy/internal/route"
|
|
"github.com/yusing/go-proxy/internal/route/routes"
|
|
)
|
|
|
|
type RoutesByProvider map[string][]route.Route
|
|
|
|
// @x-id "byProvider"
|
|
// @BasePath /api/v1
|
|
// @Summary List routes by provider
|
|
// @Description List routes by provider
|
|
// @Tags route
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Success 200 {object} RoutesByProvider
|
|
// @Failure 403 {object} apitypes.ErrorResponse
|
|
// @Failure 500 {object} apitypes.ErrorResponse
|
|
// @Router /route/by_provider [get]
|
|
func ByProvider(c *gin.Context) {
|
|
c.JSON(http.StatusOK, routes.ByProvider())
|
|
}
|