ice_raft.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. }
  29. cont2 := controller.IceRaftRecordController{}
  30. r2 := v1.Group("/ice-raft-record").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
  31. {
  32. r2.GET("", cont2.GetPage)
  33. r2.PUT("", cont2.Update)
  34. r2.DELETE("", cont2.Delete)
  35. r2.POST("/end-for-cold", cont2.EndForCold)
  36. r2.POST("/start-for-cold", cont2.StartForCold)
  37. r2.GET("/recording", cont2.IceRaftRecordRecording)
  38. r2.GET("/export-execl", cont2.ExportExecl)
  39. }
  40. }