You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
303 B
Go

8 months ago
package middleware
import (
"fmt"
"github.com/gin-gonic/gin"
)
func TestMiddleware(c *gin.Context) {
// 在请求处理之前执行的逻辑
fmt.Println("Start Logging")
// 将请求传递给下一个处理程序
c.Next()
// 在请求处理之后执行的逻辑
fmt.Println("End Logging")
}