// 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 (t *TestController) Uri(ctx *gin.Context, formData *TestForm) (any, error) { return formData, nil } type TestForm struct { Meta `tag:"测试表单" path:"/a/b/c/d" desc:"测试接口" method:"get" strict:"true"` Age int `json:"age" form:"age"` Name string `json:"name" form:"name"` Test *Test `json:"test" form:"test"` Num *int64 `json:"num" form:"num"` } type Test struct { L string `json:"l"` } func Test_parseController(t *testing.T) { type args struct { controller any } Register(8080, &TestController{}) }