// Package router ... // // Description : router ... // // Author : go_developer@163.com<白茶清欢> // // Date : 2025-01-27 19:33 package router import ( "github.com/gin-gonic/gin" "net/http" "strings" ) // Group 注册接口路由 // // Author : go_developer@163.com<白茶清欢> // // Date : 19:35 2025/1/27 func Group(router *gin.Engine, routerPrefix string, middlewareList []gin.HandlerFunc, cList ...any) error { g := router.Group(routerPrefix) g.Use(middlewareList...) cParser := controller{} for _, c := range cList { urlTable := cParser.Parse(c) for _, itemUriCfg := range urlTable { method := strings.ToUpper(itemUriCfg.Method) switch method { case http.MethodGet: g.HEAD(itemUriCfg.Path) } } } return nil }