123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- package api
- import (
- "fmt"
- "github.com/gin-gonic/gin"
- )
- func RegRouters(svc *Service) {
- _3dshow := svc.NewGinRouter("/" + svc.Conf.Name)
- _3dshow.group.Use(Logger())
- _3dshow.GET("/printr", Printr)
-
- Supply(_3dshow)
-
- Product(_3dshow)
-
- Address(_3dshow)
-
- Order(_3dshow)
-
- Collect(_3dshow)
- }
- 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)
- }
- }
|