ot_ifram.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package router
  2. import (
  3. "github.com/gin-gonic/gin"
  4. jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
  5. "go-admin/app/admin/apis"
  6. "go-admin/common/actions"
  7. "go-admin/common/middleware"
  8. )
  9. func init() {
  10. routerCheckRole = append(routerCheckRole, registerOtIframRouter)
  11. // routerNoCheckRole = append(routerNoCheckRole, registerOtIframNoCheckRouter)
  12. }
  13. // registerOtIframRouter
  14. func registerOtIframRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  15. api := apis.OtIfram{}
  16. r := v1.Group("/ot-ifram").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
  17. {
  18. r.GET("", actions.PermissionAction(), api.GetPage)
  19. r.GET("/:id", actions.PermissionAction(), api.Get)
  20. r.POST("", api.Insert)
  21. r.PUT("/:id", actions.PermissionAction(), api.Update)
  22. r.DELETE("", api.Delete)
  23. }
  24. }
  25. // func registerOtIframNoCheckRouter(v1 *gin.RouterGroup) {
  26. // api := apis.OtIfram{}
  27. // r := v1.Group("/test/ot-ifram")
  28. // {
  29. // r.GET("", actions.PermissionAction(), api.GetPage)
  30. // r.GET("/:id", actions.PermissionAction(), api.Get)
  31. // r.POST("", api.Insert)
  32. // r.PUT("/:id", actions.PermissionAction(), api.Update)
  33. // r.DELETE("", api.Delete)
  34. // }
  35. // }