waybill.go 931 B

12345678910111213141516171819202122232425262728293031
  1. package router
  2. import (
  3. "cold-logistics/app/admin/controller"
  4. "cold-logistics/common/actions"
  5. "github.com/gin-gonic/gin"
  6. jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth"
  7. )
  8. func init() {
  9. routerCheckRole = append(routerCheckRole, registerWaybillRouter)
  10. }
  11. // 派费管理
  12. // 需认证的路由代码
  13. func registerWaybillRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  14. cont := controller.WaybillController{}
  15. r := v1.Group("/waybill").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
  16. {
  17. r.GET("", cont.GetPage)
  18. r.GET("/:id", cont.Get)
  19. r.POST("", cont.Insert)
  20. r.POST("/delivery", cont.Delivery)
  21. r.PUT("", cont.Update)
  22. r.DELETE("", cont.Delete)
  23. r.POST("/warehouse-in", cont.WarehouseIn) // 入库
  24. r.POST("/warehouse-out", cont.WarehouseOut) // 出库
  25. r.POST("/car-in", cont.CarIn) // 入库
  26. r.POST("/car-out", cont.CarIn) // 出库
  27. }
  28. }