直接完成
This commit is contained in:
11
pkg/app/handler_func.go
Normal file
11
pkg/app/handler_func.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package app
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func HandlerFunc(handler func(aw *Wrapper) Result) func(c *gin.Context) {
|
||||
return func(c *gin.Context) {
|
||||
aw := NewWrapper(c)
|
||||
res := handler(aw)
|
||||
c.JSON(200, res)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user