12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package api
- import (
- "fmt"
- "github.com/gin-gonic/gin"
- )
- func RegRouters(svc *Service) {
- svc.Gin.Use(Logger())
-
- spud3dGroup := svc.NewGinRouter("/longyuan")
- spud3dGroup.POSTJWT("/login/succ", ServiceLoginSucc)
-
-
- FassiApi(spud3dGroup)
- CreateCatRouter(spud3dGroup)
- }
- func Logger() gin.HandlerFunc {
- return func(c *gin.Context) {
-
-
-
- c.Next()
-
-
-
-
- path := c.Request.URL.Path
- clientIP := c.ClientIP()
-
-
- out := fmt.Sprintf("%15s=> %s", clientIP, path)
- fmt.Println(out)
- }
- }
|