12345678910111213141516171819202122232425262728293031323334353637383940 |
- 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, registerOtIframRouter)
- routerNoCheckRole = append(routerNoCheckRole, registerOtIframNoCheckRouter)
- }
- // registerOtIframRouter
- func registerOtIframRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
- api := apis.OtIfram{}
- r := v1.Group("/ot-ifram").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
- {
- r.GET("", actions.PermissionAction(), api.GetPage)
- r.GET("/:id", actions.PermissionAction(), api.Get)
- r.POST("", api.Insert)
- r.PUT("/:id", actions.PermissionAction(), api.Update)
- r.DELETE("", api.Delete)
- }
- }
- func registerOtIframNoCheckRouter(v1 *gin.RouterGroup) {
- api := apis.OtIfram{}
- r := v1.Group("/test/ot-ifram")
- {
- r.GET("", actions.PermissionAction(), api.GetPage)
- r.GET("/:id", actions.PermissionAction(), api.Get)
- r.POST("", api.Insert)
- r.PUT("/:id", actions.PermissionAction(), api.Update)
- r.DELETE("", api.Delete)
- }
- }
|