middleware.go 226 B

1234567891011121314
  1. package frame
  2. import (
  3. "github.com/gin-gonic/gin"
  4. )
  5. type IMidHandler func(*Context)
  6. func MidFactory(h IMidHandler) gin.HandlerFunc {
  7. return func(c *gin.Context) {
  8. webContext := &Context{Context: c}
  9. h(webContext)
  10. }
  11. }