This commit is contained in:
白茶清欢 2024-09-30 15:25:58 +08:00
parent 36d4ca844a
commit 02cdc3c792

View File

@ -27,7 +27,7 @@ func TestRegisterRouter(t *testing.T) {
assert.Nil(t, err, "路由注册异常 : %v", err) assert.Nil(t, err, "路由注册异常 : %v", err)
} }
func demoApiFunc() RouterFunc { func demoApiFunc() RegisterFunc {
return func() (method string, uri string, handlerFunc gin.HandlerFunc, middlewareList []gin.HandlerFunc) { return func() (method string, uri string, handlerFunc gin.HandlerFunc, middlewareList []gin.HandlerFunc) {
return http.MethodGet, "/api/func/test", func(context *gin.Context) { return http.MethodGet, "/api/func/test", func(context *gin.Context) {
@ -59,7 +59,7 @@ func (d demoApi) GetHandler() gin.HandlerFunc {
type otherApi struct { type otherApi struct {
} }
func (oa *otherApi) DemoApiFunc() RouterFunc { func (oa *otherApi) DemoApiFunc() RegisterFunc {
return func() (method string, uri string, handlerFunc gin.HandlerFunc, middlewareList []gin.HandlerFunc) { return func() (method string, uri string, handlerFunc gin.HandlerFunc, middlewareList []gin.HandlerFunc) {
return http.MethodGet, "/api/other/test", func(context *gin.Context) { return http.MethodGet, "/api/other/test", func(context *gin.Context) {