// 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 nil, nil } type TestForm struct { Meta `tag:"测试表单" path:"/a/b/c/d" desc:"测试接口" method:"get" strict:"true"` } func Test_parseController(t *testing.T) { type args struct { controller any } parseController(TestController{}) parseController(&TestController{}) }