12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- 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)
-
- BillProduct(boxcost)
-
- Setting(boxcost)
-
- Signature(boxcost)
-
- Report(boxcost)
-
- Product(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)
- }
- }
|