ice_raft.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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, registerIceRaftRouter)
  10. }
  11. // 需认证的路由代码
  12. func registerIceRaftRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  13. cont := controller.IceRaftController{}
  14. r := v1.Group("/ice-raft").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
  15. {
  16. r.GET("", cont.GetPage)
  17. r.GET("/newest-record", cont.GetNewestRecordPage)
  18. r.GET("/:id", cont.Get)
  19. r.GET("/code/:code", cont.GetByCode)
  20. r.POST("", cont.Insert)
  21. r.PUT("", cont.Update)
  22. r.DELETE("", cont.Delete)
  23. r.POST("/in-storage", cont.InStorage)
  24. r.POST("/out-storage", cont.OutStorage)
  25. r.GET("/newest-record-sse", cont.GetNewestRecordPageSSE)
  26. r.GET("/cooler-box", cont.GetPageByCoolerBoxId)
  27. r.POST("/isoutstorage", cont.IsOutStorage)
  28. r.POST("/bindCoolerBox", cont.BindCoolerBox)
  29. r.POST("/UnbindCoolerBox", cont.UnBindCoolerBox)
  30. r.POST("/GetCoolerBoxBindCieRaft", cont.GetCoolerBoxBindCieRaft)
  31. r.GET("/GetCoolerIceRaft", cont.GetIceRaft)
  32. }
  33. cont2 := controller.IceRaftRecordController{}
  34. r2 := v1.Group("/ice-raft-record").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
  35. {
  36. r2.GET("", cont2.GetPage)
  37. r2.PUT("", cont2.Update)
  38. r2.DELETE("", cont2.Delete)
  39. r2.POST("/end-for-cold", cont2.EndForCold)
  40. r2.POST("/start-for-cold", cont2.StartForCold)
  41. r2.GET("/recording", cont2.IceRaftRecordRecording)
  42. r2.GET("/export-execl", cont2.ExportExecl)
  43. }
  44. }