gin_no_req_logger.go 268 B

12345678910111213141516
  1. package http_middleware
  2. import (
  3. "github.com/gin-gonic/gin"
  4. )
  5. const IsNoLogHTTPRequest = "isNoLogHttpRequest"
  6. // 记录http响应结果
  7. func NoReqLogger() gin.HandlerFunc {
  8. return func(ctxt *gin.Context) {
  9. ctxt.Set(IsNoLogHTTPRequest, true)
  10. ctxt.Next()
  11. }
  12. }