26 lines
519 B
Go
Raw Permalink Normal View History

2024-12-10 15:54:22 +01:00
package v1
import (
"git.anthrove.art/Anthrove/otter-cage/internal/api/v1/user"
"github.com/gin-gonic/gin"
)
type APIRouter struct {
Router *gin.RouterGroup
}
func NewAPIRouter(baseRouter *gin.RouterGroup) *APIRouter {
return &APIRouter{
Router: baseRouter,
}
}
func (api *APIRouter) InitializeRoutes() {
userGroup := api.Router.Group("/user/:user_id/source/:user_source_id")
userGroup.POST("/key", user.CreateApiKey)
userGroup.GET("/key", user.GetApiKey)
userGroup.DELETE("/key", user.DeleteApiKey)
}