perf: skill

This commit is contained in:
ryan
2026-07-22 22:31:18 +08:00
parent fae83ab0fa
commit b1f2241d0a
9 changed files with 258 additions and 177 deletions
+4 -3
View File
@@ -1,7 +1,8 @@
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
// Package custom provides custom business handlers
// Package custom is a scaffold SAMPLE, not a product business home.
// Real domains live in internal/apps/<domain>/ (sibling of oauth, user, upload).
package custom
import (
@@ -12,9 +13,9 @@ import (
"github.com/Rain-kl/Wavelet/internal/common/response"
)
// Hello is a sample handler for custom business logic
// Hello is a sample handler only — do not grow real product logic in this package.
// @Summary Sample Hello API
// @Description A sample business API for customization
// @Description Scaffold demo API; product APIs use semantic paths under apps/<domain>
// @Tags custom
// @Produce json
// @Success 200 {object} response.Any{data=string} "成功"
+4 -2
View File
@@ -8,7 +8,9 @@ import (
"github.com/gin-gonic/gin"
)
// RegisterCustomRootRoutes registers custom business routes that belong to the root path.
// RegisterCustomRootRoutes is a scaffold SAMPLE placeholder for root-path routes
// (webhooks, short links). Prefer semantic paths and/or a dedicated root file;
// do not treat this as the only place for all product APIs. See skill new-api.
func RegisterCustomRootRoutes(_ *gin.Engine) {
// Add custom root routes here
// Sample only — add root-path demos here if needed
}
+3 -1
View File
@@ -9,7 +9,9 @@ import (
"github.com/gin-gonic/gin"
)
// RegisterCustomRoutes registers custom business routes to keep routing clean and stable.
// RegisterCustomRoutes is a scaffold SAMPLE only (demo: GET /api/v1/custom/hello).
// Real product APIs belong in apps/<domain>/ with semantic paths and a dedicated
// Register*Routes file (e.g. channel.go), not piled into this package. See skill new-api.
func RegisterCustomRoutes(apiV1Router *gin.RouterGroup) {
customRouter := apiV1Router.Group("/custom")
{
+2 -1
View File
@@ -16,6 +16,7 @@ func RegisterV1Routes(apiV1Router *gin.RouterGroup, apiGroup *gin.RouterGroup) {
// 2. Admin routes
RegisterAdminRoutes(apiV1Router)
// 3. Register custom business routes
// 3. Product domain routes: RegisterXxxRoutes(apiV1Router) — see skill new-api
// 4. Scaffold sample only (optional demo under /api/v1/custom)
RegisterCustomRoutes(apiV1Router)
}