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