cooler_box.go 991 B

1234567891011121314151617181920212223242526272829303132
  1. package router
  2. import (
  3. "cold-delivery/app/admin/controller"
  4. "cold-delivery/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, registerCoolerBoxRouter)
  10. }
  11. // 需认证的路由代码
  12. func registerCoolerBoxRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  13. cont := controller.CoolerBoxController{}
  14. r := v1.Group("/cooler-box").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
  15. {
  16. r.GET("", cont.GetPage)
  17. r.GET("/:id", cont.Get)
  18. r.POST("", cont.Insert)
  19. r.POST("/import", cont.BatchInsert)
  20. r.PUT("", cont.Update)
  21. r.DELETE("", cont.Delete)
  22. r.POST("/locus", cont.GetCollerBoxLocus)
  23. r.POST("/historylocus", cont.GetCoolerBoxLocus)
  24. r.GET("/getcoolerboxice", cont.GetCoolerBoxIce)
  25. r.GET("/getcoolerboxall", cont.GetCoolerBoxAll)
  26. r.POST("/coolerboxstarttime", cont.CoolerBoxStarTime)
  27. r.GET("/export-execl", cont.ExportExecl)
  28. }
  29. }