123456789101112131415161718192021222324252627282930313233343536373839 |
- package router
- import (
- "cold-delivery/app/admin/controller"
- "cold-delivery/common/actions"
- "github.com/gin-gonic/gin"
- jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth"
- )
- func init() {
- routerCheckRole = append(routerCheckRole, registerIceRaftRouter)
- }
- // 需认证的路由代码
- func registerIceRaftRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- cont := controller.IceRaftController{}
- r := v1.Group("/ice-raft").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
- {
- r.GET("", cont.GetPage)
- r.GET("/newest-record", cont.GetNewestRecordPage)
- r.GET("/:id", cont.Get)
- r.GET("/code/:code", cont.GetByCode)
- r.POST("", cont.Insert)
- r.PUT("", cont.Update)
- r.DELETE("", cont.Delete)
- r.POST("/in-storage", cont.InStorage)
- r.POST("/out-storage", cont.OutStorage)
- r.GET("/newest-record-sse", cont.GetNewestRecordPageSSE)
- r.GET("/cooler-box", cont.GetPageByCoolerBoxId)
- }
- cont2 := controller.IceRaftRecordController{}
- r2 := v1.Group("/ice-raft-record").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
- {
- r2.GET("", cont2.GetPage)
- r2.PUT("", cont2.Update)
- r2.DELETE("", cont2.Delete)
- }
- }
|