approveflow/middleware.go

34 lines
769 B
Go
Raw Permalink Normal View History

2024-11-14 17:02:41 +08:00
package main
import (
"fmt"
"github.com/Superdanda/hade/framework/gin"
)
func Test1() gin.HandlerFunc {
println("middle test1")
return func(c *gin.Context) {
fmt.Println("middleware pre test1")
c.Next() // 调用Next往下调用会自增contxt.index
fmt.Println("middleware post test1")
}
}
func Test2() gin.HandlerFunc {
println("middle test2")
return func(c *gin.Context) {
fmt.Println("middleware pre test2")
c.Next() // 调用Next往下调用会自增contxt.index
fmt.Println("middleware post test2")
}
}
func Test3() gin.HandlerFunc {
println("middle test3")
return func(c *gin.Context) {
fmt.Println("middleware pre test3")
c.Next() // 调用Next往下调用会自增contxt.index
fmt.Println("middleware post test3")
}
}