支持解析路由前缀
This commit is contained in:
36
router/register_test.go
Normal file
36
router/register_test.go
Normal file
@ -0,0 +1,36 @@
|
||||
// Package router ...
|
||||
//
|
||||
// Description : router ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2024-07-20 23:24
|
||||
package router
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type TestController struct{}
|
||||
|
||||
func (t *TestController) RouterPrefix() string {
|
||||
return "/uri/prefix"
|
||||
}
|
||||
|
||||
func (t *TestController) RouterMiddleware() []gin.HandlerFunc {
|
||||
return []gin.HandlerFunc{
|
||||
func(ctx *gin.Context) {
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func Test_parseController(t *testing.T) {
|
||||
type args struct {
|
||||
controller any
|
||||
}
|
||||
parseController(TestController{})
|
||||
parseController(&TestController{})
|
||||
}
|
Reference in New Issue
Block a user