1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- package api
- import (
- "fmt"
- "github.com/gin-gonic/gin"
- )
- func RegRouters(svc *Service) {
- boxcost := svc.NewGinRouter("/" + svc.Conf.Name)
- boxcost.group.Use(Logger())
- boxcost.GET("/printr", Printr)
-
- Material(boxcost)
-
- Craft(boxcost)
-
- Process(boxcost)
-
- Supplier(boxcost)
-
- SupplierPrice(boxcost)
-
- Pack(boxcost)
-
- ProductPlan(boxcost)
-
- Bill(boxcost)
-
- Setting(boxcost)
- }
- 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)
- }
- }
|