mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-13 02:26:36 +08:00
refactor(router): organize root routes and centralize v1 route registration
- Created `internal/router/root` package to register root-level paths - Moved files serving, robots.txt, and Swagger docs to `root/default.go` - Registered custom root routes under `root/custom.go` - Centralized all v1 routes registration in `internal/router/v1/v1.go` - Simplified `internal/router/router.go` by delegating route registration - Updated `new-api` skill `SKILL.md` to document the new router structure
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// Copyright 2026 Arctel.net
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package v1 contains router registrations for API V1
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// RegisterV1Routes registers all routes under API V1.
|
||||
func RegisterV1Routes(apiV1Router *gin.RouterGroup, apiGroup *gin.RouterGroup) {
|
||||
// 1. Public (captcha, health, config)
|
||||
RegisterPublicRoutes(apiV1Router, apiGroup)
|
||||
|
||||
// 2. OAuth, User, Upload
|
||||
RegisterUserRoutes(apiV1Router)
|
||||
|
||||
// 3. Admin
|
||||
RegisterAdminRoutes(apiV1Router)
|
||||
|
||||
// 4. Register custom business routes
|
||||
RegisterCustomRoutes(apiV1Router)
|
||||
}
|
||||
Reference in New Issue
Block a user