26 lines
519 B
Go
26 lines
519 B
Go
|
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)
|
||
|
|
||
|
}
|