sys_dept.go 749 B

1234567891011121314151617181920212223242526272829
  1. package router
  2. import (
  3. "Medical_OAuth/app/admin/controller"
  4. "Medical_OAuth/common/actions"
  5. "Medical_OAuth/common/middleware"
  6. "github.com/gin-gonic/gin"
  7. jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth"
  8. )
  9. func init() {
  10. routerCheckRole = append(routerCheckRole, registerSysDeptRouter)
  11. }
  12. // 需认证的路由代码
  13. func registerSysDeptRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  14. cont := controller.SysDeptController{}
  15. r := v1.Group("/dept").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()).Use(actions.PermissionAction())
  16. {
  17. r.GET("", cont.GetPage)
  18. r.GET("/:id", cont.Get)
  19. r.POST("", cont.Insert)
  20. r.PUT("", cont.Update)
  21. r.DELETE("", cont.Delete)
  22. r.POST("/enter", cont.Enter)
  23. }
  24. }