123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package router
- import (
- "github.com/gin-gonic/gin"
- jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
- "go-admin/app/admin/apis"
- "go-admin/common/actions"
- "go-admin/common/middleware"
- )
- func init() {
- routerCheckRole = append(routerCheckRole, registerOtFireEventsRouter)
- routerNoCheckRole = append(routerNoCheckRole, registerOtFireEventsRouterNoCheck)
- }
- // registerOtFireEventsRouter
- func registerOtFireEventsRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- api := apis.OtFireEvents{}
- r := v1.Group("/fire-events").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
- {
- r.GET("", actions.PermissionAction(), api.GetPage)
- r.GET("/:id", actions.PermissionAction(), api.Get)
- r.POST("", api.Insert)
- r.POST("/notate/:id", actions.PermissionAction(), api.Notate)
- r.PUT("/:id", actions.PermissionAction(), api.Update)
- r.DELETE("", api.Delete)
- }
- }
- func registerOtFireEventsRouterNoCheck(v1 *gin.RouterGroup) {
- api := apis.OtFireEvents{}
- r := v1.Group("/test/fire-events")
- {
- r.GET("", api.GetPage)
- r.GET("/:id", api.Get)
- r.POST("", api.Insert)
- r.PUT("/:id", api.Update)
- r.POST("/notate/:id", api.Notate)
- r.DELETE("", api.Delete)
- }
- }
|