20 lines
402 B
Go
20 lines
402 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func LogApiReq(c *gin.Context) {
|
|
//if config.AppEnv.Env() != gsf.EnvLocal {
|
|
// start := time.Now()
|
|
// c.Next()
|
|
// url := "contest::" + c.Request.URL.Path
|
|
// timeData := time.Since(start)
|
|
// date := time.Now().Format("20060102-15")
|
|
// sec := int(timeData / time.Second)
|
|
// _ = redis.ApiLog(url, date, sec)
|
|
//} else {
|
|
c.Next()
|
|
//}
|
|
}
|