完成基础路由注册, 遗留 : form表单, any数据类型解析失败
This commit is contained in:
@ -27,17 +27,19 @@ func (t *TestController) RouterMiddleware() []gin.HandlerFunc {
|
||||
}
|
||||
}
|
||||
func (t *TestController) Uri(ctx *gin.Context, formData *TestForm) (any, error) {
|
||||
return nil, nil
|
||||
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 any `json:"test" form:"test"`
|
||||
}
|
||||
|
||||
func Test_parseController(t *testing.T) {
|
||||
type args struct {
|
||||
controller any
|
||||
}
|
||||
parseController(TestController{})
|
||||
parseController(&TestController{})
|
||||
Register(8080, &TestController{})
|
||||
}
|
||||
|
Reference in New Issue
Block a user